SENSEIDX(5)

πŸ“¦
version 3.0 Β· 2 versions
, in fedora 43, fedora 44, opensuse-leap 16.0

✨ SENSEIDX(5) ✨

ok so bestie, this is the page for SENSEIDX(5), one of the WordNetβ„’ File Formats πŸ’– it's literally all about index.sense and sense.idx β€” WordNet's sense index. sit down, hydrate, we're doing this 🫢


🌸 NAME 🌸

index.sense, sense.idx β€” WordNet's sense index πŸ’…


πŸ’– DESCRIPTION πŸ’–

so the WordNet sense index is this whole alternate method for getting at synsets and word senses in the WordNet database. it's giving back door but make it legit ✨ it's for apps that wanna pull up synsets or other stuff tied to one specific sense in WordNet, instead of every single sense of a word or collocation. it also slaps with tools like grep and Perl when you're trying to find all the senses of a word across one or more parts of speech. no cap πŸ’―

and here's the cute part: a specific WordNet sense, encoded as a sense_key, works as an index into this file, and in return you get:

  • its WordNet sense number
  • the database byte offset of the synset containing the sense
  • the number of times it's been tagged in the semantic concordance texts

ok so if you take a semantically tagged word in a semantic concordance file (you know, the one chilling in a <wf ... > attribute/value pair) and you concatenate the lemma and lex_sense fields with % as the concatenation character? boom πŸ’₯ that's the sense_key for that sense, and you can go search the sense index file with it.

a sense_key is genuinely the best way to represent a sense in semantic tagging or any other system that refers to WordNet senses, and I will not be taking questions πŸ™…β€β™€οΈ the reason is that sense_keys are independent of WordNet sense numbers and synset_offsets, which change between versions of the database (yes, they do that 😭). so if you have the sense index and a sense_key, you can easily get the matching synset (via the synset_offset) and the WordNet sense number. also, a mapping from noun sense_keys in WordNet 1.6 to the corresponding 2.0 sense_keys ships with version 2.0, and it's described over in sensemap(5).

if you want the full deep dive on the WordNet database files, go read wndb(5). it's thorough fr fr πŸ“š

πŸ¦‹ File Format πŸ¦‹

the sense index file lists all the senses in the WordNet database, one sense per line. the file is in alphabetical order, fields are separated by one space, and every line ends with a newline character. neat and tidy, we love a structured queen πŸ‘‘

each line is of the form:

sense_key  synset_offset  sense_number  tag_cnt

sense_key is an encoding of the word sense. programs can construct a sense key in this format and use it as a binary search key into the sense index file. the format of a sense_key is described below πŸ‘‡

synset_offset is the byte offset where the synset containing the sense lives in the database "data" file corresponding to the part of speech encoded in the sense_key. it's an 8 digit, zero-filled decimal integer, and you can use it with fseek(3) to read a synset from the data file. and if you pass it to the WordNet library function read_synset() along with the syntactic category, you get back a data structure containing the parsed synset. iconic ✨

sense_number is a decimal integer indicating the sense number of the word, within the part of speech encoded in sense_key, in the WordNet database. how are sense numbers assigned, you ask? wndb(5) has you covered, bestie.

tag_cnt is the decimal number of times the sense is tagged in various semantic concordance texts. and a tag_cnt of 0 means the sense has not been semantically tagged. zero tags, zero notes, we move πŸ’€

🌈 Sense Key Encoding 🌈

a sense_key is represented as:

lemma%lex_sense

where lex_sense is encoded as:

ss_type:lex_filenum:lex_id:head_word:head_id

lemma is the ASCII text of the word or collocation as found in the WordNet database index file corresponding to pos. it's in lower case, and collocations are formed by joining individual words with an underscore (_) character. yes, the underscore is doing the heavy lifting 🫑

ss_type is a one digit decimal integer representing the synset type for the sense. the numbers for each synset type are listed down in Synset Type below.

lex_filenum is a two digit decimal integer representing the name of the lexicographer file containing the synset for the sense. want the list of lexicographer file names and their numbers? lexnames(5), go off πŸ“–

lex_id is a two digit decimal integer that, when appended onto lemma, uniquely identifies a sense within a lexicographer file. these numbers usually start with 00, and they get incremented as more senses of the word are added to the same file β€” though there's no requirement that the numbers be consecutive or even begin with 00. heads up though: a value of 00 is the default, so it is not present in lexicographer files. only non-default lex_id values must be explicitly assigned in lexicographer files. the format of lexicographer files is described in wninput(5).

head_word is only present if the sense is in an adjective satellite synset. it's the lemma of the first word of the satellite's head synset.

head_id is a two digit decimal integer that, when appended onto head_word, uniquely identifies the sense of head_word within a lexicographer file, exactly like lex_id works. there's a value in this field only if head_word is present. package deal, babes πŸŽ€

⭐ Synset Type ⭐

the synset type is encoded like this:

1    NOUN
2    VERB
3    ADJECTIVE
4    ADVERB
5    ADJECTIVE SATELLITE

πŸ’… NOTES πŸ’…

for non-satellite senses the head_word and head_id fields have no values β€” BUT the field separator character (:) is still there. it's not ghosting you, it's just empty 🫠


🌟 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 πŸ“

  • index.sense β€” sense index

πŸ”₯ SEE ALSO πŸ”₯

binsrch(3), wnsearch(3), lexnames(5), wnintro(5), sensemap(5), wndb(5), wninput(5).


and that's the whole page, bestie πŸ’œ this was WordNet 3.0, dated Dec 2006 β€” shoutout to the WordNetβ„’ File Formats girlies, we ate and left no crumbs πŸ‘‘βœ¨ bye ily 🫢

πŸ“¦ where this page comes from