| Conditions | 2 |
| Total Lines | 9 |
| Code Lines | 8 |
| Lines | 9 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | """spaCy analyzer for Annif which uses spaCy for lemmatization""" |
||
| 22 | def tokenize_words(self, text, filter=True): |
||
| 23 | lemmas = [lemma |
||
| 24 | for lemma in (token.lemma_ |
||
| 25 | for token in self.nlp(text.strip())) |
||
| 26 | if (not filter or self.is_valid_token(lemma))] |
||
| 27 | if self.lowercase: |
||
| 28 | return [lemma.lower() for lemma in lemmas] |
||
| 29 | else: |
||
| 30 | return lemmas |
||
| 31 |