WN(1)

πŸ“¦
version 3.0 Β· 2 versions
, in fedora 43, fedora 44, opensuse-leap 16.0

πŸŽ€ WN(1) β€” WordNetβ„’ User Commands ✨

okay bestie, come SIT DOWN, we're talking about wn today and honestly? it's giving iconic. This is the WordNetβ„’ user commands page, and yeah it's a big one, so we're doing it in parts. Strap in πŸ’–


🌸 NAME 🌸

wn β€” command line interface to the WordNet lexical database. That's it. That's the girl. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

wn [ searchstr ] [ -h] [ -g ] [ -a ] [ -l ] [ -o ] [ -s ] [ -n# ] [
search_option... ]

πŸ’œ DESCRIPTION πŸ’œ

So like, wn() gives you a command line interface to the WordNet database, and it lets you display synsets and relations as formatted text. Fr fr, it's that simple.

For every single word, you get a bunch of different searches to choose from, all based on the syntactic category and the pointer types. And here's the thing β€” normally only the base forms of words live in WordNet, but you can still search for inflected forms, because a morphological process gets applied to your search string to generate a form that's actually present in WordNet. Magic? No, just morphology. 🧚

The command line interface is lowkey the moment when you're writing scripts to extract info from the WordNet database β€” post-processing the output with whatever scripting tools you love can reformat the results however you want. Chef's kiss. πŸ’…


✨ OPTIONS ✨

  • -h β€” Print the help text before the search results.
  • -g β€” Display the textual glosses that go with the synsets.
  • -a β€” Display lexicographer file information.
  • -o β€” Display the synset offset of each synset.
  • -s β€” Display each word's sense numbers in synsets.
  • -l β€” Display the WordNet copyright notice, version number, and license. (the legal girlies stay winning πŸ“œ)
  • -n# β€” Perform the search on sense number # only.
  • -over β€” Display an overview of all senses of searchstr across all syntactic categories.

πŸ” Search Options πŸ”

Quick vibe check first, bestie: the last letter of a search_option generally tells you which part of speech that search applies to β€”

  • n for nouns
  • v for verbs
  • a for adjectives
  • r for adverbs

And you can do multiple searches for searchstr in a single command β€” just specify all the appropriate search options. No cap. πŸ”₯


  • -syns(n | v | a | r) β€” Display synonyms and immediate hypernyms of synsets containing searchstr. Synsets are ordered by estimated frequency of use. For adjectives: if searchstr is in a head synset, the cluster's satellite synsets get displayed in place of hypernyms; if searchstr is in a satellite synset, its head synset is also displayed. πŸ¦‹
  • -simsv β€” Display verb synonyms and immediate hypernyms of synsets containing searchstr. Synsets are grouped by similarity of meaning.
  • -ants(n | v | a | r) β€” Display synsets containing antonyms of searchstr. For adjectives: if searchstr is in a head synset, searchstr has a direct antonym, and the head synset for that direct antonym is displayed along with the direct antonym's satellite synsets. If searchstr is in a satellite synset, searchstr has an indirect antonym via the head synset, which is displayed.
  • -faml(n | v | a | r) β€” Display familiarity and polysemy information for searchstr.
  • -hype(n | v) β€” Recursively display the hypernym (superordinate) tree for searchstr (that's the searchstr IS A KIND OF _____ relation).
  • -hypo(n | v) β€” Display the immediate hyponyms (subordinates) for searchstr (that's the _____ IS A KIND OF searchstr relation).
  • -tree(n | v) β€” Display the hyponym (subordinate) tree for searchstr. Heads up: this is a recursive search that finds the hyponyms of each hyponym. πŸŒ€
  • -coor(n | v) β€” Display the coordinates (sisters) of searchstr. This one prints the immediate hypernym for each synset that contains searchstr, plus that hypernym's immediate hyponyms.
  • -deri(n | v) β€” Display derivational morphology links between noun and verb forms.
  • -domn(n | v | a | r) β€” Display the domain that searchstr has been classified in.
  • -domt(n | v | a | r) β€” Display all the terms classified as members of searchstr's domain.
  • -subsn β€” Display substance meronyms of searchstr (the HAS SUBSTANCE relation).
  • -partn β€” Display part meronyms of searchstr (the HAS PART relation).
  • -membn β€” Display member meronyms of searchstr (the HAS MEMBER relation).
  • -meron β€” Display all meronyms of searchstr (HAS PART, HAS MEMBER, HAS SUBSTANCE relations).
  • -hmern β€” Display the meronyms for searchstr tree. This is a recursive search that prints all the meronyms of searchstr and all of its hypernyms.
  • -sprtn β€” Display part of holonyms of searchstr (the PART OF relation).
  • -smemn β€” Display member of holonyms of searchstr (the MEMBER OF relation).
  • -ssubn β€” Display substance of holonyms of searchstr (the SUBSTANCE OF relation).
  • -holon β€” Display all holonyms of searchstr (PART OF, MEMBER OF, SUBSTANCE OF relations).
  • -hholn β€” Display holonyms for searchstr tree. This is a recursive search that prints all the holonyms of searchstr and all of each holonym's holonyms.
  • -entav β€” Display entailment relations of searchstr.
  • -framv β€” Display the applicable verb sentence frames for searchstr.
  • -causv β€” Display cause to relations of searchstr.
  • -pert(a | r) β€” Display pertainyms of searchstr.
  • -attr(n | a) β€” Display adjective values for a noun attribute, or noun attributes of adjective values.
  • -grep(n | v | a | r) β€” List compound words containing searchstr as a substring.

and that's just part one bestie, don't go anywhere πŸ’–

πŸ’– SEARCH RESULTS πŸ’–

okay so bestie, here's where the tea gets spilled: every search result gets written straight to standard output. For each search you run, the output is a one-line description of the search, and then the actual search results follow. Simple as that. ✨

Every search except -over lists all the senses that match, in this general format. Anything wrapped in italicized square brackets ([ ... ]) might not show up at all β€” it's optional, bestie, don't come for me:

One line listing the number of senses matching the search
request.

Each sense matching the search requested displayed as follows:

     Sense n
     [{synset_offset}] [<lex_filename>]  word1[#sense_number][,  word2...]

Okay so let's decode this because it's giving secret code πŸ•΅οΈβ€β™€οΈ

  • n is the sense number of the search word.
  • synset_offset is the byte offset of the synset in the data.pos file that corresponds to the syntactic category.
  • lex_filename is the name of the lexicographer file that the synset comes from.
  • word1 is the first word in the synset β€” and note that this is not necessarily the search word, okay, it's just whoever showed up first.
  • sense_number is the WordNet sense number assigned to the preceding word.

And the way synset_offset, lex_filename, and sense_number even appear at all? They get generated when you specify -o, -a, and -s respectively. No flag, no lore. πŸ’…

The synsets matching your search get printed below each sense's synset output described above. Every line of output is preceded by a marker (usually =>), then a synset, formatted exactly as described above. If a search traverses more than one level of the tree, then successive lines get indented by spaces corresponding to its level in the hierarchy β€” yes, it's nesting, it's giving family tree. 🌳 When you specify -g, synset glosses are displayed in parentheses at the end of each synset. Each synset is printed on one line.

Senses are generally ordered from most to least frequently used, with the most common sense numbered 1. Frequency of use is determined by the number of times a sense is tagged in the various semantic concordance texts. Senses that are not semantically tagged follow the ordered senses. But ngl, note that this ordering is only an estimate based on usage in a small corpus. It's vibes-based science, bestie. πŸ™ˆ

Verb senses can be grouped by similarity of meaning instead of ordered by frequency of use. The -simsv search prints all senses that are close in meaning together, with a line of dashes indicating the end of a group. See wngroups(7) for a whole discussion of how senses are grouped. πŸŽ€

The -over search displays an overview of all the senses of the search word in all syntactic categories. The results of this search are similar to the -syns search, however no additional (ex. hypernym) synsets are displayed, and synset glosses are always printed. The senses are grouped by syntactic category, and each synset is annotated as described above with synset_offset, lex_filename, and sense_number as dictated by the -o, -a, and -s options. The overview search also indicates how many of the senses in each syntactic category are represented in the tagged texts. This is a way for you to figure out whether a sense's sense number is based on semantic tagging data, or was just arbitrarily assigned. πŸ‘€ For each sense that has appeared in such texts, the number of semantic tags to that sense are indicated in parentheses after the sense number.

If a search cannot be performed on some senses of searchstr, the search results are headed by a string of the form:

X of Y senses of searchstr

The output of the -deri search shows word forms that are morphologically related to searchstr. Each word form pointed to from searchstr is displayed, preceded by RELATED TO-> and the syntactic category of the link, followed, on the next line, by its synset. Printed after the word form is #n where n indicates the WordNet sense number of the term pointed to. πŸ¦‹

The -domn and -domt searches show the domain that a synset has been classified in and, conversely, all of the terms that have been assigned to a specific domain. A domain is either a TOPIC, REGION or USAGE, as reflected in the specific pointer character stored in the database, and displayed in the output. A -domn search on a term shows the domain, if any, that each synset containing searchstr has been classified in. The output display shows the domain type (TOPIC, REGION or USAGE), followed by the syntactic category of the domain synset and the terms in the synset. Each term is followed by #n where n indicates the WordNet sense number of the term. The converse search, -domt, shows all of the synsets that have been placed into the domain searchstr, with analogous markers. πŸ”₯

When -framv is specified, sample illustrative sentences and generic sentence frames are displayed. If a sample sentence is found, the base form of search is substituted into the sentence, and it is printed below the synset, preceded with the EX: marker. When no sample sentences are found, the generic sentence frames are displayed. Sentence frames that are acceptable for all words in a synset are preceded by the marker *>. If a frame is acceptable for the search word only, it is preceded by the marker =>. 🌸


Search results for adjectives are slightly different from those for other parts of speech. When an adjective is printed, its direct antonym, if it has one, is also printed in parentheses. When searchstr is in a head synset, all of the head synset's satellites are also displayed. The position of an adjective in relation to the noun may be restricted to the prenominal, postnominal or predicative position. Where present, these restrictions are noted in parentheses. πŸ’…

When an adjective is a participle of a verb, the output indicates the verb and displays its synset.

When an adverb is derived from an adjective, the specific adjectival sense on which it is based is indicated.

The morphological transformations performed by the search code may result in more than one word to search for. WordNet automatically performs the requested search on all of the strings and returns the results grouped by word. For example, the verb saw is both the present tense of saw and the past tense of see. When passed searchstr saw, WordNet performs the desired search first on saw and next on see, returning the list of saw senses and search results, followed by those for see. Not me getting two whole results for the price of one, we love efficiency. 😭✨


πŸ‘‘ EXIT STATUS πŸ‘‘

wn() normally exits with the number of senses displayed. If searchword is not found in WordNet, it exits with 0.

If the WordNet database cannot be opened, an error message is displayed and wn() exits with -1. πŸ’€


🧚 ENVIRONMENT VARIABLES (UNIX) 🧚

  • WNHOME β€” Base directory for WordNet. Default is /usr/local/WordNet-3.0.
  • WNSEARCHDIR β€” Directory in which the WordNet database has been installed. Default is WNHOME/dict.

🌈 REGISTRY (WINDOWS) 🌈

  • HKEY_LOCAL_MACHINE\SOFTWARE\WordNet\3.0\WNHome β€” Base directory for WordNet. Default is C:\Program Files\WordNet\3.0.

πŸ“ FILES πŸ“

  • index.pos β€” database index files
  • data.pos β€” database data files
  • *.vrb β€” files of sentences illustrating the use of verbs
  • pos.exc β€” morphology exception lists

πŸ’œ SEE ALSO πŸ’œ


πŸ™ˆ BUGS πŸ™ˆ

Please report bugs to wordnet@princeton.edu. (Tell them bestie sent you. They won't know what that means but it's fine. πŸ’Œ)


and that's the whole page, we made it 🫢 this is WordNet 3.0, dated Dec 2006, from the WN(1) girlies themselves β€” go forth and search, you're literally a lexicographer now, periodt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from