How do you search ALL of the definitions in wordnet?
Hello. Overwhelmed first-timer here. Using Nodebox Linguistics, is there a way to search ALL of the definitions in wordnet for the occurrence of a particular word. For example the result set for a query on "bird" would include, "beak", "feather" etc, because those words' definitions contain the word "bird." Also, can example sentences be excluded? I would really like to avoid a fancy grep/regex of the entire "dict" folder.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by tomdesmedt on 04 Dec, 2013 12:29 AM
There's a en.wordnet.all-nouns() function that gives you a list of all nouns in WordNet. You could loop over it, look up up all of the descriptions, scan them for a given query, and populate a list of matches. This would probably be slower than grep.
The way to go would be be to loop over it once, store the descriptions in a .txt file, from then on load the .txt file as a Python dictionary of word => description items, and scan that. That may be faster, but it will use a lot of memory.
Best,
Tom