Skip to main content

Crate nibli_lexicon

Crate nibli_lexicon 

Source
Expand description

nibli-lexicon — the COMMITTED English corpus (the dictionary IS Rust source; see corpus and the Dictionary Data section of CLAUDE.md).

Since the committed-corpus milestone there is exactly ONE build mode: the strongly-typed tables in src/corpus/ are committed, const-validated at compile time, and identical in local, CI, and deployed builds. The old build-time parse of dictionary-en.json (and its FULL/FALLBACK dual mode) is gone — the JSON is now only the INPUT of the tools/lexigen regeneration tool (just regen-lexicon).

The public surface is functions-only (no pub statics), so the internals can evolve without consumer churn:

Gismu do not resolve anywhere: the ONLY spellings are the English corpus names (and a+b compound spellings). The source gismu survives solely as the by_provenance bridge — provenance metadata, never input.

Re-exports§

pub use corpus::CompoundEntry;
pub use corpus::CorpusTier;
pub use corpus::PredicateEntry;
pub use corpus::Swap;

Modules§

corpus
The committed English corpus — the successor to the build-time dictionary-en.json parse (the committed-corpus milestone).
reserved
The nibli KR reserved-word list — SINGLE SOURCE (NIBLI_KR.md §2).

Functions§

alias
Look up an English predicate name (the only resolvable atomic spelling). None means the name is unknown — nibli-kr’s resolver FAILS CLOSED (no arity-2 default; NIBLI_KR §13).
by_provenance
The provenance bridge: gismu → its CANONICAL (unswapped) corpus entry. Permanent API — the Predilex gates key their Lojban-lemma bounds through it, and future ontology-row import uses the same mapping.
canonical_alias
The canonical (plain, unswapped) English name for a gismu — the render direction. Converted entries are never canonical.
compound
Look up a compound predicate by its a+b KR spelling.
compound_by_relation
Look up a compound by its IR RELATION ident (computer_user) — the post-emit direction (render/arity/place-name lookups on compound relations). Linear over the curated compound table, which stays small.
get_arity
Arity of an IR relation (English corpus name or compound relation ident).
get_gloss
Primary English gloss of an IR relation.
get_template
Curated English place-frame template ({x1}..{x5} placeholders), e.g. get_template("dog") -> Some("{x1} is a dog"). None = no curated frame; callers build a generic frame from get_gloss + get_arity.
relation_places
English place names of an IR relation: an atomic corpus name or a compound’s relation ident. None = unknown relation (callers fall back to positional x<N>).