Skip to content

feat(lexicon): decode against the modern and classical lists together - #29

Merged
stephen-masters merged 1 commit into
mainfrom
feat/lexicon-two-lists
Nov 15, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
feat/lexicon-two-lists

Conversation

@stephen-masters

Copy link
Copy Markdown
Contributor

Closes #18.

What

  • lexicon.load_wordlists(*paths): the union of several lists.
  • tetrak_hy.wordlist() returns the union of the released modern and classical lists; classical_wordlist_path() fetches the second file, pinned by CLASSICAL_WORDLIST_URL / CLASSICAL_WORDLIST_SHA256 exactly as the modern one is. Both pins are None until the trainer publishes the list (tetrak-hy-trainer #48), and the modern list is used alone until then, so nothing changes for a current reader(lexicon=True).
  • The decoder itself is unchanged: a word in the lexicon is never touched, so with the union a spelling in either list is accepted as written and never rewritten into the other's; a word in neither is corrected to the most probable listed reading, whichever list holds it. README and module docstring state the rule.

Tests

TestTwoOrthographies on hand-built matrices for նոյն / նույն, where the other spelling is the runner-up: a classical spelling is never rewritten to its reformed form and the reverse; a single list does rewrite it (the over-correction the pair prevents); a misread in neither list is still corrected. test_wordlist.py: pins set together, union loaded and cached, a tampered classical download refused. 89 pass.

τ re-checked on v7 (brief 014)

21,574 real_val crops held out from v7's training, both lists rebuilt without those crops' pages (build_wordlist.py --exclude-crops), the n-best captured once and the rule scored offline.

τ exact (union) change fixed broke
greedy 0.8999
3 0.9144 +313 333 20
4 0.9157 +342 375 33
5 0.9160 +347 393 46
6 0.9153 +333 410 77
8 0.9129 +281 416 135
12 0.8999 0 408 408

τ = 5 stays. By the orthography of the crops' source harvests at τ = 5: the modern list alone is −19 net on the 8,547 classical crops (178 fixed, 197 broken) and +127 on the 13,027 reformed; the union is +223 on classical and +124 on reformed, so each page keeps nearly all of its own list's gain and the other list costs it almost nothing. Full table in the trainer under runs/v7-b014/tau/.

A feat, so a minor release; the pins for the classical list follow with the v7 weights release (#19).

🤖 Generated with Claude Code

Brief 014, Stage 3 (issue #18). A list built from reformed text alone
calls every classical spelling a misread (նոյն is not in it, նույն is)
and corrects a classical page into the other orthography one word at a
time. Two lists are now released side by side and the decoder works on
their union: a word in either list is accepted as written and never
rewritten into the other's, and a word in neither is corrected to the
most probable listed reading, whichever list holds it.

`load_wordlists(*paths)` is the union; `wordlist()` returns the union
of the released lists and `classical_wordlist_path()` the second file,
pinned by `CLASSICAL_WORDLIST_URL` and `CLASSICAL_WORDLIST_SHA256` as
the modern one is. Both are None until the trainer publishes the list
(trainer #48), and the modern list is used alone until then, so this
release changes nothing for a current reader.

Tests: a classical spelling is never rewritten to its reformed form and
the reverse, on hand-built matrices where the other spelling is the
runner-up; a single list does rewrite it, which is the over-correction
the pair prevents; a misread in neither list is still corrected. The
pins are checked set together, the union loaded and cached, a tampered
classical download refused.

τ re-checked on v7's 21,574 held-out crops with the union: 5 is again
the peak (exact-match 0.900 to 0.916, 393 fixed for 46 broken); the
modern list alone loses 19 crops net on classical pages, the union gains
223 there and 124 on reformed pages.

Co-authored-by: Yvette Mankerian <yvettekm@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@stephen-masters
stephen-masters merged commit 91f49e7 into main Nov 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decode against modern and classical word lists without rewriting across them

1 participant