Russian Dictionaries for Pymorphy3

2.4.417150.4580142 · active · verified Thu Apr 16

pymorphy3-dicts-ru provides Russian morphological dictionaries primarily for the `pymorphy3` library. `pymorphy3` is an active morphological analyzer (POS tagger + inflection engine) for Russian and Ukrainian languages, serving as the continuation of the unmaintained `pymorphy2` project. While these dictionaries can be configured for `pymorphy2`, their main use case is with `pymorphy3`. The dictionary package is updated as needed, with the last release on January 8, 2022, complementing the more frequently updated `pymorphy3` library.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates the basic usage of `pymorphy3` which automatically leverages the installed `pymorphy3-dicts-ru` package. It shows how to initialize the `MorphAnalyzer` and parse a Russian word to get its normal form, part-of-speech tag, and grammemes.

import pymorphy3

# Initialize MorphAnalyzer (it automatically finds the installed dictionary)
morph = pymorphy3.MorphAnalyzer()

word = "красивая"
parsed_word = morph.parse(word)[0] # Get the first (most probable) parse

print(f"Original word: {word}")
print(f"Normal form: {parsed_word.normal_form}")
print(f"POS tag: {parsed_word.tag.POS}")
print(f"Grammemes: {', '.join(parsed_word.tag.grammemes)}")

word_not_found = "asasas"
parsed_unknown = morph.parse(word_not_found)
if not parsed_unknown:
    print(f"\nWord '{word_not_found}' not found in dictionary.")
else:
    print(f"\nParse for '{word_not_found}': {parsed_unknown[0].normal_form}")

view raw JSON →