ShailChoksi / text2digits

Converts text such as "twenty three" to number/digit "23" in any sentence
MIT License
66 stars 22 forks source link

hundredth not detected as 100th #21

Closed fersarr closed 4 years ago

fersarr commented 4 years ago

The spellings of 100th, 1000th, etc. are not detected as ordinal numbers:

>>> t2d.convert('she was the hundredth')
'she was the hundredth'
>>> t2d.convert('she was the one hundredth')
'she was the 1 hundredth'
>>> t2d.convert('she was the one thousandth')
'she was the 1 thousandth'
>>> t2d.convert('she was the two thousandth')
'she was the 2 thousandth'
# using hyphen
>>> t2d.convert('she was the two-thousandth')
'she was the 2-thousandth'
>>> t2d.convert('she was the two-hundredth')
'she was the 2-hundredth'

reference: 100th: https://dictionary.cambridge.org/dictionary/english/hundredth 200th: https://www.vocabulary.com/dictionary/two-hundredth 1000th: https://dictionary.cambridge.org/dictionary/english/thousandth 1000000th: https://dictionary.cambridge.org/dictionary/english/millionth

fersarr commented 4 years ago

I can work on this after this PR is merged: https://github.com/ShailChoksi/text2digits/pull/22