'Is there any lib for python that will get me the synonyms of a word? [closed]

Is there any api/lib for python that will get me the synonyms of a word?

For example if i have the word "house" it will return "building, domicile, mansion, etc..."



Solution 1:[1]

Update: as @deweydb has pointed out, as of Feb 10th 2022, this solution no longer works.

You can also use PyDictionary

For example,

from PyDictionary import PyDictionary 
dictionary=PyDictionary() 
print (dictionary.synonym("good"))

The output is

[u'great', u'satisfying', u'exceptional', u'positive', u'acceptable']

This is actually fetching words from www.thesaurus.com and is a little slow. Multi-threading may help accelerate it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1