>>> from text2digits import text2digits
>>> t2d = text2digits.Text2Digits(add_ordinal_ending=True)
>>> t2d.convert('The first seven cows')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/text2digits/text2digits.py", line 51, in convert
text = self._parse(tokens)
File "/usr/local/lib/python3.7/site-packages/text2digits/text2digits.py", line 130, in _parse
text += token.ordinal_ending
TypeError: can only concatenate str (not "NoneType") to str
add_ordinal_ending == False
>>> from text2digits import text2digits
>>> t2d = text2digits.Text2Digits(add_ordinal_ending=False)
>>> t2d.convert('The first seven cows')
'The 17 cows'
Consider the phrase, "The first seven cows."
Expected output: "The 1st 7 cows." Actual output:
add_ordinal_ending == True
,TypeError
add_ordinal_ending == False
, "The 17 cows"add_ordinal_ending == True
add_ordinal_ending == False