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

Uploaded Python 3

File details

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

File metadata

  • Download URL: wordnet_lookup-1.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 c110b47131905d4e47d1711164c83e5a4c211fc58aa483d7a0cd4a02e1123eed
MD5 9df250c8b296ea926a091b095d8b3b5e
BLAKE2b-256 d9738b75f9d228ec1530ae46a52d5478221270d77c1b8fbf94eac1d2bc8d99f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wordnet_lookup-1.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d0e743e9591890629bd52fdb60cfa4ea133dd1a3a7369671d442bdedfebc737f
MD5 6b33e1116ef0790b9c71a71fdb971357
BLAKE2b-256 a8a32f4d39c54ad45eb2d2d97e86b236c05ca881b590f96d5d22c8c6583f072f

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