有没有Python的API或库可以获取单词的同义词?
例如,如果我有单词"house",它将返回"building, domicile, mansion, etc..."。
更新:如@deweydb指出,截至2022年2月10日,此解决方案已不再有效。
你还可以使用PyDictionary
例如:
from PyDictionary import PyDictionary
dictionary=PyDictionary()
print (dictionary.synonym("good"))
[u'great', u'satisfying', u'exceptional', u'positive', u'acceptable']
这实际上是从www.thesaurus.com获取单词,并且速度较慢。多线程可能有助于加速。