# 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
    :param word:
    :return:
    """
    if word in _cognates_base.cognates:
        return _cognates_base.cognates[word]
    else:
        return [word]


def are_cognates(a, b):
    """
    Checks two words for having same root.

    >>> are_cognates('мама', 'рама')
    False
    >>> are_cognates('мама', 'маме')
    True
    >>> are_cognates('мама', 'маменька')
    True

    :param a: string containing russian word
    :param b: same as a
    :return: True if a and b are cognates, False otherwise.
    """

    a_roots = []
    for word in get_initial_forms(a):
        a_roots.extend(get_roots(word))

    b_roots = []

# 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

    :param word:
    :return:
    """
    if word in _cognates_base.cognates:
        return _cognates_base.cognates[word]
    else:
        return [word]


def are_cognates(a, b):
    """
    Checks two words for having same root.

    >>> are_cognates('мама', 'рама')
    False
    >>> are_cognates('мама', 'маме')
    True
    >>> are_cognates('мама', 'маменька')
    True

    :param a: string containing russian word
    :param b: same as a
    :return: True if a and b are cognates, False otherwise.
    """

    a_roots = []
    for word in get_initial_forms(a):
        a_roots.extend(get_roots(word))

    b_roots = []

    for word in get_initial_forms(b):