WordNet Lookup
Is this token a word? O(1) answer. No setup. No dependencies.
A simple question deserves a simple answer. This library gives you instant yes/no validation against 88,000 common English words from the Princeton WordNet lexicon - plus morphological suffix extraction.
Quick Start
pip install wordnet-lookup
from wordnet_lookup import is_wordnet_term, get_suffixes, get_inflections, get_morphology
# Word existence - O(1), no I/O
is_wordnet_term('alpha') # True
is_wordnet_term('waddling') # True
is_wordnet_term('myxovirus') # True
is_wordnet_term('nonexistent') # False
# Case-insensitive, whitespace-tolerant
is_wordnet_term('ALPHA') # True
is_wordnet_term(' alpha ') # True
# Plurals handled automatically
is_wordnet_term('computers') # True
# Morphological suffix extraction
get_suffixes('happiness') # ['ness']
get_suffixes('beautifully') # ['ful', 'ly']
get_suffixes('nationalized') # ['al', 'ize', 'ed']
get_suffixes('cat') # [] - in WordNet, no derivational suffixes
get_suffixes('xyz123') # None - not in WordNet
# Inflectional suffix detection (runtime, not pre-computed)
get_inflections('cats') # ['s']
get_inflections('running') # ['ing']
get_inflections('walked') # ['ed']
get_inflections('fastest') # ['est']
get_inflections('cat') # [] - base form, no inflection
get_inflections('xyz123') # None - not in WordNet
# Combined morphological analysis
m = get_morphology('beautifully')
m.derivational # ['ful', 'ly']
m.inflectional # []
m = get_morphology('cats')
m.derivational # []
m.inflectional # ['s']
Features
- Zero Dependencies - Pure Python, no external packages
- Zero I/O - No filesystem access, no database queries
- Zero Setup - No corpus downloads or configuration
- Microsecond Lookups - O(1) hash-based access
- Smart Plurals - Automatically checks singular forms
- Unicode Normalization - Accented forms (e.g.
naïve,café) resolved to ASCII - Suffix Extraction -
get_suffixes()returns derivational suffixes in order, orNoneif the word isn't in WordNet - Inflectional Detection -
get_inflections()detects -s, -es, -ing, -ed, -est at runtime with allomorphic stem restoration - Combined Morphology -
get_morphology()returns aMorphologydataclass with both derivational and inflectional suffix lists
When to Use This
- Tokenization filtering - Keep real words, discard garbage
- Input validation - Reject nonsense in user input
- NLP preprocessing - Filter candidates before expensive operations
- Morphological analysis - Identify suffix chains for stemming pipelines
- Data cleaning - Identify malformed or corrupted text
What This Doesn't Do
- No definitions, synonyms, or semantic relationships (use spaCy for that)
- No slang, proper nouns, or recent coinages (WordNet is from 2006)
- No spell-checking or suggestions (just yes/no)
- No hyphenated compounds or multi-word phrases
Documentation
See API Documentation and Implementation Notes for full details.
Development
git clone https://github.com/craigtrim/wordnet-lookup.git
cd wordnet-lookup
make all # Full build pipeline
License
Dual-licensed: MIT (software) + Princeton WordNet License (data). See LICENSE.
WordNet 3.0 Copyright 2006 by Princeton University. All rights reserved.
See Also
- bnc-lookup - O(1) lookup using the British National Corpus
- morphroot - Suffix extraction pipeline that feeds this library
Links
- Repository: github.com/craigtrim/wordnet-lookup
- PyPI: pypi.org/project/wordnet-lookup
- WordNet: wordnet.princeton.edu
Metadata
Release files for wordnet-lookup 1.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wordnet_lookup-1.3.4.tar.gz | 2.3 MB | Without provenance | Details for wordnet_lookup-1.3.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wordnet_lookup-1.3.4-py3-none-any.whl | Python 3 | none | any | Details for wordnet_lookup-1.3.4-py3-none-any.whl |
Total release size: 4.8 MB
Release files / wordnet_lookup-1.3.4.tar.gz
| Download URL | wordnet_lookup-1.3.4.tar.gz |
|---|---|
| Size | 2.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7dd464629cafa4ed0587d945bc8bbe56759e2b3bf9c52f516d6d009bd96768ae
|
|
BLAKE2b-256 checksum How to use checksums |
576cdb23a92a48b07d17ce4652540df8bb3573d79ee3ffbf6fe31e0b5b5e6036
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.11.9 Darwin/25.3.0
|
Release files / wordnet_lookup-1.3.4-py3-none-any.whl
| Download URL | wordnet_lookup-1.3.4-py3-none-any.whl |
|---|---|
| Size | 2.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec3d3464c9e310835eae28b736aba5445e6fdfd66f04e21da0f49e2009ac22ef
|
|
BLAKE2b-256 checksum How to use checksums |
2dfa55c36c2c5850d54dd318722fd3e31d800107ecca5f78a33d9076ef71d3fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.11.9 Darwin/25.3.0
|
Security for wordnet-lookup 1.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.