Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needed something like this library #35

Open
getify opened this issue Feb 24, 2021 · 0 comments
Open

Needed something like this library #35

getify opened this issue Feb 24, 2021 · 0 comments

Comments

@getify
Copy link

getify commented Feb 24, 2021

I recently needed something like this library. My use-case is converting numeric sentences from speech-recognition libraries (like PocketSphinx.js). Unfortunately, after surveying this library, I had several concerns and unaddressed wants:

  • Several open/unaddressed bugs reported and not triaged for quite awhile -- is this project still maintained?
  • A few known-unsupported conversions (listed in the tests)
  • Supporting a few looser forms of english number sentences
  • Exact outputs (via string) instead of as numbers (with floating point quirks)
  • Operate in a mode that errors if contents in the string aren't recognized as valid (such as "four thousand six million")
  • Ability to collect individual digits as a single number (like "one two three four" -> "1234")
  • Able to specify an optional formatter option: unit-place separator (,)
  • Zero-dependency lib that could run in the browser with no build-steps/etc
  • Wanted to expose an AST result from parsing such that other number formatting/localization would be possible as custom serialization from the AST
  • I did not need/want the fuzzy matching or the multiple numbers per string features -- wasn't clear if I could disable those?

In the end, I decided to implement a parser/compiler to suit my needs, rather than adapting this library from its current form. Just wanted to share my efforts in case they're useful to anyone (including this project):

https://gist.github.com/getify/83e6fae8f54c1d38f89132a130493f98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant