| 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() |