How to solve iteration issue on data set in Python when using WordNet? -
i try use wordnet in python list of synonyms of (word) have following code:
for i,j in enumerate(wn.synsets('dog')): print "meaning",i, "nltk id:", j.name print "definition:",j.definition print "synonyms:", ", ".join(j.lemma_names) print
i use python 2.7.10 , got following error :
print "synonyms:", ", ".join((j.lemma_names)) typeerror: can join iterable
how solve issue ?
according documentation, lemma_names
method - should call in order retrieve names:
print "synonyms:", ", ".join(j.lemma_names()) # ^^
Comments
Post a Comment