finnfiddle / words-to-numbers

JS library to convert textual words to numbers with optional fuzzy text matching
MIT License
248 stars 57 forks source link

Word "and" and "a" maps to zero. #8

Closed PieterO closed 7 years ago

PieterO commented 7 years ago

I don't know if this is intended but it seems to parse "and" and "a" when alone as numbers instead of seeing them as words.

When those words are alone they should just map to null as they are not numbers. I am using this in a project and it's throwing errors as these words are getting mapped to numbers.

I have a pull request which adds the tests as I work on getting it to pass them.

finnfiddle commented 7 years ago

sorry for the delay, I will be pushing a fix tomorrow. Completely refactored the whole library using ohm.js so now things will work much better

finnfiddle commented 7 years ago

fixed in fc621fed10c9aa2047059da35472de59f48351ee (v1.2.2 on npm) - closing. thanks for the feedback