akshaynagpal / w2n

Convert number words (eg. twenty one) to numeric digits (21)
http://w2n.readthedocs.io
MIT License
167 stars 78 forks source link

Commas cause incorrect result #76

Open JmannOSC opened 1 year ago

JmannOSC commented 1 year ago

Using python 3.10.4

Commas appear to cause w2n to produce hilariously incorrect results. See attached image.

w2n bug

In the screenshot, "five thousand, six hundred" is returned as 130. Removing the comma results in the expected output.

As a workaround, this issue can be bypassed by stripping commas before calling your library: input = re.sub(r',','',input)