A Python module for English lemmatization and inflection (generating inflected forms from lemmas). It provides a lookup-based and rule-based approach for verbs, nouns, adjectives, and adverbs. Current version: 0.2.3 (last release April 2022). Release cadence is low.
pip install lemminflectVerified import paths — ran on the pinned version, not inferred.
Basic lemmatization and inflection using Penn Treebank POS tags.
Use PTB tags: VB (verb base), VBD (past), VBG (gerund), VBN (past participle), VBP (present non-3rd), VBZ (present 3rd), NN (noun), NNS (plural noun), JJ (adjective), JJR (comparative), JJS (superlative), RB (adverb), RBR (comparative adverb), RBS (superlative adverb).
Always check the return value: e.g., result = getLemma('word', 'NN'); if result: ... else: handle unknown.Consider using spaCy's built-in lemmatizer or the 'simplemma' library for active development.
Use fallback to a rule-based lemmatizer (e.g., NLTK's WordNetLemmatizer) or add custom mappings.
Check if the lemma exists: getLemma('fly', 'VB') should return 'fly'. Then try getInflection with the correct lemma. If still empty, consider using getAllInflections('fly') to see all known forms.