# Path: lang_utils/morphology/word_forms.py
# def get_initial_forms(form: str, part_filter=None)->list:
#     """
#     Gets all possible initial forms (there are several of them sometimes) of a given word.
#     Optional argument part_filter allows to prune unnecessary ambiguity with part of speech.
# 
#     >>> get_initial_forms('Дядя')
#     ['дядя']
#     >>> get_initial_forms('самых')
#     ['самый']
#     >>> get_initial_forms('честных')
#     ['честной', 'честный']
#     >>> get_initial_forms('правил')
#     ['правило', 'править']
#     >>> get_initial_forms('правил', 'NOUN')
#     ['правило']
#     >>> get_initial_forms('правил', ['VERB'])
#     ['править']
# 
#     :param form: a russian word
#     :param part_filter: something that supports `in' operator: str, list, set etc. If it is a container,
#     it should contain only Part-of-speech names according to pymorphy2 enumerations
#     :return: a list of possible initial forms of the given word in lowercase.
#     It's guaranteed that there are no repetitions.
#     Variants are generated in the order of descending certainty.
#     """
#     met = set()
#     ret = []
#     for p in morph.parse(form):
#         # if p.score < .1:
#         #     continue
#         if part_filter is None or p.tag.POS in part_filter:
#             norm = p.normal_form
#             if norm not in met:
#                 ret.append(norm)
#                 met.add(norm)
#     return ret
# 
# Path: lang_utils/cognates/_cognates_base.py
# COGNATES_PATH = \
#     os.path.dirname(os.path.abspath(__file__)) + '/cognates.txt'
# def init_cognates():


from lang_utils.morphology import get_initial_forms
from lang_utils.cognates import _cognates_base
__author__ = 'Oktosha'



def get_roots(word):
    """
    Returns list of root-words which are titles of dictionary articles containing the given word.
    If the dictionary doesn't contain the given word the list containing word itself is returned.

    :param word: russian word
    :return: list of root-words
    """
    """
    :param word:
    :return:
    """
    if word in _cognates_base.cognates:

# Path: lang_utils/morphology/word_forms.py
# def get_initial_forms(form: str, part_filter=None)->list:
#     """
#     Gets all possible initial forms (there are several of them sometimes) of a given word.
#     Optional argument part_filter allows to prune unnecessary ambiguity with part of speech.
# 
#     >>> get_initial_forms('Дядя')
#     ['дядя']
#     >>> get_initial_forms('самых')
#     ['самый']
#     >>> get_initial_forms('честных')
#     ['честной', 'честный']
#     >>> get_initial_forms('правил')
#     ['правило', 'править']
#     >>> get_initial_forms('правил', 'NOUN')
#     ['правило']
#     >>> get_initial_forms('правил', ['VERB'])
#     ['править']
# 
#     :param form: a russian word
#     :param part_filter: something that supports `in' operator: str, list, set etc. If it is a container,
#     it should contain only Part-of-speech names according to pymorphy2 enumerations
#     :return: a list of possible initial forms of the given word in lowercase.
#     It's guaranteed that there are no repetitions.
#     Variants are generated in the order of descending certainty.
#     """
#     met = set()
#     ret = []
#     for p in morph.parse(form):
#         # if p.score < .1:
#         #     continue
#         if part_filter is None or p.tag.POS in part_filter:
#             norm = p.normal_form
#             if norm not in met:
#                 ret.append(norm)
#                 met.add(norm)
#     return ret
# 
# Path: lang_utils/cognates/_cognates_base.py
# COGNATES_PATH = \
#     os.path.dirname(os.path.abspath(__file__)) + '/cognates.txt'
# def init_cognates():


# Path: lang_utils/cognates/cognates.py
from lang_utils.morphology import get_initial_forms
from lang_utils.cognates import _cognates_base

__author__ = 'Oktosha'



def get_roots(word):
    """
    Returns list of root-words which are titles of dictionary articles containing the given word.
    If the dictionary doesn't contain the given word the list containing word itself is returned.

    :param word: russian word
    :return: list of root-words
    """
    """
    :param word:
    :return:
    """
    if word in _cognates_base.cognates:

        return _cognates_base.cognates[word]