Merge pull request #7440 from adrianeboyd/bugfix/ru-pymorph2-lookup-lemmatize

Rename and update Russian pymorphy2 lookup lemmatize
This commit is contained in:
Ines Montani 2021-03-19 01:54:08 +01:00 committed by GitHub
commit 66b900a76d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,12 +90,12 @@ class RussianLemmatizer(Lemmatizer):
return [string.lower()]
return list(set([analysis.normal_form for analysis in filtered_analyses]))
def lookup_lemmatize(self, token: Token) -> List[str]:
def pymorphy2_lookup_lemmatize(self, token: Token) -> List[str]:
string = token.text
analyses = self._morph.parse(string)
if len(analyses) == 1:
return analyses[0].normal_form
return string
return [analyses[0].normal_form]
return [string]
def oc2ud(oc_tag: str) -> Tuple[str, Dict[str, str]]: