【问题标题】:Does NLTK provide the possibility to replace numbers by English words?NLTK 是否提供用英文单词替换数字的可能性?
【发布时间】:2015-01-13 02:52:36
【问题描述】:

Pythons NLTK 是否提供用英文名称替换文本中数字的功能?

例如:

You had 1 job. -> You had one job.
42 is the answer. -> Fourty-two is the answer.
3.14 is almost pi -> Three point one four is almost pi.

(我不关心大小写)。

【问题讨论】:

  • 我希望我在示例中没有犯任何错误(英语不是我的母语)。

标签: python nltk


【解决方案1】:

没有。 NLTK 没有为英语生成器提供数字(至少目前还没有)。

但这里有一个可以处理从 1 到 1,000,000,000 的整数:Numbernator,还有很多其他选择,请参阅http://pastebin.com/WwFCjYtt

【讨论】:

    猜你喜欢
    • 2020-08-05
    • 2019-07-01
    • 2019-01-12
    • 2015-05-19
    • 1970-01-01
    • 2017-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多