Function __get_lemma
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def __get_lemma(self, word: str, pos_tag: str, gram: str, word_forms=None,
enable_normalization: bool=True):
"""
Получить лемму.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __normalize_for_gikrya
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __normalize_for_gikrya(form):
"""
Поучение леммы по правилам, максимально близким к тем, которые в корпусе ГИКРЯ.
:param form: форма из pymorphy2.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __init__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self,
language="ru",
eval_model_config_path: str=None,
eval_model_weights_path: str=None,
gram_dict_input: str=None,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function __get_lemma
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __get_lemma(self, word: str, pos_tag: str, gram: str, word_forms=None,
Avoid too many return
statements within this function. Open
return form.normal_form
Avoid too many return
statements within this function. Open
return 'то'
Avoid too many return
statements within this function. Open
return 'со'
Avoid too many return
statements within this function. Open
return form.inflect({'PRTF', 'sing', 'masc', 'nomn'}).word