|
|
|
|
|
|
|
<HTML> |
|
<HEAD> |
|
<TITLE>WNINTRO(3WN) manual page</TITLE> |
|
</HEAD> |
|
<BODY> |
|
<A HREF="#toc">Table of Contents</A><P> |
|
|
|
<H2><A NAME="sect0" HREF="#toc0">NAME </A></H2> |
|
wnintro - introduction to WordNet library functions |
|
<H2><A NAME="sect1" HREF="#toc1">DESCRIPTION |
|
</A></H2> |
|
This section of the <I>WordNet Reference Manual </I> contains manual pages that |
|
describe the WordNet library functions and API. <P> |
|
Functions are organized |
|
into the following categories: <P> |
|
<TABLE BORDER=0> |
|
<TR> <TD ALIGN=LEFT><B>Category </B> </TD> <TD ALIGN=LEFT><B>Manual Page </B> </TD> <TD ALIGN=LEFT><B>Object File |
|
</B> </TD> </TR> |
|
<TR> <TR> <TD ALIGN=LEFT>Database Search </TD> <TD ALIGN=LEFT>wnsearch (3WN) </TD> <TD ALIGN=LEFT>search.o </TD> </TR> |
|
<TR> <TD ALIGN=LEFT>Morphology </TD> <TD ALIGN=LEFT>morph (3WN) |
|
</TD> <TD ALIGN=LEFT>morph.o </TD> </TR> |
|
<TR> <TD ALIGN=LEFT>Misc. Utility </TD> <TD ALIGN=LEFT>wnutil (3WN) </TD> <TD ALIGN=LEFT>wnutil.o </TD> </TR> |
|
<TR> <TD ALIGN=LEFT>Binary Search </TD> <TD ALIGN=LEFT>binsrch |
|
(3WN) </TD> <TD ALIGN=LEFT>binsrch.o </TD> </TR> |
|
</TABLE> |
|
<P> |
|
The WordNet library is used by all of the searching |
|
interfaces provided with the various WordNet packages. Additional programs |
|
in the system, such as <B><A HREF="grind.1WN.html">grind</B>(1WN)</A> |
|
, also use functions in this library. |
|
<P> |
|
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. <P> |
|
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 |
|
before compiling. |
|
<H2><A NAME="sect2" HREF="#toc2">LIST OF WORDNET LIBRARY FUNCTIONS </A></H2> |
|
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 <B>wn.h </B>. <P> |
|
|
|
<H3><A NAME="sect3" HREF="#toc3">Database |
|
Searching Functions (search.o) </A></H3> |
|
<P> |
|
|
|
<DL> |
|
|
|
<DT><B>findtheinfo </B> </DT> |
|
<DD>Primary search function for |
|
WordNet database. Returns formatted search results in text buffer. Used |
|
by WordNet interfaces to perform requested search. </DD> |
|
|
|
<DT><B>findtheinfo_ds</B> </DT> |
|
<DD>Primary |
|
search function for WordNet database. Returns search results in linked |
|
list data structure. </DD> |
|
|
|
<DT><B>is_defined</B> </DT> |
|
<DD>Set bit for each search type that is valid |
|
for the search word passed and return bit mask. </DD> |
|
|
|
<DT><B>in_wn</B> </DT> |
|
<DD>Set bit for each |
|
syntactic category that search word is in. </DD> |
|
|
|
<DT><B>index_lookup</B> </DT> |
|
<DD>Find word in index |
|
file and return parsed entry in data structure. Input word must be exact |
|
match of string in database. Called by <B>getindex() </B>. </DD> |
|
|
|
<DT><B>getindex</B> </DT> |
|
<DD>Find word |
|
in index file, trying different techniques - replace hyphens with underscores, |
|
replace underscores with hyphens, strip hyphens and underscores, strip |
|
periods. </DD> |
|
|
|
<DT><B>read_synset</B> </DT> |
|
<DD>Read synset from data file at byte offset passed |
|
and return parsed entry in data structure. Calls <B>parse_synset() </B>. </DD> |
|
|
|
<DT><B>parse_synset</B> |
|
</DT> |
|
<DD>Read synset at current byte offset in file and return parsed entry in |
|
data structure. </DD> |
|
|
|
<DT><B>free_syns</B> </DT> |
|
<DD>Free a synset linked list allocated by <B>findtheinfo_ds() |
|
</B>. </DD> |
|
|
|
<DT><B>free_synset</B> </DT> |
|
<DD>Free a synset structure. </DD> |
|
|
|
<DT><B>free_index</B> </DT> |
|
<DD>Free an index structure. |
|
</DD> |
|
|
|
<DT><B>traceptrs_ds</B> </DT> |
|
<DD>Recursive search algorithm to trace a pointer tree and return |
|
results in linked list. </DD> |
|
|
|
<DT><B>do_trace</B> </DT> |
|
<DD>Do requested search on synset passed |
|
returning formatted output in buffer. </DD> |
|
</DL> |
|
<P> |
|
|
|
<H3><A NAME="sect4" HREF="#toc4">Morphology Functions (morph.o) </A></H3> |
|
<P> |
|
|
|
|
|
<DL> |
|
|
|
<DT><B>morphinit</B> </DT> |
|
<DD>Open exception list files. </DD> |
|
|
|
<DT><B>re_morphinit</B> </DT> |
|
<DD>Close exception list |
|
files and reopen. </DD> |
|
|
|
<DT><B>morphstr</B> </DT> |
|
<DD>Try to find base form (lemma) of word or collocation |
|
in syntactic category passed. Calls <B>morphword() </B> for each word in string |
|
passed. </DD> |
|
|
|
<DT><B>morphword</B> </DT> |
|
<DD>Try to find base form (lemma) of individual word in |
|
syntactic category passed. </DD> |
|
</DL> |
|
<P> |
|
|
|
<H3><A NAME="sect5" HREF="#toc5">Utility Functions (wnutil.o) </A></H3> |
|
<P> |
|
|
|
<DL> |
|
|
|
<DT><B>wninit</B> </DT> |
|
<DD>Top level |
|
function to open database files and morphology exception lists. </DD> |
|
|
|
<DT><B>re_wninit</B> |
|
</DT> |
|
<DD>Top level function to close and reopen database files and morphology |
|
exception lists. </DD> |
|
|
|
<DT><B>cntwords</B> </DT> |
|
<DD>Count the number of underscore or space separated |
|
words in a string. </DD> |
|
|
|
<DT><B>strtolower</B> </DT> |
|
<DD>Convert string to lower case and remove |
|
trailing adjective marker if found. </DD> |
|
|
|
<DT><B>ToLowerCase</B> </DT> |
|
<DD>Convert string passed |
|
to lower case. </DD> |
|
|
|
<DT><B>strsubst</B> </DT> |
|
<DD>Replace all occurrences of <I>from </I> with <I>to </I> in <I>str |
|
</I>. </DD> |
|
|
|
<DT><B>getptrtype</B> </DT> |
|
<DD>Return code for pointer type character passed. </DD> |
|
|
|
<DT><B>getpos</B> </DT> |
|
<DD>Return |
|
syntactic category code for string passed. </DD> |
|
|
|
<DT><B>getsstype</B> </DT> |
|
<DD>Return synset type |
|
code for string passed. </DD> |
|
|
|
<DT><B>FmtSynset</B> </DT> |
|
<DD>Reconstruct synset string from synset |
|
pointer. </DD> |
|
|
|
<DT><B>StrToPos</B> </DT> |
|
<DD>Passed string for syntactic category, returns corresponding |
|
integer value. </DD> |
|
|
|
<DT><B>GetSynsetForSense</B> </DT> |
|
<DD>Return synset for sense key passed. </DD> |
|
|
|
<DT><B>GetDataOffset</B> |
|
</DT> |
|
<DD>Find synset offset for sense. </DD> |
|
|
|
<DT><B>GetPolyCount</B> </DT> |
|
<DD>Find polysemy count for sense |
|
passed. </DD> |
|
|
|
<DT><B>GetWORD</B> </DT> |
|
<DD>Return word part of sense key. </DD> |
|
|
|
<DT><B>GetPOS</B> </DT> |
|
<DD>Return syntactic |
|
category code for sense key passed. </DD> |
|
|
|
<DT><B>WNSnsToStr</B> </DT> |
|
<DD>Generate sense key for |
|
index entry passed. </DD> |
|
|
|
<DT><B>GetValidIndexPointer</B> </DT> |
|
<DD>Search for string and/or base |
|
form of word in database and return index structure for word if found. |
|
</DD> |
|
|
|
<DT><B>GetWNSense</B> </DT> |
|
<DD>Return sense number in database for sense key. </DD> |
|
|
|
<DT><B>GetSenseIndex</B> |
|
</DT> |
|
<DD>Return parsed sense index entry for sense key passed. </DD> |
|
|
|
<DT><B>default_display_message</B> |
|
</DT> |
|
<DD>Default function to use as value of <B>display_message </B>. Simply returns |
|
<B>-1 </B>. </DD> |
|
</DL> |
|
<P> |
|
|
|
<H3><A NAME="sect6" HREF="#toc6">Binary Search Functions (binsrch.o) </A></H3> |
|
<P> |
|
|
|
<DL> |
|
|
|
<DT><B>bin_search</B> </DT> |
|
<DD>General purpose binary |
|
search function to search for key as first item on line in sorted file. |
|
</DD> |
|
|
|
<DT><B>copyfile</B> </DT> |
|
<DD>Copy contents from one file to another. </DD> |
|
|
|
<DT><B>replace_line</B> </DT> |
|
<DD>Replace |
|
a line in a sorted file. </DD> |
|
|
|
<DT><B>insert_line</B> </DT> |
|
<DD>Insert a line into a sorted file. |
|
</DD> |
|
</DL> |
|
|
|
<H2><A NAME="sect7" HREF="#toc7">HEADER FILE </A></H2> |
|
|
|
<DL> |
|
|
|
<DT><B>wn.h</B> </DT> |
|
<DD>WordNet include file of constants, data structures, |
|
external declarations for global variables initialized in <B>wnglobal.c </B>. Also |
|
lists function prototypes for library API. It must be included to use any |
|
WordNet library functions. </DD> |
|
</DL> |
|
|
|
<H2><A NAME="sect8" HREF="#toc8">NOTES </A></H2> |
|
All library functions that access the |
|
database files expect the files to be open. The function <B><A HREF="wninit.3WN.html">wninit</B>(3WN)</A> |
|
must |
|
be called before other database access functions such as <B><A HREF="findtheinfo.3WN.html">findtheinfo</B>(3WN)</A> |
|
|
|
or <B><A HREF="read_synset.3WN.html">read_synset</B>(3WN)</A> |
|
.<B></B> <P> |
|
Inclusion of the header file <B>wn.h </B> is necessary. <P> |
|
The |
|
command line interface is a good example of a simple application that |
|
uses several WordNet library functions. <P> |
|
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. <P> |
|
<TABLE BORDER=0> |
|
<TR> <TD ALIGN=CENTER><B>Integer </B> </TD> <TD ALIGN=CENTER><B>Synset Type </B> </TD> <TD ALIGN=CENTER><B>Syntactic Category </B> |
|
</TD> <TD ALIGN=CENTER><B>Char </B> </TD> <TD ALIGN=CENTER><B>String </B> </TD> </TR> |
|
<TR> <TR> <TD ALIGN=CENTER>1 </TD> <TD ALIGN=LEFT>NOUN </TD> <TD ALIGN=LEFT>NOUN </TD> <TD ALIGN=CENTER>n </TD> <TD ALIGN=LEFT>noun </TD> </TR> |
|
<TR> <TD ALIGN=CENTER>2 </TD> <TD ALIGN=LEFT>VERB </TD> <TD ALIGN=LEFT>VERB </TD> <TD ALIGN=CENTER>v </TD> <TD ALIGN=LEFT>verb |
|
</TD> </TR> |
|
<TR> <TD ALIGN=CENTER>3 </TD> <TD ALIGN=LEFT>ADJ </TD> <TD ALIGN=LEFT>ADJ </TD> <TD ALIGN=CENTER>a </TD> <TD ALIGN=LEFT>adj </TD> </TR> |
|
<TR> <TD ALIGN=CENTER>4 </TD> <TD ALIGN=LEFT>ADV </TD> <TD ALIGN=LEFT>ADV </TD> <TD ALIGN=CENTER>r </TD> <TD ALIGN=LEFT>adv </TD> </TR> |
|
<TR> <TD ALIGN=CENTER>5 </TD> <TD ALIGN=LEFT>SATELLITE </TD> <TD ALIGN=LEFT>ADJ </TD> <TD ALIGN=CENTER>s |
|
</TD> <TD ALIGN=LEFT><I>n/a </I> </TD> </TR> |
|
</TABLE> |
|
|
|
<H2><A NAME="sect9" HREF="#toc9">ENVIRONMENT VARIABLES (UNIX) </A></H2> |
|
|
|
<DL> |
|
|
|
<DT><B>WNHOME</B> </DT> |
|
<DD>Base directory for WordNet. |
|
Default is <B>/usr/local/WordNet-3.0 </B>. </DD> |
|
|
|
<DT><B>WNSEARCHDIR</B> </DT> |
|
<DD>Directory in which the |
|
WordNet database has been installed. Default is <B>WNHOME/dict </B>. </DD> |
|
</DL> |
|
|
|
<H2><A NAME="sect10" HREF="#toc10">REGISTRY |
|
(WINDOWS) </A></H2> |
|
|
|
<DL> |
|
|
|
<DT><B>HKEY_LOCAL_MACHINE\SOFTWARE\WordNet\3.0\WNHome</B> </DT> |
|
<DD>Base directory for |
|
WordNet. Default is <B>C:\Program Files\WordNet\3.0 </B>. </DD> |
|
</DL> |
|
|
|
<H2><A NAME="sect11" HREF="#toc11">FILES </A></H2> |
|
|
|
<DL> |
|
|
|
<DT><B>lib/libwn.a</B> </DT> |
|
<DD>WordNet |
|
library (Unix) </DD> |
|
|
|
<DT><B>lib\wn.lib</B> </DT> |
|
<DD>WordNet library (Windows) </DD> |
|
|
|
<DT><B>include</B> </DT> |
|
<DD>header files |
|
for use with WordNet library </DD> |
|
</DL> |
|
|
|
<H2><A NAME="sect12" HREF="#toc12">SEE ALSO </A></H2> |
|
<B><A HREF="wnintro.1WN.html">wnintro</B>(1WN)</A> |
|
, <B><A HREF="binsrch.3WN.html">binsrch</B>(3WN)</A> |
|
, <B><A HREF="morph.3WN.html">morph</B>(3WN)</A> |
|
, |
|
<B><A HREF="wnsearch.3WN.html">wnsearch</B>(3WN)</A> |
|
, <B><A HREF="wnutil.3WN.html">wnutil</B>(3WN)</A> |
|
, <B><A HREF="wnintro.5WN.html">wnintro</B>(5WN)</A> |
|
, <B><A HREF="wnintro.7WN.html">wnintro</B>(7WN)</A> |
|
. <P> |
|
Fellbaum, C. (1998), |
|
ed. <I>"WordNet: An Electronic Lexical Database" </I>. MIT Press, Cambridge, MA. |
|
|
|
<H2><A NAME="sect13" HREF="#toc13">BUGS </A></H2> |
|
Please report bugs to <B>[email protected] </B>. <P> |
|
|
|
<HR><P> |
|
<A NAME="toc"><B>Table of Contents</B></A><P> |
|
<UL> |
|
<LI><A NAME="toc0" HREF="#sect0">NAME</A></LI> |
|
<LI><A NAME="toc1" HREF="#sect1">DESCRIPTION</A></LI> |
|
<LI><A NAME="toc2" HREF="#sect2">LIST OF WORDNET LIBRARY FUNCTIONS</A></LI> |
|
<UL> |
|
<LI><A NAME="toc3" HREF="#sect3">Database Searching Functions (search.o)</A></LI> |
|
<LI><A NAME="toc4" HREF="#sect4">Morphology Functions (morph.o)</A></LI> |
|
<LI><A NAME="toc5" HREF="#sect5">Utility Functions (wnutil.o)</A></LI> |
|
<LI><A NAME="toc6" HREF="#sect6">Binary Search Functions (binsrch.o)</A></LI> |
|
</UL> |
|
<LI><A NAME="toc7" HREF="#sect7">HEADER FILE</A></LI> |
|
<LI><A NAME="toc8" HREF="#sect8">NOTES</A></LI> |
|
<LI><A NAME="toc9" HREF="#sect9">ENVIRONMENT VARIABLES (UNIX)</A></LI> |
|
<LI><A NAME="toc10" HREF="#sect10">REGISTRY (WINDOWS)</A></LI> |
|
<LI><A NAME="toc11" HREF="#sect11">FILES</A></LI> |
|
<LI><A NAME="toc12" HREF="#sect12">SEE ALSO</A></LI> |
|
<LI><A NAME="toc13" HREF="#sect13">BUGS</A></LI> |
|
</UL> |
|
</BODY></HTML> |
|
|