【问题标题】:Is Python has any english dictionary that returns a list of words with the same meaning? [closed]Python是否有任何英语词典可以返回具有相同含义的单词列表? [关闭]
【发布时间】:2013-09-01 00:46:44
【问题描述】:

例如,输入美国,输出美国。是这样的模块吗?我将它用于自然语言处理。

【问题讨论】:

  • 你可以找到 NLTK 的 Synset 的同义词。
  • 大约 35 个国家/地区对您的示例感到畏缩。
  • 我认为您要的是“词库”。

标签: python


【解决方案1】:

获取 NLTK 模块:http://nltk.org/install.html

导入语料库:http://nltk.org/data.html

玩转:

>>> from nltk.corpus import wordnet as wn
>>> wn.synsets('USA') 

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-19
  • 1970-01-01
  • 2011-07-06
  • 2019-02-13
  • 1970-01-01
  • 2017-12-11
相关资源
最近更新 更多