diff --git a/spacy/lang/ru/lemmatizer.py b/spacy/lang/ru/lemmatizer.py index 0d82875af..9da10692e 100644 --- a/spacy/lang/ru/lemmatizer.py +++ b/spacy/lang/ru/lemmatizer.py @@ -1,6 +1,9 @@ # coding: utf8 +from __future__ import unicode_literals + from ...symbols import ADJ, DET, NOUN, NUM, PRON, PROPN, PUNCT, VERB, POS from ...lemmatizer import Lemmatizer +from ...compat import unicode_ class RussianLemmatizer(Lemmatizer): @@ -81,7 +84,7 @@ class RussianLemmatizer(Lemmatizer): @staticmethod def normalize_univ_pos(univ_pos): - if isinstance(univ_pos, str): + if isinstance(univ_pos, unicode_): return univ_pos.upper() symbols_to_str = { diff --git a/spacy/tests/lang/ru/test_lemmatizer.py b/spacy/tests/lang/ru/test_lemmatizer.py index cdc4b67da..b92dfa29c 100644 --- a/spacy/tests/lang/ru/test_lemmatizer.py +++ b/spacy/tests/lang/ru/test_lemmatizer.py @@ -39,7 +39,6 @@ def test_ru_lemmatizer_noun_lemmas(ru_lemmatizer, text, lemmas): assert sorted(ru_lemmatizer.noun(text)) == lemmas -@pytest.mark.models("ru") @pytest.mark.parametrize( "text,pos,morphology,lemma", [