diff --git a/numberize.toml b/numberize.toml index 192113c..17e357e 100644 --- a/numberize.toml +++ b/numberize.toml @@ -2,8 +2,8 @@ requires = [ "setuptools>=42", "wheel", - "pymorhy2[fast]", - "pymorphy2-dicts-uk", + "pymorhy3", + "pymorphy3-dicts-uk", "nltk" ] build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/numberize/linguists.py b/numberize/linguists.py index 901ef7e..98a7584 100644 --- a/numberize/linguists.py +++ b/numberize/linguists.py @@ -1,7 +1,7 @@ from abc import ABC, abstractmethod from typing import Optional -import pymorphy2 +import pymorphy3 import numberize.dicts as dicts @@ -37,7 +37,7 @@ def get_number(token: str) -> Optional[int]: class RuLinguist(Linguist): - def __init__(self, morph: 'pymorphy2.MorphAnalyzer'): + def __init__(self, morph: 'pymorphy3.MorphAnalyzer'): """ :param morph: MorphAnalyzer to normalize words """ @@ -54,7 +54,7 @@ def get_number(self, token: str) -> Optional[int]: class UkLinguist(Linguist): - def __init__(self, morph: 'pymorphy2.MorphAnalyzer'): + def __init__(self, morph: 'pymorphy3.MorphAnalyzer'): """ :param morph: MorphAnalyzer to normalize words """ diff --git a/numberize/replacers.py b/numberize/replacers.py index 096f623..fdc987c 100644 --- a/numberize/replacers.py +++ b/numberize/replacers.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from pymorphy2 import MorphAnalyzer +from pymorphy3 import MorphAnalyzer from numberize.calculators import ( Calculator, AmericanEnCalculator, CyrillicCalculator diff --git a/setup.py b/setup.py index 9ac96e6..c3fb96f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="numberize", - version="1.0.3", + version="1.1.2", author="YemchenkoDS", author_email="emchenko@dlit.dp.ua", description="Replace numerals with numbers", @@ -26,7 +26,7 @@ 'numberize.dicts' ], python_requires=">=3.6", - install_requires=['pymorphy2[fast]', 'pymorphy2-dicts-uk', 'nltk'], + install_requires=['pymorphy3', 'pymorphy3-dicts-uk', 'nltk'], setup_requires=['pytest-runner'], tests_require=['pytest==6.2.4'], test_suite='tests' diff --git a/tests/test_linguists.py b/tests/test_linguists.py index 4a50b31..74d1d22 100644 --- a/tests/test_linguists.py +++ b/tests/test_linguists.py @@ -1,6 +1,6 @@ import pytest -import pymorphy2 +import pymorphy3 import numberize.linguists as linguists @@ -22,8 +22,8 @@ ("мільйона", 1000000) ] -ru_morph = pymorphy2.MorphAnalyzer(result_type=None) -uk_morph = pymorphy2.MorphAnalyzer(lang="uk", result_type=None) +ru_morph = pymorphy3.MorphAnalyzer(result_type=None) +uk_morph = pymorphy3.MorphAnalyzer(lang="uk", result_type=None) @pytest.mark.parametrize("token,expected_output", EN_DATA)