mirror of https://github.com/explosion/spaCy.git
Rename Polish lemmatizer method (#5960)
Rename Polish lemmatizer method to `pos_lookup` to distinguish it from pure token-based lookup methods.
This commit is contained in:
parent
e12b03358b
commit
abd3f2b65a
|
@ -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},
|
||||
)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue