from textblob_de.packages import pattern_de
pattern_de.tenses("entschieden")
--------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_19180/3404022709.py in <module>
----> 1 pattern_de.tenses("entschieden")
~/.local/share/virtualenvs/ZOyfachx/lib/python3.7/site-packages/textblob_de/ext/_pattern/text/de/inflect.py in tenses(self, verb, parse)
467 """ Returns a list of possible tenses for the given inflected verb.
468 """
--> 469 tenses = _Verbs.tenses(self, verb, parse)
470 if len(tenses) == 0:
471 # auswirkte => wirkte aus
~/.local/share/virtualenvs/ZOyfachx/lib/python3.7/site-packages/textblob_de/ext/_pattern/text/__init__.py in tenses(self, verb, parse)
1786 a.add(id1)
1787 a = (TENSES[id][:-2] for id in a)
-> 1788 a = Tenses(sorted(a))
1789 return a
1790
TypeError: '<' not supported between instances of 'NoneType' and 'int'
How to reproduce the error
Cause
https://github.com/markuskiller/textblob-de/blob/8479bde9d66cdb16eeec70b92bd3bfa63cb89ac3/textblob_de/ext/_pattern/text/__init__.py#L1762-L1789
In
line 1788
, the sorting raises error because theperson
attribute of the last tense is aNone
as given:Solution
Update the sorting in
line 1788
as follows fixes the error: