Skip to main content

WordNet Lookup

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

WordNet lookups in microseconds. No database. No downloads. No complexity.

Stop waiting for database queries or corpus downloads. wordnet-lookup gives you instant WordNet term validation using pre-compiled static dictionaries. One import, one function call, zero hassle.

Why This Exists

Traditional WordNet interfaces (NLTK, WordNet database) require corpus downloads, database connections, and I/O operations. For simple term validation, that's overkill. This library eliminates all of that by embedding WordNet terms directly in Python dictionaries. The result? Lookups in microseconds with zero external dependencies.

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

What This Library Does (and Doesn't Do)

Does:

  • Validates whether a term exists in WordNet 3.0
  • Handles basic plural forms automatically
  • Works offline with zero external dependencies

Doesn't:

  • Provide definitions, synonyms, or semantic relationships (use NLTK for that)
  • Include very recent terms, slang, or proper nouns (WordNet 3.0 is from 2006)
  • Update automatically with new WordNet versions (static snapshot)
  • Perform spell-checking or suggestions

Use this when: You need fast term validation for NLP preprocessing, filtering, or validation.

Don't use this when: You need definitions, synsets, semantic networks, or comprehensive spell-checking.

Documentation

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

How It Works

WordNet terms are stored as MD5 hash suffixes in 256 frozenset buckets (by first two hex characters of the hash). Lookups hash the input, route to the correct bucket, and perform O(1) set membership. Modules are lazy-loaded on first access per bucket.

For the gory details, see Implementation Notes.

Development

git clone https://github.com/craigtrim/wordnet-lookup.git
cd wordnet-lookup
make install  # Install dependencies
make test     # Run tests
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.

Links

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: wordnet_lookup-1.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 235e78ac1c7f5c0f7cc3ef6d6fac5a12912bf5dfcf1f1ed0ac3d0a0d8cb15b35
MD5 e764b4ef6ff24b66951786e8a0e9b9d3
BLAKE2b-256 1b1609bc81aa1a0c216603b0f213a105a7544437a31ac2b37ee2b8085fe61a58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wordnet_lookup-1.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d539814f2567e860d38892b416ce798bd76fa2a1a0ab6cedab0ecf92cffb457
MD5 4b4993ed3955e98a5a3c010bd334bf69
BLAKE2b-256 056bae8dd3c440f97fc0d7f5272a3147ca358dbf2351b30d5383d162069c618b

See more details on using hashes here.

Release history Release notifications | RSS feed

1.3.4

2 files

1.3.3

2 files

1.3.1

2 files

1.3.0

2 files

1.2.6

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

This release

1.2.0 This release

2 files

1.0.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page