WN(1WN)
wn(1WN) β WordNetβ’ User Commands π
NAME πΈ
wn β command line interface to WordNet lexical database
SYNOPSIS β¨
wn [ searchstr ] [ -h] [ -g ] [ -a ] [ -l ] [ -o ] [ -s ] [ -n# ] [
search_option... ]
DESCRIPTION π¦
Okay so bestie, wn() is literally your command line interface to the WordNet database, and it lets synsets and relations show up as formatted text. For each word, different searches are provided, based on syntactic category and pointer types. Even though only base forms of words are usually stored in WordNet, users may search for inflected forms β a morphological process is applied to the search string to generate a form that is present in WordNet.
The command line interface is often useful when youβre writing scripts to extract information from the WordNet database. Post-processing of the output with various scripting tools can reformat the results as desired. Periodt.
OPTIONS π
-hβ Print help text before search results. helpful era-gβ Display textual glosses associated with synsets.-aβ Display lexicographer file information.-oβ Display synset offset of each synset.-sβ Display each word's sense numbers in synsets.-lβ Display the WordNet copyright notice, version number, and license.-n#β Perform search on sense number#only.-overβ Display overview of all senses ofsearchstrin all syntactic categories.
Search Options π
Note that the last letter of search_option generally denotes the part of speech that the search applies to: n for nouns, v for verbs, a for adjectives, and r for adverbs. Multiple searches may be done for searchstr with a single command by specifying all the appropriate search options. iykyk
-syns(n | v | a | r)β Display synonyms and immediate hypernyms of synsets containingsearchstr. Synsets are ordered by estimated frequency of use. For adjectives, ifsearchstris in a head synset, the cluster's satellite synsets are displayed in place of hypernyms. Ifsearchstris in a satellite synset, its head synset is also displayed.-simsvβ Display verb synonyms and immediate hypernyms of synsets containingsearchstr. Synsets are grouped by similarity of meaning.-ants(n | v | a | r)β Display synsets containing antonyms ofsearchstr. For adjectives, ifsearchstris in a head synset,searchstrhas a direct antonym. The head synset for the direct antonym is displayed along with the direct antonym's satellite synsets. Ifsearchstris in a satellite synset,searchstrhas an indirect antonym via the head synset, which is displayed.-faml(n | v | a | r)β Display familiarity and polysemy information forsearchstr.-hype(n | v)β Recursively display hypernym (superordinate) tree forsearchstr(searchstr IS A KIND OF _____ relation).-hypo(n | v)β Display immediate hyponyms (subordinates) forsearchstr(_____ IS A KIND OF searchstr relation).-tree(n | v)β Display hyponym (subordinate) tree forsearchstr. This is a recursive search that finds the hyponyms of each hyponym.-coor(n | v)β Display the coordinates (sisters) ofsearchstr. This search prints the immediate hypernym for each synset that containssearchstrand the hypernym's immediate hyponyms.-deri(n | v)β Display derivational morphology links between noun and verb forms.-domn(n | v | a | r)β Display domain thatsearchstrhas been classified in.-domt(n | v | a | r)β Display all terms classified as members of thesearchstr's domain.-subsnβ Display substance meronyms ofsearchstr(HAS SUBSTANCE relation).-partnβ Display part meronyms ofsearchstr(HAS PART relation).-membnβ Display member meronyms ofsearchstr(HAS MEMBER relation).-meronβ Display all meronyms ofsearchstr(HAS PART, HAS MEMBER, HAS SUBSTANCE relations).-hmernβ Display meronyms forsearchstrtree. This is a recursive search that prints all the meronyms ofsearchstrand all of its hypernyms.-sprtnβ Display part of holonyms ofsearchstr(PART OF relation).-smemnβ Display member of holonyms ofsearchstr(MEMBER OF relation).-ssubnβ Display substance of holonyms ofsearchstr(SUBSTANCE OF relation).-holonβ Display all holonyms ofsearchstr(PART OF, MEMBER OF, SUBSTANCE OF relations).-hholnβ Display holonyms forsearchstrtree. This is a recursive search that prints all the holonyms ofsearchstrand all of each holonym's holonyms.-entavβ Display entailment relations ofsearchstr.-framvβ Display applicable verb sentence frames forsearchstr.-causvβ Display cause to relations ofsearchstr.-pert(a | r)β Display pertainyms ofsearchstr.-attr(n | a)β Display adjective values for noun attribute, or noun attributes of adjective values.-grep(n | v | a | r)β List compound words containingsearchstras a substring.
π SEARCH RESULTS π
okay bestie, so everything a search finds gets written straight to standard output. For every single search, the output is a one-line description of the search, and then, right under it, the actual search results. simple as that π
Every search except -over lists all the senses that match, in this general format. Anything wrapped in italicized square brackets ([ ... ]) might just... not be there. no biggie.
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...]
where:
nis the sense number of the search wordsynset_offsetis the byte offset of the synset in thedata.posfile corresponding to the syntactic categorylex_filenameis the name of the lexicographer file that the synset comes fromword1is the first word in the synset β and heads up, that is not necessarily the search word πsense_numberis the WordNet sense number assigned to the preceding word
synset_offset, lex_filename, and sense_number only show up when you specify the -o, -a, and -s options respectively. iykyk β¨
The synsets that match 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 like we just said. 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 π³. When you specify -g, synset glosses show up in parentheses at the end of each synset. Each synset is printed on one line. one. line. periodt.
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. Note that this ordering is only an estimate based on usage in a small corpus β so like, a vibe check, not gospel π
Verb senses can be grouped by similarity of meaning rather than 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(7WN) for a 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 the user to determine whether a sense's sense number is based on semantic tagging data, or was 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. slay π
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. iconic behaviour honestly π
πͺ 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 isWNHOME/dict.
πͺ REGISTRY (WINDOWS) πͺ
HKEY_LOCAL_MACHINE\SOFTWARE\WordNet\3.0\WNHomeβ Base directory for WordNet. Default isC:\Program Files\WordNet\3.0.
π FILES π
index.posβ database index filesdata.posβ database data files*.vrbβ files of sentences illustrating the use of verbspos.excβ morphology exception lists
π SEE ALSO π
wnintro(1WN), wnb(1WN), wnintro(3WN), lexnames(5WN), senseidx(5WN) wndb(5WN), wninput(5WN), morphy(7WN), wngloss(7WN), wngroups(7WN).
π BUGS π
Please report bugs to wordnet@princeton.edu. (bestie if you find one, tell them, they wanna know π«Ά)
and that's the whole page, we did it π this was WordNet 3.0, dated Dec 2006, and it lives at WN(1WN) π go forth and search some synsets, you've got this πβ¨
π¦ where this page comes from
- debian bookworm: wordnet 1:3.0-37 Β· WordNet3.0
- debian trixie: wordnet 1:3.0-39 Β· WordNet3.0
- ubuntu jammy: wordnet 1:3.0-37 Β· WordNet3.0
- ubuntu noble: wordnet 1:3.0-37 Β· WordNet3.0
- ubuntu questing: wordnet 1:3.0-40
- ubuntu resolute: wordnet 1:3.0-41 Β· WordNet3.0
- ubuntu stonking: wordnet 1:3.0-41 Β· WordNet3.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms