Table of Contents
wnintro - introduction to WordNet library functions
This section of the WordNet Reference Manual contains manual pages that
describe the WordNet library functions and API.
Functions are organized
into the following categories:
|Category ||Manual Page ||Object File
|Database Search ||wnsearch (3WN) ||search.o |
|Morphology ||morph (3WN)
|Misc. Utility ||wnutil (3WN) ||wnutil.o |
|Binary Search ||binsrch
(3WN) ||binsrch.o |
The WordNet library is used by all of the searching
interfaces provided with the various WordNet packages. Additional programs
in the system, such as grind(1WN)
, also use functions in this library.
The WordNet library is provided in both source and binary forms (on some
platforms) to allow users to build applications and tools to their own
specifications that utilize the WordNet database. We do not provide programming
support or assistance.
The code conforms to ANSI C standards. Functions
are defined with function prototypes. If you do not have a compiler that
accepts prototypes, you must edit the source code and remove the prototypes
Not all library functions
are listed below. Missing are mainly functions that are called by documented
ones, or ones that were written for specific applications or tools used
during WordNet development. Data structures are defined in wn.h .
- Primary search function for
WordNet database. Returns formatted search results in text buffer. Used
by WordNet interfaces to perform requested search.
search function for WordNet database. Returns search results in linked
list data structure.
- Set bit for each search type that is valid
for the search word passed and return bit mask.
- Set bit for each
syntactic category that search word is in.
- Find word in index
file and return parsed entry in data structure. Input word must be exact
match of string in database. Called by getindex() .
- Find word
in index file, trying different techniques - replace hyphens with underscores,
replace underscores with hyphens, strip hyphens and underscores, strip
- Read synset from data file at byte offset passed
and return parsed entry in data structure. Calls parse_synset() .
- Read synset at current byte offset in file and return parsed entry in
- Free a synset linked list allocated by findtheinfo_ds()
- Free a synset structure.
- Free an index structure.
- Recursive search algorithm to trace a pointer tree and return
results in linked list.
- Do requested search on synset passed
returning formatted output in buffer.
- Open exception list files.
- Close exception list
files and reopen.
- Try to find base form (lemma) of word or collocation
in syntactic category passed. Calls morphword() for each word in string
- Try to find base form (lemma) of individual word in
syntactic category passed.
- Top level
function to open database files and morphology exception lists.
- Top level function to close and reopen database files and morphology
- Count the number of underscore or space separated
words in a string.
- Convert string to lower case and remove
trailing adjective marker if found.
- Convert string passed
to lower case.
- Replace all occurrences of from with to in str
- Return code for pointer type character passed.
syntactic category code for string passed.
- Return synset type
code for string passed.
- Reconstruct synset string from synset
- Passed string for syntactic category, returns corresponding
- Return synset for sense key passed.
- Find synset offset for sense.
- Find polysemy count for sense
- Return word part of sense key.
- Return syntactic
category code for sense key passed.
- Generate sense key for
index entry passed.
- Search for string and/or base
form of word in database and return index structure for word if found.
- Return sense number in database for sense key.
- Return parsed sense index entry for sense key passed.
- Default function to use as value of display_message . Simply returns
- General purpose binary
search function to search for key as first item on line in sorted file.
- Copy contents from one file to another.
a line in a sorted file.
- Insert a line into a sorted file.
All library functions that access the
database files expect the files to be open. The function wninit(3WN)
be called before other database access functions such as findtheinfo(3WN)
- WordNet include file of constants, data structures,
external declarations for global variables initialized in wnglobal.c . Also
lists function prototypes for library API. It must be included to use any
WordNet library functions.
Inclusion of the header file wn.h is necessary.
command line interface is a good example of a simple application that
uses several WordNet library functions.
Many of the library functions
are passed or return syntactic category or synset type information. The
following table lists the possible categories as integer codes, synset
type constant names, syntactic category constant names, single characters
and character strings.
|Integer ||Synset Type ||Syntactic Category
||Char ||String |
|1 ||NOUN ||NOUN ||n ||noun |
|2 ||VERB ||VERB ||v ||verb
|3 ||ADJ ||ADJ ||a ||adj |
|4 ||ADV ||ADV ||r ||adv |
|5 ||SATELLITE ||ADJ ||s
- Base directory for WordNet.
Default is /usr/local/WordNet-3.0 .
- Directory in which the
WordNet database has been installed. Default is WNHOME/dict .
- Base directory for
WordNet. Default is C:\Program Files\WordNet\3.0 .
- WordNet library (Windows)
- header files
for use with WordNet library
Fellbaum, C. (1998),
ed. "WordNet: An Electronic Lexical Database" . MIT Press, Cambridge, MA.
Please report bugs to email@example.com .
Table of Contents