using wordnet

29 views
Skip to first unread message

Ambarish Jash

unread,
Nov 4, 2012, 8:33:03 PM11/4/12
to nltk-...@googlegroups.com
Is there a command in python (using nltk) to get all the words out of word net.

Also is there a way to get out all adjectives out of wordnet

--
Ambarish Jash

Alex Rudnick

unread,
Nov 4, 2012, 11:43:23 PM11/4/12
to nltk-...@googlegroups.com
Yes!

You can use the all_synsets function to loop over all the entries in wordnet...

>>> from nltk.corpus import wordnet as wn
>>> for synset in wn.all_synsets(): print synset
# (note, this will print out lots and lots of synsets)

Then if you grab one of those individual synset objects, you can get
its lemmas and get the part of speech out of that.
> --
>
>



--
-- alexr
Reply all
Reply to author
Forward
0 new messages