Repository navigation
A dictionary in Translate: meanings under a word, downloaded with its model (discussion #400) - #415
Merged
Merged
Conversation
…ed with the model (#400) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ader's order; the window grows for its card (#400) - Packs are FNDICT2 files: an index, then gzipped chunks of about 96 K characters; a lookup unzips one chunk (an LRU keeps six), so the 127 MB English text never sits in memory whole. - The build read the first "lang_code" in a raw line, often an etymology's or a translation's, and dropped many entries (Schadenfreude, vergankelijk, 房子): it now reads the entry's own. A line is a form of another word only when its first sense says so. - Meanings: an inflection and its head word's senses of the same part of speech first, the word as written before other spellings, names and initialisms last. - A download card the result well cannot hold makes the window taller (FloatingWindow.growBy, not saved). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The mirror never replaces a released file: one already there must be
the same (size, GitHub's SHA-256) or the run stops. The release is
dictionary-<DICTIONARY_VERSION>; the build takes --version.
- A dictionary that fails to download no longer holds up the
translation it came with; it is not offered again this session.
- The dictionary alone is offered once a session per language, not
under every word.
- The pack is loaded once however many lookups wait (a shared promise)
and let go after IDLE_RELEASE_MS, like the worker.
- The window grows for the actions under a card too.
- "With the {language} dictionary" (not "a English").
- A test reads what the real writer (dictionary-pack.mjs) writes.
- Release notes describe the chunked format and every change made.
- Roots and lone syllables are not words; adv_phrase and circumpos get
names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Do not merge before the dictionary files are uploaded (
node scripts/dictionary-mirror.mjs <build folder>, a new public releasedictionary-1on FineNotes-templates). Until they are, a download that includes a dictionary fails on the dictionary. The translation itself still works, and the dictionary is not offered again in that session.What changed
The third item of discussion #400: a dictionary for selected words, beside the translator.
FloatingWindow.growBy). The size the user set is kept.dictionary-build.mjs(raw extract → packs +src/translate/dictionary-catalog.ts;--version),dictionary-pack.mjs(the writer), anddictionary-mirror.mjs(uploads; never replaces a released file).Proof
npm run gates: all 11 steps pass.check.mjs --changed(all 391 scenes): no finding in the Translate scenes; its 7 groups are the ones the nightly already reports.tests/translate/dictionary.test.ts. One reads what the real writer writes, across many chunks.lang_code. Fixed and rebuilt.Test on the device
Possible only once the files are uploaded.
Not verified
🤖 Generated with Claude Code