ShailChoksi / text2digits

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

Feature/date fix #32

Closed tomfunk closed 3 years ago

tomfunk commented 4 years ago

fixes #31

Modified the logic for Token.has_large_scale so that WordType.LITERAL_INT and WordType.LITERAL_FLOAT only return True if their values are equal to one of the listed SCALES

It also wasn't clear from the issue whether the month not being represented as a number was considered a problem so I created a new WordType.MONTH for months and the conventional 3 character abbreviation (e.g. november and nov) that returns the integer value for a given month.

ShailChoksi commented 4 years ago

Reading through the Issue I don't believe the OP wanted to convert the Month to a number. I also wouldn't want this to be default behaviour as this is unexpected. Can you remove the month being converted to an integer logic?

tomfunk commented 4 years ago

Ripped out the month stuff. I could rework it as an variable option like convert_ordinals and add_ordinal_ending if you think it could be useful.