| Conditions | 1 |
| Total Lines | 9 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """EstNLTK analyzer for Annif which uses EstNLTK for lemmatization""" |
||
| 15 | def tokenize_words(self, text: str, filter: bool = True) -> list[str]: |
||
| 16 | import estnltk |
||
| 17 | |||
| 18 | txt = estnltk.Text(text.strip()) |
||
| 19 | txt.tag_layer() |
||
| 20 | return [ |
||
| 21 | lemma |
||
| 22 | for lemma in [lemmas[0] for lemmas in txt.lemma] |
||
| 23 | if (not filter or self.is_valid_token(lemma)) |
||
| 24 | ] |
||
| 25 |