Number parsing exceptions
See original GitHub issueSo 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… 😭
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
ParseException for number java [closed] - Stack Overflow
Hi and welcome to StackOverflow! Unfortunately, as it stands, your question is not clear. What do you want to achieve? – Adrian Panasiuk....
Read more >Understanding the NumberFormatException in Java - Baeldung
Java throws NumberFormatException – an unchecked exception – when it cannot convert a String to a number type.
Read more >Fast number parsing in Scala - SoftwareMill
Avoid exceptions in number parsing, they slow you down — see how Scala 2.13's .toIntOption method can make the process faster.
Read more >String parsing exceptions
String parsing exceptions. The Integer.parseInt() and Double.parseDouble() class methods both take a String parameter and converts it into a number.
Read more >Parse numbers from string without exception #660 - GitHub
If people use tryParse to avoid NumberFormatException, it is outside IHM. In IHM I can understand that it is difficult to replace the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirmed! You’re the man! 💯
hahaha oops!