Skip to main content

Static Dictionaries for Rapid Wordnet Lookups

Project description

WordNet Lookup

PyPI version Python 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 pre-compiled into 26 alphabetically-organized dictionaries (A-Z). Lookups route to the appropriate dictionary based on the first character, check for the term, and fall back to singular forms if needed. Everything is case-insensitive.

Simple. Fast. Effective.

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

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.0.0.tar.gz (305.9 kB 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.0.0-py3-none-any.whl (307.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wordnet_lookup-1.0.0.tar.gz
  • Upload date:
  • Size: 305.9 kB
  • 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.0.0.tar.gz
Algorithm Hash digest
SHA256 85ad384dfcfaa55bebd0c2cb2f06539296a9ea6053320fb8bf4e8d12eae503eb
MD5 a2ae12bf013d6734ea8e28bdb55ed9dc
BLAKE2b-256 44130e7a146f326e11f3e5fc95af16b5532792c54565ea4a6a7c0f5e5d22b315

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wordnet_lookup-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 307.0 kB
  • 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 783688ca6aa546f94fcd2adce494c478ae9efbf45f394c975b6f4f26153b7f7c
MD5 0572c041ffaefaaeb12982f97586d66d
BLAKE2b-256 5e983b5eb7f723ee1d93bd63250b0522f14cc30c4b902376ca2594f036849b1f

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