Skip to content

Commit

Permalink
Small fixes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed Sep 8, 2023
1 parent 7a88d24 commit 08345fe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions pymorphy2/units/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ def _get_params(self):
)



class AnalogyAnalizerUnit(BaseAnalyzerUnit):
class AnalogyAnalyzerUnit(BaseAnalyzerUnit):

def normalized(self, form):
base_analyzer, this_method = self._method_info(form)
Expand Down
8 changes: 4 additions & 4 deletions pymorphy2/units/by_analogy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import operator

from pymorphy2.dawg import PrefixMatcher
from pymorphy2.units.base import AnalogyAnalizerUnit
from pymorphy2.units.base import AnalogyAnalyzerUnit
from pymorphy2.units.by_lookup import DictionaryAnalyzer
from pymorphy2.units.utils import (
add_parse_if_not_seen,
Expand All @@ -22,7 +22,7 @@
_cnt_getter = operator.itemgetter(3)


class _PrefixAnalyzer(AnalogyAnalizerUnit):
class _PrefixAnalyzer(AnalogyAnalyzerUnit):

def normalizer(self, form, this_method):
prefix = this_method[1]
Expand Down Expand Up @@ -109,7 +109,7 @@ def __init__(self, score_multiplier=0.5):
self.score_multiplier = score_multiplier

def init(self, morph):
super(AnalogyAnalizerUnit, self).init(morph)
super(AnalogyAnalyzerUnit, self).init(morph)
self.dict_analyzer = DictionaryAnalyzer()
self.dict_analyzer.init(morph)

Expand Down Expand Up @@ -151,7 +151,7 @@ def tag(self, word, word_lower, seen_tags):
return result


class KnownSuffixAnalyzer(AnalogyAnalizerUnit):
class KnownSuffixAnalyzer(AnalogyAnalyzerUnit):
"""
Parse the word by checking how the words with similar suffixes
are parsed.
Expand Down
4 changes: 2 additions & 2 deletions pymorphy2/units/by_hyphen.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"""
from pymorphy2.dawg import PrefixMatcher

from pymorphy2.units.base import BaseAnalyzerUnit, AnalogyAnalizerUnit
from pymorphy2.units.base import BaseAnalyzerUnit, AnalogyAnalyzerUnit
from pymorphy2.units.utils import (add_parse_if_not_seen, with_suffix, without_fixed_suffix,
with_prefix, without_fixed_prefix,
replace_methods_stack)


class HyphenSeparatedParticleAnalyzer(AnalogyAnalizerUnit):
class HyphenSeparatedParticleAnalyzer(AnalogyAnalyzerUnit):
"""
Parse the word by analyzing it without
a particle after a hyphen.
Expand Down
6 changes: 3 additions & 3 deletions tests/test_inflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def test_second_cases(word, grammemes, result, morph):
@with_test_data([
('валенок', ['gent', 'sing'], 'валенка'),
('валенок', ['gen2', 'sing'], 'валенка'), # there is no gen2
('велосипед', ['loct'], 'велосипеде'), # о велосипеде
('велосипед', ['loc2'], 'велосипеде'), # а тут второго предложного нет, в велосипеде
('хомяк', ['voct'], 'хомяк'), # there is not voct, nomn should be used
('велосипед', ['loct'], 'велосипеде'), # о велосипеде
('велосипед', ['loc2'], 'велосипеде'), # а тут второго предложного нет, в велосипеде
('хомяк', ['voct'], 'хомяк'), # there is not voct, nomn should be used
('Геннадий', ['voct'], 'Геннадий'), # there is not voct, nomn should be used
])
def test_case_substitution(word, grammemes, result, morph):
Expand Down

0 comments on commit 08345fe

Please sign in to comment.