Guest User

Untitled

a guest
Dec 11th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import nltk
  2. from nltk.corpus import wordnet
  3.  
  4. synonyms = []
  5.  
  6. for syn in wordnet.synsets('book'):
  7. for lemma in syn.lemmas():
  8. synonyms.append(lemma.name())
  9.  
  10. print(synonyms)
  11. >>['book', 'book', 'volume', 'record', 'record_book', 'book', 'script', 'book', 'playscript', 'ledger', 'leger', 'account_book', 'book_of_account', 'book', 'book', 'book', 'rule_book', 'Koran', 'Quran', "al-Qur'an", 'Book', 'Bible', 'Christian_Bible', ..]
  12.  
  13. len(synonyms)
  14. >>38
Add Comment
Please, Sign In to add comment