{"id":7588,"library":"pymorphy3-dicts-ru","title":"Russian Dictionaries for Pymorphy3","description":"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.","status":"active","version":"2.4.417150.4580142","language":"en","source_language":"en","source_url":"https://github.com/no-plagiarism/pymorphy3-dicts","tags":["NLP","morphology","Russian","linguistics","dictionaries"],"install":[{"cmd":"pip install pymorphy3-dicts-ru pymorphy3","lang":"bash","label":"Install with core library"}],"dependencies":[{"reason":"Provides the core morphological analysis functionality that uses these dictionaries.","package":"pymorphy3","optional":false}],"imports":[{"note":"This is primarily for internal use or advanced custom configurations; direct interaction with the dictionary package is rare.","symbol":"get_path","correct":"import pymorphy3_dicts_ru\ndict_path = pymorphy3_dicts_ru.get_path()"},{"note":"The primary way to use the dictionaries is through the MorphAnalyzer class from the `pymorphy3` library.","symbol":"MorphAnalyzer","correct":"from pymorphy3 import MorphAnalyzer"}],"quickstart":{"code":"import pymorphy3\n\n# Initialize MorphAnalyzer (it automatically finds the installed dictionary)\nmorph = pymorphy3.MorphAnalyzer()\n\nword = \"красивая\"\nparsed_word = morph.parse(word)[0] # Get the first (most probable) parse\n\nprint(f\"Original word: {word}\")\nprint(f\"Normal form: {parsed_word.normal_form}\")\nprint(f\"POS tag: {parsed_word.tag.POS}\")\nprint(f\"Grammemes: {', '.join(parsed_word.tag.grammemes)}\")\n\nword_not_found = \"asasas\"\nparsed_unknown = morph.parse(word_not_found)\nif not parsed_unknown:\n    print(f\"\\nWord '{word_not_found}' not found in dictionary.\")\nelse:\n    print(f\"\\nParse for '{word_not_found}': {parsed_unknown[0].normal_form}\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Install `pymorphy3` and update your code to use `pymorphy3.MorphAnalyzer`. The dictionary package `pymorphy3-dicts-ru` is primarily designed for `pymorphy3`.","message":"The `pymorphy2` library, which previously used similar dictionaries, is unmaintained. Users should migrate to `pymorphy3` for ongoing support and new features.","severity":"breaking","affected_versions":"<= `pymorphy2` latest"},{"fix":"Initialize `pymorphy3.MorphAnalyzer()` once at the beginning of your application or process and reuse the same instance throughout. Dictionaries are large and caching them is essential for performance.","message":"Repeatedly calling `pymorphy3.MorphAnalyzer()` to create new instances within your application will cause slow performance, especially during startup, as dictionaries are reloaded each time.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always install and use `pymorphy3` with `pymorphy3-dicts-ru` for the most up-to-date and supported functionality. While limited compatibility with `pymorphy2` might exist, it's not the recommended path.","message":"The PyPI description for `pymorphy3-dicts-ru` initially referred to `pymorphy2`, which can be confusing. The package is intended for `pymorphy3`.","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 `pymorphy3` along with the dictionary package: `pip install pymorphy3 pymorphy3-dicts-ru`.","cause":"The core `pymorphy3` library, which `pymorphy3-dicts-ru` depends on, is not installed.","error":"ModuleNotFoundError: No module named 'pymorphy3'"},{"fix":"Always check if the `parse` result is non-empty before attempting to access elements: `parsed_word = morph.parse(word)` then `if parsed_word: actual_parse = parsed_word[0]`.","cause":"The `morph.parse(word)` method returns an empty list if a word cannot be found or parsed (e.g., non-Russian words, typos, or very obscure terms), leading to an `IndexError` when trying to access `[0]` on an empty list.","error":"IndexError: list index out of range (when accessing parse results)"},{"fix":"Ensure you are correctly handling the output of `morph.parse(word)`, which is a list of `Parse` objects. Access the first (most probable) parse object and its attributes like `parsed_word = morph.parse(word)[0]` then `parsed_word.normal_form`.","cause":"This usually happens when `morph.parse()` returns a single string instead of a list of Parse objects, or if you're attempting to access attributes on an unexpected type, potentially from incorrect iteration or assignment.","error":"AttributeError: 'str' object has no attribute 'normal_form'"}]}