PyMorphy3

2.0.6 · active · verified Thu Apr 16

PyMorphy3 is a morphological analyzer (POS tagger + inflection engine) for the Russian language. It provides tools for parsing words, getting normal forms, and inflecting words into various grammatical forms. The current version is 2.0.6, and the library is actively maintained with frequent minor releases to support new Python versions and address issues.

Common errors

Warnings

Install

Imports

Quickstart

Initializes the MorphAnalyzer and demonstrates parsing a word to get its grammatical tag and normal form, then inflecting it to a different case.

import pymorphy3

morph = pymorphy3.MorphAnalyzer()

# Parse a word
word_analysis = morph.parse('стали')[0]
print(f"Word: {word_analysis.word}")
print(f"Tag: {word_analysis.tag}")
print(f"Normal form: {word_analysis.normal_form}")

# Inflect a word to a different form
inflected_word = word_analysis.inflect({'sing', 'datv'})
if inflected_word:
    print(f"Inflected form (singular, dative): {inflected_word.word}")

view raw JSON →