Skip to main content

Static Dictionaries for Rapid Wordnet Lookups

Project description

WordNet Lookup

PyPI version PyPI downloads Python versions License Code style: ruff Pre-commit Tests

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.4.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.4-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wordnet_lookup-1.2.4.tar.gz
Algorithm Hash digest
SHA256 d0cc2987a65e1cf3c31c0572985136196a9cdf07f73c530309d99079d4218d12
MD5 3687a919e85f7307b9ee3e367d743b3a
BLAKE2b-256 9d685b84aa552d03c0a4669f168222036c31658d00f5bb8c8fe22d50863c9f31

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wordnet_lookup-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 58b126590d5ea58909061c43b98b7a39b9879129650d1905b502a403176d8b86
MD5 41feab9f0b668e16c4483d7d2436fd51
BLAKE2b-256 8312bd0bd76cd715c89235c543b7904fefb5ced74ed5d0cc23604f41109577a7

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