Expand description
Read .q42.lex reverse-lexicon sidecars (Q42LEX format from qualia-cli ingest).
Structs§
- Q42Lex
File - Memory-mapped
.q42.lexfile handle (native targets). - Q42Lex
Mmap - Zero-allocation view over a memory-mapped
.q42.lexslice (sorted hash index). - Q42Lexicon
- In-memory hash → UTF-8 string map from a
.q42.lexfile (cold-path loader).
Enums§
- LexError
- Lexicon
Entry - Lexicon entry payload for serialization
- Lexicon
Key - Largest UTF-8 prefix of
sthat fits inmax_bytes, never splitting a codepoint. Zero-allocation lexicon key for in-memory lookups
Constants§
- DEFAULT_
LEX_ PAGE_ ENTRIES - Fixed upper bound used by the canonical writer. Pages are independently addressable, so an HTTP/IPFS reader only needs this many dictionary records (plus their strings) for one hash lookup.
- LEX_
HEADER_ SIZE - LEX_
MAGIC - LEX_
VERSION_ PAGED - PAGED_
DIRECTORY_ ENTRY_ SIZE - PAGED_
DIRECTORY_ HEADER_ SIZE - PAGED_
PAGE_ HEADER_ SIZE
Functions§
- serialize_
paged_ string_ lexicon - Serialize the v2 paged Q42LEX representation.
- serialize_
string_ lexicon - Serialize a hash → string map into the canonical
Q42LEXbyte layout thatQ42LexMmapreads back (magic, sorted 16-byte index, tagged string blob). This is the write side of the lexicon: the RDF ingest calls it in lossless (“Complete”) mode so every subject/predicate URI and every literal is recoverable viaQ42LexMmap::lookup_hash, instead of being hashed away.