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

06 Sep, 2023 07:20 AM
05 Sep, 2023 08:40 PM
30 Aug, 2023 03:16 AM
19 Aug, 2023 03:22 AM
29 Jul, 2023 05:52 AM

 

28 Jul, 2023 10:53 PM
23 Jul, 2023 07:04 AM
14 Jul, 2023 03:05 AM
07 Jul, 2023 06:26 AM
05 Jul, 2023 11:44 PM
30 Jun, 2023 12:48 PM