WNDB(5)
π WNDB(5) π β WordNetβ’ File Formats π¦
okay bestie, this is the manual page for WNDB(5), aka the WordNetβ’ File Formats. it's giving database lore, and we're gonna get through it together. π
πΈ NAME πΈ
index.noun,data.noun,index.verb,data.verb,index.adj,data.adj,index.adv,data.advβ WordNet database filesnoun.exc,verb.exc.,adj.exc,adv.excβ morphology exception listssentidx.vrb,sents.vrbβ files used by search code to display sentences illustrating the use of some specific verbs
β¨ DESCRIPTION β¨
For each syntactic category, two files are needed to represent the contents of the WordNet database β index.pos and data.pos, where pos is noun, verb, adj and adv. The other auxiliary files are used by the WordNet library's searching functions and are needed to run the various WordNet browsers.
Each index file is an alphabetized list of all the words found in WordNet in the corresponding part of speech. On each line, following the word, is a list of byte offsets (synset_offsets) in the corresponding data file, one for each synset containing the word. Words in the index file are in lower case only, regardless of how they were entered in the lexicographer files. This folds various orthographic representations of the word into one line enabling database searches to be case insensitive. See wninput(5) for a detailed description of the lexicographer files.
A data file for a syntactic category contains information corresponding to the synsets that were specified in the lexicographer files, with relational pointers resolved to synset_offsets. Each line corresponds to a synset. Pointers are followed and hierarchies traversed by moving from one synset to another via the synset_offsets.
The exception list files, pos.exc, are used to help the morphological processor find base forms from irregular inflections.
The files sentidx.vrb and sents.vrb contain sentences illustrating the use of specific senses of some verbs. These files are used by the searching software in response to a request for verb sentence frames. Generic sentence frames are displayed when an illustrative sentence is not present.
The various database files are in ASCII formats that are easily read by both humans and machines. All fields, unless otherwise noted, are separated by one space character, and all lines are terminated by a newline character. Fields enclosed in italicized square brackets may not be present.
See wngloss(7) for a glossary of WordNet terminology and a discussion of the database's content and logical organization.
π Index File Format π
Each index file begins with several lines containing a copyright notice, version number and license agreement. These lines all begin with two spaces and the line number so they do not interfere with the binary search algorithm that is used to look up entries in the index files. All other lines are in the following format. In the field descriptions, number always refers to a decimal integer unless otherwise defined.
lemma pos synset_cnt p_cnt [ptr_symbol...] sense_cnt tagsense_cnt synset_offset [synset_offset...]
lemmaβ lower case ASCII text of word or collocation. Collocations are formed by joining individual words with an underscore (_) character.posβ Syntactic category:nfor noun files,vfor verb files,afor adjective files,rfor adverb files.
All remaining fields are with respect to senses of lemma in pos.
synset_cntβ Number of synsets thatlemmais in. This is the number of senses of the word in WordNet. See Sense Numbers below for a discussion of how sense numbers are assigned and the order ofsynset_offsetsin the index files.p_cntβ Number of different pointers thatlemmahas in all synsets containing it.ptr_symbolβ A space separated list ofp_cntdifferent types of pointers thatlemmahas in all synsets containing it. Seewninput(5)for a list ofpointer_symbols. If all senses oflemmahave no pointers, this field is omitted andp_cntis0.sense_cntβ Same assense_cntabove. This is redundant, but the field was preserved for compatibility reasons.tagsense_cntβ Number of senses oflemmathat are ranked according to their frequency of occurrence in semantic concordance texts.synset_offsetβ Byte offset indata.posfile of a synset containinglemma. Eachsynset_offsetin the list corresponds to a different sense oflemmain WordNet.synset_offsetis an 8 digit, zero-filled decimal integer that can be used withfseek(3)to read a synset from the data file. When passed toread_synset(3)along with the syntactic category, a data structure containing the parsed synset is returned.
π¦ Data File Format π¦
Each data file begins with several lines containing a copyright notice, version number and license agreement. These lines all begin with two spaces and the line number. All other lines are in the following format. Integer fields are of fixed length, and are zero-filled.
synset_offset lex_filenum ss_type w_cnt word lex_id [word lex_id...] p_cnt [ptr...] [frames...] | gloss
synset_offsetβ Current byte offset in the file represented as an 8 digit decimal integer.lex_filenumβ Two digit decimal integer corresponding to the lexicographer file name containing the synset. Seelexnames(5)for the list of filenames and their corresponding numbers.ss_typeβ One character code indicating the synset type:nβ NOUNvβ VERBaβ ADJECTIVEsβ ADJECTIVE SATELLITErβ ADVERB
w_cntβ Two digit hexadecimal integer indicating the number of words in the synset.wordβ ASCII form of a word as entered in the synset by the lexicographer, with spaces replaced by underscore characters (_). The text of the word is case sensitive, in contrast to its form in the correspondingindex.posfile, that contains only lower-case forms. Indata.adj, a word is followed by a syntactic marker if one was specified in the lexicographer file. A syntactic marker is appended, in parentheses, ontowordwithout any intervening spaces. Seewninput(5)for a list of the syntactic markers for adjectives.lex_idβ One digit hexadecimal integer that, when appended ontolemma, uniquely identifies a sense within a lexicographer file.lex_idnumbers usually start with0, and are incremented as additional senses of the word are added to the same file, although there is no requirement that the numbers be consecutive or begin with0. Note that a value of0is the default, and therefore is not present in lexicographer files.p_cntβ Three digit decimal integer indicating the number of pointers from this synset to other synsets. Ifp_cntis000the synset has no pointers.ptrβ A pointer from this synset to another.ptris of the form:
pointer_symbol synset_offset pos source/target
where synset_offset is the byte offset of the target synset in the data file corresponding to pos.
The source/target field distinguishes lexical and semantic pointers. It is a four byte field, containing two two-digit hexadecimal integers. The first two digits indicates the word number in the current (source) synset, the last two digits indicate the word number in the target synset. A value of 0000 means that pointer_symbol represents a semantic relation between the current (source) synset and the target synset indicated by synset_offset.
A lexical relation between two words in different synsets is represented by non-zero values in the source and target word numbers. The first and last two bytes of this field indicate the word numbers in the source and target synsets, respectively, between which the relation holds. Word numbers are assigned to the word fields in a synset, from left to right, beginning with 1.
See wninput(5) for a list of pointer_symbols, and semantic and lexical pointer classifications.
framesβ Indata.verbonly, a list of numbers corresponding to the generic verb sentence frames for words in the synset.framesis of the form:
f_cnt + f_num w_num [ + f_num w_num...]
where f_cnt a two digit decimal integer indicating the number of generic frames listed, f_num is a two digit decimal integer frame number, and w_num is a two digit hexadecimal integer indicating the word in the synset that the frame applies to. As with pointers, if this number is 00, f_num applies to all words in the synset. If non-zero, it is applicable only to the word indicated. Word numbers are assigned as described for pointers. Each f_num w_num pair is preceded by a +. See wninput(5) for the text of the generic sentence frames.
glossβ Each synset contains a gloss. A gloss is represented as a vertical bar (|), followed by a text string that continues until the end of the line. The gloss may contain a definition, one or more example sentences, or both.
π Sense Numbers π
Senses in WordNet are generally ordered from most to least frequently used, with the most common sense numbered 1. Frequency of use is determined by the number of times a sense is tagged in the various semantic concordance texts. Senses that are not semantically tagged follow the ordered senses. The tagsense_cnt field for each entry in the index.pos files indicates how many of the senses in the list have been tagged.
The cntlist(5) file that ships with the database is basically the receipts π
β it lists how many times each sense got tagged in the semantic concordances. grind(1) eats that data to order the senses of every word. So when the index.pos files get generated, the synset_offsets come out in sense number order, with sense 1 sitting pretty at the top of the list. Senses that have the same number of semantic tags still get their own unique-but-consecutive sense numbers, no sharing bestie. And the WordNet OVERVIEW search? It shows you all the senses of whatever word you asked for, across every syntactic category, and it tells you which of those senses actually show up in the semantically tagged texts. Iconic behaviour honestly β¨
πΈ Exception List File Format πΈ
Exception lists are alphabetized lists of inflected forms of words and their base forms, fr fr. First field of each line = an inflected form. After that comes a space-separated list of one or more base forms of the word. And bestie, there's one exception list file for each syntactic category β keep up π
Ngl, a little lore for you: the noun and verb exception lists were auto-generated from a machine-readable dictionary, so they contain many words that aren't even in WordNet. Also, for lots of the inflected forms, you could totally derive the base forms with the standard detachment rules programmed into Morphy (peep morph(7)). These anomalies are allowed to stay in the exception list files because, and I quote, they do no harm. Lowkey a vibe π
π¦ Verb Example Sentences π¦
For some verb senses, you can get example sentences illustrating how the verb sense is used. Every line of the file sentidx.vrb is a sense_key, then a space, then a comma-separated list of example sentence template numbers, in decimal. The file sents.vrb lists all of the example sentence templates β each line starts with the template number followed by a space, and the rest of the line is the text of a template example sentence, where %s is the placeholder for the verb. Both files are sorted alphabetically so that the sense_key and the template sentence number can be used as indices, via binsrch(3), into the right file. Obsessed with a clean index π₯
When someone requests FRAMES, the WordNet search code goes looking for the sense in sentidx.vrb. Found it? Then the sentence template(s) listed get retrieved from sents.vrb, and the %s gets swapped out for the verb. Not found? Then you get the applicable generic sentence frame(s) listed in frames instead. No gatekeeping π«Ά
π NOTES π
Info in the data.pos and index.pos files represents all of the word senses and synsets in the WordNet database. The word, lex_id, and lex_filenum fields together uniquely identify each word sense in WordNet β and you can encode those in a sense_key as described in senseidx(5). Each synset in the database can be uniquely identified by combining the synset_offset for the synset with a code for the syntactic category (because yes, it is absolutely possible for synsets in different data.pos files to have the same synset_offset π).
The WordNet system provides both command line and window-based browser interfaces to the database. Both interfaces utilize a common library of search and morphology code, and the source code for the library and interfaces is included in the WordNet package. See wnintro(3) for an overview of the WordNet source code π
β¨ 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 π
index.posβ database index filesdata.posβ database data files*.vrbβ files of sentences illustrating the use of verbspos.excβ morphology exception lists
π SEE ALSO π
grind(1), wn(1), wnb(1), wnintro(3), binsrch(3), wnintro(5), cntlist(5), lexnames(5), senseidx(5), wninput(5), morphy(7), wngloss(7), wngroups(7), wnstats(7).
And that's a wrap on WNDB(5) bestie!! π This one came to you straight from WordNet 3.0, dated Dec 2006 β yes she's vintage, yes she still ate π
Go read the other pages, mwah π«Άβ¨
π¦ where this page comes from
- fedora 43: wordnet 3.0-48.fc42 Β· MIT and GPL-2.0-or-later
- fedora 43: wordnet 3.0-48.fc42 Β· MIT and GPL-2.0-or-later
- fedora 44: wordnet 3.0-48.fc42 Β· MIT and GPL-2.0-or-later
- fedora 44: wordnet 3.0-48.fc42 Β· MIT and GPL-2.0-or-later
- opensuse-leap 16.0: wordnet 3.0-bp160.1.11 Β· MIT
- opensuse-leap 16.0: wordnet 3.0-bp160.1.11 Β· MIT
- opensuse-leap 16.0: wordnet 3.0-bp160.1.11 Β· MIT
- opensuse-leap 16.0: wordnet 3.0-bp160.1.11 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms