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

17 May, 2025 10:24 PM
17 May, 2025 12:17 AM
14 May, 2025 08:41 AM
09 May, 2025 01:15 PM
07 May, 2025 03:57 AM

 

06 May, 2025 06:46 AM
06 May, 2025 02:15 AM
21 Apr, 2025 10:47 AM
21 Apr, 2025 10:41 AM
21 Apr, 2025 05:56 AM
19 Apr, 2025 07:17 PM