Table of Contents

NAME

wn - command line interface to WordNet lexical database

SYNOPSIS

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

DESCRIPTION

wn() provides a command line interface to the WordNet database, allowing
synsets and relations to be displayed as formatted text. For each word,
different searches are provided, based on syntactic category and pointer
types. Although 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 writing scripts to extract
information from the WordNet database. Simple post-processing of the output
can reformat the results as desired. For example, the command line interface
is called by Princeton's World Wide Web Wordnet interface.

OPTIONS

-h
     Print help text before search results.
-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 of searchstr in 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.

-syns (n | v | a | r )
     Display synonyms and immediate hypernyms of synsets containing
     searchstr . Synsets are ordered by frequency of use. For adjectives, if
     searchstr is in a head synset, the cluster's satellite synsets are
     displayed in place of hypernyms. If searchstr is in a satellite synset,
     its head synset is also displayed.
-sims (n | v )
     Display noun or 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. The head
     synset for the 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 hypernym (superordinate) tree for searchstr
     (searchstr IS A KIND OF _____ relation).
-hypo (n | v )
     Display immediate hyponyms (subordinates) for searchstr (_____ IS A
     KIND OF searchstr relation).
-tree (n | v )
     Display hyponym (subordinate) tree for searchstr . This is a recursive
     search that finds the hyponyms of each hyponym.
-coor (n | v )
     Display the coordinates (sisters) of searchstr . This search prints the
     immediate hypernym for each synset that contains searchstr and the
     hypernym's immediate hyponyms.
-subsn
     Display substance meronyms of searchstr (HAS SUBSTANCE relation).
-partn
     Display part meronyms of searchstr (HAS PART relation).
-membn
     Display member meronyms of searchstr (HAS MEMBER relation).
-meron
     Display all meronyms of searchstr (HAS PART, HAS MEMBER, HAS SUBSTANCE
     relations).
-hmern
     Display 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 (PART OF relation).
-smemn
     Display member of holonyms of searchstr (MEMBER OF relation).
-ssubn
     Display substance of holonyms of searchstr (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 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 noun attribute, or noun attributes of
     adjective values.
-grep (n | v | a | r )
     List compound words containing searchstr as a substring.

SEARCH RESULTS

The results of a search are written to the standard output. For each search,
the output consists a one line description of the search, followed by the
search results.

All searches other than -over list all senses matching the search results in
the following general format. Items enclosed in italicized square brackets
([~...~] ) may not be present.

     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 n is the sense number of the search word, synset_offset is
     the byte offset of the synset in the data.pos file corresponding
     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 (note that this is not necessarily the search
     word) and sense_number is the WordNet sense number assigned to the
     preceding word. synset_offset , lex_filename , and sense_number
     are generated when the -o , -a , and -s options, respectively, are
     specified.

     The synsets matching the search requested are printed below each
     sense's synset output described above. Each line of output is
     preceded by a marker (usually => ), then a synset, formatted as
     described above. If a search traverses more one level of the tree,
     then successive lines are indented by spaces corresponding to its
     level in the hierarchy. When the -g option is specified, 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.

     Noun and verb senses can be grouped by similarity of meaning,
     rather than ordered by frequency of use. The -sims 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 randomly
     assigned.

     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

     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 .

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 messages is displyed and
wn() exits with -1 .

ENVIRONMENT VARIABLES

WNHOME
     Base directory for WordNet. Unix default is /usr/local/wordnet1.6 , PC
     default is C:\wn16 , Macintosh default is : .
WNSEARCHDIR
     Directory in which the WordNet database has been installed. Unix
     default is WNHOME/dict , PC default is WNHOME\dict , Macintosh default
     is :Database .
WNDBVERSION
     Indicates which format the WordNet database files in WNSEARCHDIR are
     in. The default is 1.6 . Setting WNDBVERION to 1.5 allows the 1.6
     commands to work with the 1.5 database files.

FILES

All files are in the directory WNSEARCHDIR .

index.pos
     database index files (Unix and Macintosh)
pos.idx
     database index files (PC)
data.pos
     database data files (Unix and Macintosh)
pos.dat
     database data files (PC)
cousin.*
     files used to group similar senses
*.vrb
     files of sentences illustrating the use of verbs
pos.exc
     morphology exception lists

SEE ALSO

wnintro(3WN) , lexnames(5WN) , wndb(5WN) , wninput(5WN) , morphy(7WN) ,
wngloss(7WN) , wngroups(7WN) .

BUGS

Depending on the computer platform used, the -sims and -grep searches may be
slow.

Please report bugs to wordnet@princeton.edu.

----------------------------------------------------------------------------

Table of Contents

   * NAME
   * SYNOPSIS
   * DESCRIPTION
   * OPTIONS
        o Search Options
   * SEARCH RESULTS
   * EXIT STATUS
   * ENVIRONMENT VARIABLES
   * FILES
   * SEE ALSO
   * BUGS
