0

Users never just say "one two three four", they say "twelve thirty four" and things like that. I have a very complicated story about ABNF grammars and ASR engines but I'll just ask simply:

How can I generate a list of all the different ways someone might say '1234'? The number can be any number of digits.

I've seen numerous examples on how to expand a number in a grammatically correct way, but my users never use proper grammar. "10217" becomes "ten two seventeen". "78749" becomes "seventy eight seven fourty nine".

  • And what is your question now? – Johannes Kuhn Sep 19 '19 at 00:42
  • I had a ton of extraneous information here that I've parred down about WHY I was doing this. Hopefully my question is more concise and clear now. – Nathan Walker Sep 19 '19 at 01:18
  • Check if the next word can still be a number when combined, e.g. 10-2 doesn't make sense as 12, because there is twelve. On the other hand, 30-4 can be 34. And then consistently use the shortest number you can find, maybe even store the separators (where you split) so you can rediscover what has been said. – Johannes Kuhn Sep 19 '19 at 04:15

0 Answers0