{"id":8500,"library":"pymorphy2-dicts-ru","title":"Russian Dictionaries for Pymorphy2","description":"pymorphy2-dicts-ru provides the necessary Russian language dictionaries for the pymorphy2 morphological analyzer. It is a data-only package, with the core morphological analysis functionality residing in the `pymorphy2` library. The current version is 2.4.417127.4579844, released on October 11, 2020. The package itself does not have a separate release cadence, but it is maintained in conjunction with `pymorphy2`, which acts as a morphological analyzer, POS tagger, and inflection engine for Russian and Ukrainian languages.","status":"active","version":"2.4.417127.4579844","language":"en","source_language":"en","source_url":"https://github.com/kmike/pymorphy2-dicts/","tags":["nlp","russian","morphology","dictionary","linguistics","pos-tagging","inflection"],"install":[{"cmd":"pip install pymorphy2-dicts-ru pymorphy2","lang":"bash","label":"Install with pymorphy2"}],"dependencies":[{"reason":"This package provides dictionary data for pymorphy2; pymorphy2 is required to perform morphological analysis using these dictionaries.","package":"pymorphy2"}],"imports":[{"note":"The dictionaries are used by pymorphy2; direct import from pymorphy2_dicts_ru is not typical for analysis.","symbol":"MorphAnalyzer","correct":"from pymorphy2 import MorphAnalyzer"},{"note":"To explicitly get the installation path of the dictionary data.","symbol":"get_path","correct":"import pymorphy2_dicts_ru; dict_path = pymorphy2_dicts_ru.get_path()"}],"quickstart":{"code":"import pymorphy2\n\nmorph = pymorphy2.MorphAnalyzer(lang='ru')\n\nword = 'корова'\nparsed_word = morph.parse(word)[0]\nprint(f\"Original word: {word}\")\nprint(f\"Normal form: {parsed_word.normal_form}\")\nprint(f\"Part of speech: {parsed_word.tag.POS}\")\n\ninflected_word = parsed_word.inflect({'gent', 'plur'})\nif inflected_word:\n    print(f\"Inflected (genitive plural): {inflected_word.word}\")\n\nword_unknown = 'бутявка'\nparsed_unknown = morph.parse(word_unknown)[0]\nprint(f\"\\nUnknown word: {word_unknown}\")\nprint(f\"Normal form (heuristic): {parsed_unknown.normal_form}\")","lang":"python","description":"Initialize `pymorphy2.MorphAnalyzer` with `lang='ru'` to use the Russian dictionaries. Then, use methods like `parse()` to analyze words and `inflect()` to change their grammatical form."},"warnings":[{"fix":"Upgrade to Python 3.5 or newer. If using Python 2.7, be aware that future `pymorphy2` versions may drop support.","message":"`pymorphy2` (which uses these dictionaries) dropped official support for Python 2.6, 3.2, 3.3, and 3.4 in version 0.9. Python 2.7 support was also marked for removal in future v1.0 releases. Ensure your environment uses a compatible Python version (3.5+ recommended).","severity":"breaking","affected_versions":"pymorphy2 < 0.9.x, pymorphy2-dicts-ru 2.4.x"},{"fix":"Restart your Python kernel or environment after installing `pymorphy2` and `pymorphy2-dicts-ru` to ensure correct dictionary loading.","message":"When `pymorphy2` is installed after a Python process has started (e.g., within a Jupyter Notebook or Google Colab cell), it might fail to detect the installed dictionaries without restarting the kernel or process. This was a known issue in `pymorphy2` versions prior to 0.9.1.","severity":"gotcha","affected_versions":"pymorphy2 < 0.9.1"},{"fix":"For strict spell-checking, integrate an additional dictionary or apply custom filtering rules on the analysis results to distinguish between correct and commonly used incorrect forms.","message":"The OpenCorpora dictionaries used by `pymorphy2-dicts-ru` contain both correct and commonly used incorrect word forms. Therefore, methods like `word_is_known()` might return `True` for non-standard words, making it unsuitable for strict spell-checking without additional filtering.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Initialize `morph = pymorphy2.MorphAnalyzer(result_type=None)` for potentially faster processing at the cost of less descriptive return objects.","message":"By default, `pymorphy2.MorphAnalyzer` methods return `Parse` namedtuple objects. For performance-critical applications, especially in CPython, you can initialize `MorphAnalyzer` with `result_type=None` to receive plain tuples instead, which can be faster.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install the dictionary package: `pip install pymorphy2-dicts-ru`","cause":"The `pymorphy2` library was installed, but the `pymorphy2-dicts-ru` package, which provides the actual dictionary data, is missing.","error":"ValueError: Can't find a dictionary for language 'ru'. Installed languages: []. Try installing pymorphy2-dicts-ru package."},{"fix":"Install the core `pymorphy2` library: `pip install pymorphy2`","cause":"Attempting to use `pymorphy2.MorphAnalyzer` without installing the `pymorphy2` library itself. `pymorphy2-dicts-ru` only provides the dictionary data, not the analyzer.","error":"ImportError: No module named 'pymorphy2'"},{"fix":"Import `MorphAnalyzer` from `pymorphy2` and initialize it with `lang='ru'`: `from pymorphy2 import MorphAnalyzer; morph = MorphAnalyzer(lang='ru')`","cause":"Misconception that `pymorphy2_dicts_ru` is the main entry point for morphological analysis. The `MorphAnalyzer` class is part of the `pymorphy2` library.","error":"AttributeError: module 'pymorphy2_dicts_ru' has no attribute 'MorphAnalyzer'"}]}