views:

108

answers:

2

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..."

+3  A: 

You need wordnet python bindings :)

Simone Margaritelli
+8  A: 

NLTK and Wordnet can help: e.g., per this article,

from nltk.corpus import wordnet

dog = wordnet.synset('dog.n.01')
print dog.lemma_names

prints:

['dog', 'domestic_dog', 'Canis_familiaris']
Alex Martelli