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 filesearch.o - Morphology β manual page
morph(3WN) β object filemorph.o - Misc. Utility β manual page
wnutil(3WN) β object filewnutil.o - Binary Search β manual page
binsrch(3WN) β object filebinsrch.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 bygetindex().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. Callsparse_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 byfindtheinfo_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. Callsmorphword()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 ofdisplay_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 inwnglobal.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 TypeNOUN, Syntactic CategoryNOUN, Charn, Stringnoun - Integer
2, Synset TypeVERB, Syntactic CategoryVERB, Charv, Stringverb - Integer
3, Synset TypeADJ, Syntactic CategoryADJ, Chara, Stringadj - Integer
4, Synset TypeADV, Syntactic CategoryADV, Charr, Stringadv - Integer
5, Synset TypeSATELLITE, Syntactic CategoryADJ, Chars, Stringn/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 isWNHOME/dict.
π REGISTRY (WINDOWS) π
HKEY_LOCAL_MACHINE\SOFTWARE\WordNet\3.0\WNHomeβ Base directory for WordNet. Default isC:\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. πβ¨
π¦ where this page comes from
- debian bookworm: wordnet-dev 1:3.0-37 Β· WordNet3.0
- debian trixie: wordnet-dev 1:3.0-39 Β· WordNet3.0
- ubuntu jammy: wordnet-dev 1:3.0-37 Β· WordNet3.0
- ubuntu noble: wordnet-dev 1:3.0-37 Β· WordNet3.0
- ubuntu questing: wordnet-dev 1:3.0-40
- ubuntu resolute: wordnet-dev 1:3.0-41 Β· WordNet3.0
- ubuntu stonking: wordnet-dev 1:3.0-41 Β· WordNet3.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms