Elamur: **Mova** · [Parse](https://mova.elamur.ai/free/en/parse/) · [Research](https://md.research.elamur.ai/free/en/) · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/)

[Mova](https://md.mova.elamur.ai/free/en/) · [this page in HTML](https://mova.elamur.ai/free/en/docs/tools/dictionary/)

[Mova](https://md.mova.elamur.ai/free/en/) / [docs](https://md.mova.elamur.ai/free/en/docs/) / [tools](https://md.mova.elamur.ai/free/en/docs/tools/) / General language dictionary

# General language dictionary

One dictionary per language, with one record set per `(language, lemma, POS)`. `index.json.zst` (zstd-compressed JSON) maps tuple keys to content-addressed `.mpk` segments. Each reading retains its stable ID, cluster and labels, original fields and raw row, source identity/hash/licence/admission state/review/grade eligibility and source header. Definitions remain their authors' own words; this migration writes no definitions. Legacy numbered senses remain intact as a reading cluster instead of being split by an unreliable punctuation heuristic. Hebrew and Aramaic remain separate languages.

`mova-dictionary inventory REPO DATA GENERAL_ROOT NEW_CONFIG` inventories the existing school, native Wikipedia and admitted English/French sources. `mova-dictionary migrate CONFIG NEW_REPORT` adds them without replacing any existing reading. `merge_sources_replacing_duplicates` is the replacing merge that also retires an earlier reading of a replaced source whose row, under a given mapping (for example without a volatile date), equals a row of the new version, even where the lemma has other sources' readings. `lookup LANGUAGE_DIR LEMMA` streams readings as JSON lines. Source schemas are explicit (`records`, `emode`, `judaism`); every original row is retained even when the schema projection is partial. Grade policy is explicit source eligibility, not inferred reading difficulty. New sense-level eligibility can use independently curated sources. Draft historical snapshots remain drafts.

Imports lock fail-fast. Segments are verified against a pack round trip and written immutably; the prior index generation is archived before atomic publication. Repeating an unchanged import preserves the fingerprint. Different definitions at a key are reported as conflict candidates, both kept. These are not semantic contradiction verdicts. The source catalog accompanies a CC BY-SA data licence; source-specific terms remain attached to every reading. No data enters Git.

The reader keeps index metadata in RAM and decompresses one segment at a time. `visit` and `visit_lemma` stream readings; `lookup` deliberately collects one entry for callers that need it. Entries have no total-size cap. A single legacy row is the memory unit during parsing; a huge individual row still requires memory proportional to that row. Frames, collocates, attributed translations and derived forms have explicit fields. `corpus_evidence` reads the independent `dictindex` CLI on demand, preserving witness citations; its parallel candidates are sentence co-occurrences, not confirmed translations. Statistical clusters are not automatically admitted senses.

## Index file and generations

The index is one zstd frame (level 3, with a content checksum) of the canonical index JSON. The fingerprint is the SHA-256 of the uncompressed JSON, so it is the same value as for the old plain `index.json` and manifest pins keep their meaning. Level 3 because merges run often and a higher level saves little for its time. Readers decode the whole index into RAM as before; a damaged frame fails to open.

Readers (`Reader::open`, `index_bytes`) read `index.json.zst` and fall back to a legacy plain `index.json` only when no compressed index exists. Every program in the tree opens the index through `Reader::open`; none reads an archived generation.

A merge publishes through a temporary file and one rename. When the fingerprint changes, the outgoing index is first written as `index-<fingerprint>.json.zst`, so rollback never has a gap: copy that file over `index.json.zst`. The root then keeps the current index and that one previous generation (`Retention::Previous`); every other generation, the legacy plain `index.json` (as `index-<fingerprint>.json`), legacy plain archives and stale temporary files move into `aside/`. Nothing is deleted; the operator clears `aside/`. An unchanged merge keeps the newest archive present (by modification time), compressing it when it is a legacy plain file. `merge_sources_with(…, Retention::All)` keeps every generation in the root, the old unbounded growth, for comparisons. Segments are never moved: merges are additive, so every generation references only segments that stay.

Run `cargo test -p mova-dictionary`. The controls reject corrupt segments, malformed imports and cross-language source assignment, and check additive conflicting definitions, stable repeats and a multi-segment long entry. Index controls: compressed round trip, legacy plain index read and converted, retention after four merges (current + one previous, the rest in `aside/`), a damaged or non-zstd index refusing to open, a mismatching legacy archive refusing promotion, and `Retention::All` showing the unbounded growth.

## Rejected words

`rejected.rs`. A language's rejected-words index is one TSV, `word reason date source`, sorted by word: words that do not belong in its general dictionary (another language's word, a fragment, a misparse; Nautilus's foreign-word gate decides, [tools/nautilus](https://md.mova.elamur.ai/free/en/docs/tools/nautilus/#the-foreign-word-gate)). Every merge reads the index that guards its dictionary, `$MOVA_DICT_REJECTED/<lang>.tsv`, else `<D>/rejected/<lang>.tsv` for a dictionary at `<D>/general/<lang>`: input rows of a listed word are not added (`rejected_rows` per source in the report) and the readings the index already holds of it are retired (`rejected_retired`), whatever source offers the word, now or later. Retiring drops index pointers only; segments and the previous generation keep the readings. A missing index rejects nothing. `mova-dictionary reject LANGUAGE_DIR NEW_REPORT [REJECTED_TSV]` applies an index without new inputs; `lemmas LANGUAGE_DIR` lists every lemma with its parts of speech, sources, readings and first meaning. The control `a_rejected_word_leaves_and_is_never_added_again`: no index, nothing leaves; with it, both sources' readings of the word leave, a new source offering it again adds nothing, and the previous generation still reads it.

## Gloss language

`gloss.rs`. A dictionary's glosses are written in its own language: French glosses in French, as the form-of definitions and the teachers' French glosses are. `gloss::language(text)` names English or French from closed-class words each has and the other lacks (`the`, `of`, `which` against `le`, `des`, `qui`), an opening `a`, and French elisions; it answers only with two such words of one language and three times as many as of the other, else `None` (short or mixed glosses are unknown and kept). `other_language(lang, text)` marks a gloss out of place. The dictionary site shows a French entry's French glosses only (an entry left without one is hidden, its address leads to its letter page), and Nautilus publication refuses an other-language gloss. `mova-dictionary gloss-langs LANGUAGE_DIR` counts the defining readings per source and language (stderr, JSON) and lists the lemmas whose every defining reading is in the other language (stdout: `lemma readings first-meaning`), the words that wait for a gloss in their language. Limits: no third language, no meaning.

- [← previous Dictionary occurrence index](https://md.mova.elamur.ai/free/en/docs/tools/dictindex/)
- [next → distcheck — the distribution check](https://md.mova.elamur.ai/free/en/docs/tools/distcheck/)
- [↑ back to tools](https://md.mova.elamur.ai/free/en/docs/tools/)

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://mova.elamur.ai/sitemap.xml) · [llms.txt](https://mova.elamur.ai/llms.txt)
