wordnet-morphy
WordNet-style morphological processing (morphy) for lemmatization. It checks exception lists, applies POS-specific suffix rules, and verifies candidates through a caller-supplied predicate (typically backed by wordnet-db) while sharing POS types from wordnet-types.
Why it's fast
- Pre-parsed exception files (
*.exc) cached in memory for O(1) lookups. - Fixed suffix rule tables per POS keep candidate generation tight and branch-light.
- No allocations for unchanged surface forms; minimal cloning otherwise, with normalization kept simple.
What you can do
- Lemmatize inflected forms into canonical WordNet lemmas (e.g., “running” → “run”).
- Carry provenance for each candidate (surface, exception, or rule-based) to inform downstream ranking.
- Plug into any loader via the
lemma_existscallback—commonlyWordNet::lemma_existsfromwordnet-db.
Related crates
wordnet-db: supplies the lemma existence predicate used to confirm morphy candidates.wordnet-types: provides the sharedPosenum and other types used in morphy APIs.
Docs
- API reference: https://docs.rs/wordnet-morphy