How do you search ALL of the definitions in wordnet?

dano2's Avatar

dano2

03 Nov, 2013 10:17 AM

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.

http://nodebox.net/code/index.php/Linguistics

  1. Support Staff 1 Posted by tomdesmedt on 04 Dec, 2013 12:29 AM

    tomdesmedt's Avatar

    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

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

Recent Discussions

25 May, 2024 11:52 AM
24 May, 2024 07:39 AM
16 May, 2024 02:11 AM
16 May, 2024 01:58 AM
14 May, 2024 01:29 AM

 

13 May, 2024 12:36 AM
12 May, 2024 07:46 PM
05 May, 2024 04:38 PM
03 May, 2024 06:50 AM
03 May, 2024 12:30 AM
03 May, 2024 12:09 AM