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(
|
@Polish.factory(
|
||||||
"lemmatizer",
|
"lemmatizer",
|
||||||
assigns=["token.lemma"],
|
assigns=["token.lemma"],
|
||||||
default_config={"model": None, "mode": "lookup", "lookups": None},
|
default_config={"model": None, "mode": "pos_lookup", "lookups": None},
|
||||||
scores=["lemma_acc"],
|
scores=["lemma_acc"],
|
||||||
default_score_weights={"lemma_acc": 1.0},
|
default_score_weights={"lemma_acc": 1.0},
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,7 +12,7 @@ class PolishLemmatizer(Lemmatizer):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_lookups_config(cls, mode: str) -> Dict:
|
def get_lookups_config(cls, mode: str) -> Dict:
|
||||||
if mode == "lookup":
|
if mode == "pos_lookup":
|
||||||
return {
|
return {
|
||||||
"required_tables": [
|
"required_tables": [
|
||||||
"lemma_lookup_adj",
|
"lemma_lookup_adj",
|
||||||
|
@ -29,7 +29,7 @@ class PolishLemmatizer(Lemmatizer):
|
||||||
else:
|
else:
|
||||||
return super().get_lookups_config(mode)
|
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
|
string = token.text
|
||||||
univ_pos = token.pos_
|
univ_pos = token.pos_
|
||||||
morphology = token.morph.to_dict()
|
morphology = token.morph.to_dict()
|
||||||
|
|
Loading…
Reference in New Issue