number-parser
number-parser copied to clipboard
Adding support for decimal and negative numbers
Opening a new ticket for adding support for decimal and negative numbers. More details for the same discussed here.
Expected outcomes
> parse("he scored fifty three point six percent in the finals")
he scored 53.6 percent in the finals
> parse_number("twelve point seven")
12.7
> parse_number("minus 9.4")
-9.4
It may make sense to keep separate issues for each.
Also, for decimal numbers, https://docs.python.org/3/library/decimal.html should probably either be used, or be usable (á la parse_float=Decimal of json.loads).
Regarding decimal numbers, I've seen that the CLDR files contain the infinity word for about 26 locales, so it could be a good idea to add them in the future as float(inf). I didn't think it deeply, just wanted to add this idea here to avoid forgetting it.