Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
WNINTRO(3WN)		  WordNettm Library Functions		  WNINTRO(3WN)

       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)    | morph.o	  |
		  |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  pro-
       vide 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	proto-
       types,  you  must edit the source code and remove the prototypes	before

       Not all library functions are listed below. Missing  are	 mainly	 func-
       tions 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.

   Database Searching Functions	(search.o)
       findtheinfo		Primary	 search	function for WordNet database.
				Returns	formatted search results in text  buf-
				fer.   Used  by	 WordNet interfaces to perform
				requested search.

       findtheinfo_ds		Primary	search function	for WordNet  database.
				Returns	 search	 results  in  linked list data

       is_defined		Set bit	for each search	type that is valid for
				the search word	passed and return bit mask.

       in_wn			Set  bit  for  each  syntactic	category  that
				search word is in.

       index_lookup		Find word in index file	and return parsed  en-
				try in data structure.	Input word must	be ex-
				act 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 hy-
				phens and underscores, strip periods.

       read_synset		Read synset from  data	file  at  byte	offset
				passed	and return parsed entry	in data	struc-
				ture.  Calls parse_synset().

       parse_synset		Read synset at current byte offset in file and
				return parsed entry in data structure.

       free_syns		Free  a	 synset	linked list allocated by find-

       free_synset		Free a synset structure.

       free_index		Free an	index structure.

       traceptrs_ds		Recursive search algorithm to trace a  pointer
				tree and return	results	in linked list.

       do_trace			Do requested search on synset passed returning
				formatted output in buffer.

   Morphology Functions	(morph.o)
       morphinit		Open exception list files.

       re_morphinit		Close exception	list files and reopen.

       morphstr			Try to find base form (lemma) of word or  col-
				location  in syntactic category	passed.	 Calls
				morphword() for	each word in string passed.

       morphword		Try to find base form  (lemma)	of  individual
				word in	syntactic category passed.

   Utility Functions (wnutil.o)
       wninit			Top  level function to open database files and
				morphology exception lists.

       re_wninit		Top level function to close and	 reopen	 data-
				base files and morphology exception lists.

       cntwords			Count  the number of underscore	or space sepa-
				rated words in a string.

       strtolower		Convert	string to lower	case and remove	trail-
				ing adjective marker if	found.

       ToLowerCase		Convert	string passed to lower case.

       strsubst			Replace	 all  occurrences  of  from with to in

       getptrtype		Return code for	pointer	type character passed.

       getpos			Return	syntactic  category  code  for	string

       getsstype		Return synset type code	for string passed.

       FmtSynset		Reconstruct synset string from synset pointer.

       StrToPos			Passed	string for syntactic category, returns
				corresponding integer value.

       GetSynsetForSense	Return synset for sense	key passed.

       GetDataOffset		Find synset offset for sense.

       GetPolyCount		Find polysemy count for	sense passed.

       GetWORD			Return word part of sense key.

       GetPOS			Return syntactic category code for  sense  key

       WNSnsToStr		Generate sense key for index entry passed.

       GetValidIndexPointer	Search	for string and/or base form of word in
				database and return index structure  for  word
				if found.

       GetWNSense		Return sense number in database	for sense key.

       GetSenseIndex		Return	parsed sense index entry for sense key

       default_display_message	Default	function  to  use  as  value  of  dis-
				play_message.  Simply returns -1.

   Binary Search Functions (binsrch.o)
       bin_search		General	 purpose  binary  search  function  to
				search for key as first	item on	line in	sorted

       copyfile			Copy contents from one file to another.

       replace_line		Replace	a line in a sorted file.

       insert_line		Insert a line into a sorted file.

       wn.h		   WordNet include file	of constants, data structures,
			   external declarations for global variables initial-
			   ized	in wnglobal.c.	Also lists function prototypes
			   for library API. It must be	included  to  use  any
			   WordNet library functions.

       All  library  functions that access the database	files expect the files
       to be open.  The	function wninit(3WN) must be called before other data-
       base access functions such as findtheinfo(3WN) or read_synset(3WN).

       Inclusion of the	header file wn.h is necessary.

       The  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 cat-
       egory 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   | n/a	 |
       WNHOME		   Base	 directory  for	 WordNet.  Default is /usr/lo-

       WNSEARCHDIR	   Directory in	which the WordNet  database  has  been
			   installed.  Default is WNHOME/dict.

			   Base	 directory  for	 WordNet.   Default is C:\Pro-
			   gram	Files\WordNet\3.0.

       lib/libwn.a		     WordNet library (Unix)

       lib\wn.lib		     WordNet library (Windows)

       include			     header files for use with WordNet library

       wnintro(1WN), binsrch(3WN), morph(3WN), wnsearch(3WN), wnutil(3WN), wn-
       intro(5WN), wnintro(7WN).

       Fellbaum,  C.  (1998),  ed.  "WordNet: An Electronic Lexical Database".
       MIT Press, Cambridge, MA.

       Please report bugs to

WordNet	3.0			   Dec 2006			  WNINTRO(3WN)


Want to link to this manual page? Use this URL:

home | help