MCPcopy
hub / github.com/explosion/spaCy / is_base_form

Method is_base_form

spacy/lang/ht/lemmatizer.py:14–28  ·  view source on GitHub ↗
(self, token: Token)

Source from the content-addressed store, hash-verified

12 """
13
14 def is_base_form(self, token: Token) -> bool:
15 morph = token.morph.to_dict()
16 upos = token.pos_.lower()
17
18 # Consider unmarked forms to be base
19 if upos in {"noun", "verb", "adj", "adv"}:
20 if not morph:
21 return True
22 if upos == "noun" and morph.get("Number") == "Sing":
23 return True
24 if upos == "verb" and morph.get("VerbForm") == "Inf":
25 return True
26 if upos == "adj" and morph.get("Degree") == "Pos":
27 return True
28 return False
29
30 def rule_lemmatize(self, token: Token) -> List[str]:
31 string = token.text.lower()

Callers

nothing calls this directly

Calls 2

to_dictMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected