【发布时间】:2016-03-17 20:34:47
【问题描述】:
我想知道你怎么可能检测到一个短语中的所有数字词。例如
math_str = "one times one plus sin(one hundred fifty three) minus three billion"
getNumberWords(math_str) #Returns one, one, one hundred fifty three, three billion
是否有正则表达式模式或什么?
【问题讨论】:
-
这不是一件容易的事。如果没有你的代码来改进这里的任何人都无法做很多事情。
-
嗯,“三十亿”可以匹配为“三”和“十亿”
-
如果你知道你的输入,你可能想看看word2number