Crate wordnet_types

Crate wordnet_types 

Source
Expand description

Shared, zero-copy types that mirror WordNet’s dictionary format.

The goal is to expose the exact fields found in data.*/index.* while making it cheap to build higher-level tooling. Text fields borrow from a backing buffer (&str); numeric fields keep their raw representation (offset, lex_id, ss_type, pointer source/target indices).

Use Pos and SynsetId to key into a database, Synset and IndexEntry to inspect parsed records, and helpers like decode_st to interpret pointer source/target pairs.

use wordnet_types::{Pos, SynsetId, decode_st};

let pos = Pos::from_char('n').unwrap();
let id = SynsetId { pos, offset: 1740 };
assert_eq!(decode_st("0a0b"), (Some(10), Some(11)));

Structs§

Frame
Verb frame (f_cnt) entry describing example template applicability.
Gloss
Parsed gloss with convenience helpers while keeping the raw text intact.
IndexEntry
Index record from index.*, including sense and tagsense counts.
Lemma
A lemma string and its per-synset lex_id.
Pointer
Pointer metadata from p_cnt section.
Synset
Complete synset record with all semantic fields preserved.
SynsetId
(offset, pos) pair uniquely identifying a synset within the WordNet files.

Enums§

Pos
Part-of-speech marker as used by WordNet files (n, v, a/s, r).
SynsetType
Raw ss_type marker from data.*, including adjective satellites.

Functions§

decode_st
Decode the four-hex source/target field used in pointer blocks.