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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -