Skip to content

feat(fold): decide a token's script three ways and keep եւ and և as set - #30

Merged
stephen-masters merged 1 commit into
mainfrom
feat/fold-ew-three-way
Nov 15, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
feat/fold-ew-three-way

Conversation

@stephen-masters

Copy link
Copy Markdown
Contributor

Closes #17 (brief 014, Stage 3).

Three scripts, one decision per token. Every token is read as Armenian, Latin or Cyrillic (or left undecided) before a glyph in it is written. A token with an Armenian letter is Armenian whatever else it holds, and now folds the Cyrillic copies of the Latin lookalikes it already folded: о/О → օ/Օ, Н → Հ. A token without one is Latin or Cyrillic by its unshared letters or its context, as PR #27 made it. The h, o and colon folds were reviewed against Cyrillic tokens and never touch one: о stays о, a Latin o in a Cyrillic word is written о rather than օ, a colon after a Russian word stays a colon, and a Latin h beside unshared Cyrillic letters makes a token of two scripts that is left as read. Each case has a test.

եւ and և. One word printed two ways; the ground truth keeps what the page prints. The fold never chooses between them (both are Armenian for the token's script, neither is rewritten), and the word list's look-up key (lexicon.core) now reads them as one, so a word listed in either form is accepted in both and the decoder never corrects a page's form to the other's.

Measured on v7's saved readings of the eighteen evaluation registers (raw readings kept under the trainer's runs/v7-b014/readings-registers/):

  • 43 Armenian tokens carried a Cyrillic letter; none was a shared glyph, so the new entries move no register (re-scored: identical to main's fold on all eighteen). The commonest case, в for տ six times on the dictionary, is a shape confusion for training.
  • Of 2,442 tokens v7 emitted with either եւ or և, nine matched the page's word only once the two forms were scored as one (Toranian 7, Khatisian 2); none the other way. The metric already scores them so.
  • The key equivalence moved nothing on the 21,574 held-out crops: exact match 0.9160 before and after, 393 fixed and 46 broken both times. Each list holds the form its presses set (modern: 2,156 words with և, 30 with եւ; classical: 19,893 with եւ, 569 with և), so the rule is there for the word that is only listed one way.
  • The registers' only Cyrillic tokens with a Latin h are chemical formulae the transcripts also set in two scripts (С6H6) and one shape misread (Армян0hой).

104 tests, ruff clean. A feat, so the release is 0.11.0.

🤖 Generated with Claude Code

Issue #17 (brief 014 Stage 3). Every token is now read as Armenian,
Latin or Cyrillic before a glyph in it is written: a token with an
Armenian letter folds the Cyrillic copies of the Latin lookalikes it
already folded (о, О, Н) the same way; a token without one is Latin or
Cyrillic as before. The h, o and colon folds never touch a Cyrillic
token: о stays о, a Latin o in one is written о, a colon stays, and a
Latin h beside unshared Cyrillic letters is a token of two scripts.

եւ and և are one word printed two ways. The fold never chooses between
them, and the word list's look-up key reads them as one, so a word
listed in either form is accepted in both and never corrected from the
page's form to the other's.

Measured on v7's readings of the eighteen evaluation registers: 43
Armenian tokens carried a Cyrillic letter, none a shared glyph, so the
new entries move no register; nine tokens matched the page's word only
with the two forms scored as one, which the metric already does; the
key change moved nothing on the 21,574 held-out crops.

Co-authored-by: Yvette Mankerian <yvettekm@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@stephen-masters
stephen-masters merged commit 9d8732f 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.

Make the script fold treat եւ and և as one and decide script three ways

1 participant