Show HN: Convert a number to an approximated text expression
1–10 of 32 posts
Re: Show HN: Convert a number to an approximated text expression
#2Re: Show HN: Convert a number to an approximated text expression
#3One other aspect of approximated numbers is whether the author wants to emphasize that the number is large or small. "Less than" and "almost" carry different connotations.
Re: Show HN: Convert a number to an approximated text expression
#4For Python, for English, there is the inflect library: https://pypi.org/project/inflect/
Re: Show HN: Convert a number to an approximated text expression
#5If you don't want it approximate, but exact, this is still a tricky non-trivial ambiguous problem. And this problem often comes up in text normalization for NLP task (e.g. speech recognition, or text-to-speech). For Python, for English, there is the inflect library: https://pypi.org/project/inflect/
Re: Show HN: Convert a number to an approximated text expression
#6Re: Show HN: Convert a number to an approximated text expression
#7Is there a Java version of this? I understand it's open-source, but since Clojure is JVM, and the lowest common denominator is Java, I think it will be hard to include Clojure just to use the library.
Re: Show HN: Convert a number to an approximated text expression
#8Re: Show HN: Convert a number to an approximated text expression
#9If you don't want it approximate, but exact, this is still a tricky non-trivial ambiguous problem. And this problem often comes up in text normalization for NLP task (e.g. speech recognition, or text-to-speech). For Python, for English, there is the inflect library: https://pypi.org/project/inflect/
I also wrote a function in Pascal to convert integers to natural language exactly. E.g. here is the output for 100000! https://gist.github.com/benibela/f0163b02562f647e4d2f
Re: Show HN: Convert a number to an approximated text expression
#10What would be the intended use case for something like this?
- Q2 sales were around 1M$
When the input was $1,002,184.