So far I've had pretty good results using this library to parse numbers. Unfortunately, I've started to see some odd edge cases with verbose pronunciations like:
const nlp = require('compromise')
// works
nlp('fifty five').values().toNumber().out() // 55
// doesn't work
nlp('forty eight').values().toNumber().out() // 40 8
Preventing me from using this in production... :sob:
I wrote this for this very reason: https://www.npmjs.com/package/english2number
On Mar 8, 2018, at 1:29 PM, Hugh Boylan notifications@github.com wrote:
So far I've had pretty good results using this library to parse numbers. Unfortunately, I've started to see some odd edge cases with verbose pronunciations like:
const nlp = require('compromise')
// works
nlp('fifty five').values().toNumber().out() // 55// doesn't work
nlp('forty eight').values().toNumber().out() // 40 8
Preventing me from using this in production... ðŸ˜â€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Solid suggestion. This issue appears to only occur in the 40s range... Trying to figure out how to add a custom lexicon to patch this locally for now.
hey Hugh! whoa nice bug. Surprised that one got through.
I'll take a look.
hey @TSavo nice work!
hahaha

oops!
Ha, awesome! Wondered if that might be the case since I made the same typo a couple times.
Really appreciate you looking at this so quickly Spencer!
fixed in 11.5.3, lemme know if you see something else.
https://runkit.com/spencermountain/5aa1fbac3edbab0012da29e2
cheers
Confirmed! You're the man! :100:
nlp('forty two').values().toNumber().out() // 42