From abd3f2b65a7576dfa73d9a8b5dfacc23c3768c79 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Tue, 25 Aug 2020 00:22:27 +0200 Subject: [PATCH] Rename Polish lemmatizer method (#5960) Rename Polish lemmatizer method to `pos_lookup` to distinguish it from pure token-based lookup methods. --- spacy/lang/pl/__init__.py | 2 +- spacy/lang/pl/lemmatizer.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/lang/pl/__init__.py b/spacy/lang/pl/__init__.py index a180fa6e9..7ddad9893 100644 --- a/spacy/lang/pl/__init__.py +++ b/spacy/lang/pl/__init__.py @@ -34,7 +34,7 @@ class Polish(Language): @Polish.factory( "lemmatizer", assigns=["token.lemma"], - default_config={"model": None, "mode": "lookup", "lookups": None}, + default_config={"model": None, "mode": "pos_lookup", "lookups": None}, scores=["lemma_acc"], default_score_weights={"lemma_acc": 1.0}, ) diff --git a/spacy/lang/pl/lemmatizer.py b/spacy/lang/pl/lemmatizer.py index c4c6db06a..406ef9e4a 100644 --- a/spacy/lang/pl/lemmatizer.py +++ b/spacy/lang/pl/lemmatizer.py @@ -12,7 +12,7 @@ class PolishLemmatizer(Lemmatizer): @classmethod def get_lookups_config(cls, mode: str) -> Dict: - if mode == "lookup": + if mode == "pos_lookup": return { "required_tables": [ "lemma_lookup_adj", @@ -29,7 +29,7 @@ class PolishLemmatizer(Lemmatizer): else: return super().get_lookups_config(mode) - def lookup_lemmatize(self, token: Token) -> List[str]: + def pos_lookup_lemmatize(self, token: Token) -> List[str]: string = token.text univ_pos = token.pos_ morphology = token.morph.to_dict()