All synonyms for word in python? [duplicate]
This question already has an answer here: How to get synonyms from nltk WordNet Python 5 answers The code to get the synonyms of a word in python is say: from nltk.corpus import wordnet dog = wordnet.synset('dog.n.01') print dog.lemma_names >>['dog', 'domestic_dog', 'Canis_familiaris'] However dog.n.02 gives different words. For any words i can't know how many words there may be. How can i return all of the synonyms for a word? Using wn.synset('dog.n.1').lemma_names is the correct way to access the synonyms of a sense . It's because a word has many senses and it's more appropriate to list