Skip to main content

Static Dictionaries for Rapid Wordnet Lookups

Project description

WordNet Lookup

PyPI version Downloads Downloads/Month Tests Python 3.7+ License: MIT

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.

Quick Start

pip install wordnet-lookup
from wordnet_lookup import is_wordnet_term

# That's it. Start validating.
is_wordnet_term('alpha')        # True
is_wordnet_term('waddling')     # True
is_wordnet_term('myxovirus')    # True
is_wordnet_term('nonexistent')  # False

# Handles plurals automatically
is_wordnet_term('computers')    # True

# Case insensitive
is_wordnet_term('ALPHA')        # True

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) dictionary access
  • Smart Plurals - Automatically checks singular forms
  • Simple API - One function does it all

The Problem This Solves

In NLP, you frequently need to answer the question: "Is this token a real word?"

Not "what does it mean?" Not "give me synonyms." Just: is this a word?

is_wordnet_term('computer') is_wordnet_term('asdfgh')
True False

That's it. O(1) response. No ambiguity.

Why WordNet?

WordNet isn't the OED (too academic). It's not Urban Dictionary (too ephemeral). It's not a web scrape (too noisy).

It's a curated lexicon of ~88,000 common English words maintained by Princeton linguists. The kind of words that appear in newspapers, textbooks, and everyday conversation. If a token passes the WordNet test, you can be confident it's a legitimate, widely-recognized English word.

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
  • Spell-check pre-filtering: Quick reject obvious non-words before fuzzy matching
  • 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)

Documentation

For detailed usage, performance benchmarks, implementation details, and advanced features, see the API Documentation.

Development

git clone https://github.com/craigtrim/wordnet-lookup.git
cd wordnet-lookup
make all      # Full build pipeline

See API Documentation for detailed development information.

License

This package is dual-licensed:

  • Software: MIT License
  • WordNet Data: Princeton WordNet License

See LICENSE for complete terms.

Attribution

This package contains data derived from Princeton WordNet 3.0 (2006):

WordNet 3.0 Copyright 2006 by Princeton University. All rights reserved.

Note: This is a static snapshot of WordNet 3.0. The data is not automatically updated with newer WordNet releases.

See Also

  • bnc-lookup - Similar O(1) lookup using the British National Corpus (BNC)

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wordnet_lookup-1.2.6.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wordnet_lookup-1.2.6-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file wordnet_lookup-1.2.6.tar.gz.

File metadata

  • Download URL: wordnet_lookup-1.2.6.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.9 Darwin/25.3.0

File hashes

Hashes for wordnet_lookup-1.2.6.tar.gz
Algorithm Hash digest
SHA256 325376e96ca0f6db46e34936fa7bc1620e4bacc41f64c2cb65b58c1cfc764ef3
MD5 c344ffec4f9bd389d12b71ee4c19acf1
BLAKE2b-256 b34f23f8692a774df111a7dafda01f59efb672a5723d62f250f012a319faf7f9

See more details on using hashes here.

File details

Details for the file wordnet_lookup-1.2.6-py3-none-any.whl.

File metadata

  • Download URL: wordnet_lookup-1.2.6-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.9 Darwin/25.3.0

File hashes

Hashes for wordnet_lookup-1.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d922d0c5ee09d723a07fab8405e13817f42ff077e207b13a0074d52c8a4fccd5
MD5 68a4f346480a8ba0a17544b7eb77a4af
BLAKE2b-256 bcfc9adcafeac69412f4e57882a5c3f0d0c96e71dea56d246d936fbe15917eb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page