So you'll need to create a parser for that, and I'm not sure it will be easy unless you already know your input will be restricted to certain types. Here's a couple of items that might be challenging to distinguish:
"The car was priced at $52,400."
"I've got red, green, and blue, with 100,200, and 75 respectively"
You might take a look at https://pypi.org/project/inflect/. It can turn numbers (or strings of digits) into english terms (assuming you've already parsed the correct number).
"The car was priced at $52,400."
"I've got red, green, and blue, with 100,200, and 75 respectively"
You might take a look at https://pypi.org/project/inflect/. It can turn numbers (or strings of digits) into english terms (assuming you've already parsed the correct number).
>>> import inflect >>> p = inflect.engine() >>> p.number_to_words(52400) 'fifty-two thousand, four hundred' >>> p.number_to_words("52400") 'fifty-two thousand, four hundred'