WNINTRO(3WN)

πŸ’– WNINTRO β€” hi bestie, welcome to the WordNetβ„’ Library Functions πŸ’–

okay so this is wnintro, section 3WN of the manual, and it's literally your little intro tour of the WordNetβ„’ Library Functions. grab a snack, we're going in 🫢


✨ NAME ✨

wnintro β€” introduction to WordNet library functions


🌸 DESCRIPTION 🌸

This section of the WordNet Reference Manual is where all the manual pages live that describe the WordNet library functions and API. it's giving reference manual realness, no cap.

The functions are organized into these categories:

  • Database Search β€” manual page wnsearch (3WN) β€” object file search.o
  • Morphology β€” manual page morph (3WN) β€” object file morph.o
  • Misc. Utility β€” manual page wnutil (3WN) β€” object file wnutil.o
  • Binary Search β€” manual page binsrch (3WN) β€” object file binsrch.o

The WordNet library is used by all of the searching interfaces that come with the various WordNet packages. Other programs in the system, like grind(1WN), also use functions in this library. iconic behavior honestly.

The WordNet library ships in both source and binary forms (on some platforms) so you can build applications and tools to your own specifications that utilize the WordNet database. πŸ’… but lowkey important: we do not provide programming support or assistance. you're on your own for that part, bestie.

The code conforms to ANSI C standards. Functions are defined with function prototypes. If you don't have a compiler that accepts prototypes, you have to edit the source code and remove the prototypes before compiling. yes, manually. 😭


πŸ‘‘ LIST OF WORDNET LIBRARY FUNCTIONS πŸ‘‘

Not all library functions are listed below. The ones that are 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.

πŸ” Database Searching Functions (search.o)

  • findtheinfo β€” Primary search function for WordNet database. Returns formatted search results in text buffer. Used by WordNet interfaces to perform requested search.
  • findtheinfo_ds β€” Primary search function for WordNet database. Returns search results in linked list data structure.
  • 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 entry in data structure. Input word must be exact match of string in database. Called by getindex().
  • getindex β€” Find word in index file, trying different techniques β€” replace hyphens with underscores, replace underscores with hyphens, strip hyphens and underscores, strip periods.
  • read_synset β€” Read synset from data file at byte offset passed and return parsed entry in data structure. 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 findtheinfo_ds().
  • 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 collocation 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 database files and morphology exception lists.
  • cntwords β€” Count the number of underscore or space separated words in a string.
  • strtolower β€” Convert string to lower case and remove trailing adjective marker if found.
  • ToLowerCase β€” Convert string passed to lower case.
  • strsubst β€” Replace all occurrences of from with to in str.
  • getptrtype β€” Return code for pointer type character passed.
  • getpos β€” Return syntactic category code for string passed.
  • 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 passed.
  • 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 passed.
  • default_display_message β€” Default function to use as value of display_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 file.
  • 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.

🧚 HEADER FILE 🧚

  • wn.h β€” 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.

πŸ’œ NOTES πŸ’œ

All library functions that access the database files expect the files to be open. The function wninit(3WN) must be called before other database access functions such as findtheinfo(3WN) or read_synset(3WN). like, do not skip this step fr fr.

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. Here's the whole vibe of possible categories as integer codes, synset type constant names, syntactic category constant names, single characters and character strings:

  • Integer 1, Synset Type NOUN, Syntactic Category NOUN, Char n, String noun
  • Integer 2, Synset Type VERB, Syntactic Category VERB, Char v, String verb
  • Integer 3, Synset Type ADJ, Syntactic Category ADJ, Char a, String adj
  • Integer 4, Synset Type ADV, Syntactic Category ADV, Char r, String adv
  • Integer 5, Synset Type SATELLITE, Syntactic Category ADJ, Char s, String n/a

🌟 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 is WNHOME/dict.

πŸ“ REGISTRY (WINDOWS) πŸ“

  • HKEY_LOCAL_MACHINE\SOFTWARE\WordNet\3.0\WNHome β€” Base directory for WordNet. Default is C:\Program Files\WordNet\3.0.

πŸ’… FILES πŸ’…

  • lib/libwn.a β€” WordNet library (Unix)
  • lib\wn.lib β€” WordNet library (Windows)
  • include β€” header files for use with WordNet library

πŸ”₯ SEE ALSO πŸ”₯

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

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


πŸ’€ BUGS πŸ’€

Please report bugs to wordnet@princeton.edu.

not me telling you to email princeton but like, that's genuinely where the bugs go πŸ™ˆ

and that's the whole page bestie, you ate it πŸ’– this was WordNet 3.0, dated Dec 2006, closing out WNINTRO(3WN) β€” go forth and link against it, periodt. πŸŽ€βœ¨