Skip to content

feat(accuracy): score the two-letter եւ and the ligature և as one - #10

Merged
stephen-masters merged 1 commit into
mainfrom
feat/ew-ligature-metric
Oct 9, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
feat/ew-ligature-metric

Conversation

@stephen-masters

Copy link
Copy Markdown
Contributor

Why

Brief 014 Stage 0.3, decided 2026-10-08: classical-orthography presses split 21 to 16 on whether they set եւ as two sorts or the և ligature, reformed presses set the ligature, and transcribers follow the page or do not. An engine that emits one form where the transcript has the other has not misread anything, so the metric should not rank engines on it. Ground truth stays as printed.

What changes

tetrak_ocr.accuracy.normalise folds եւ to և after lowercasing (so Եւ and ԵՒ fold too). One test. The trainer's deliberate copy of this module carries the identical change in scattercode/tetrak-hy-trainer#30, as the two must move together.

Effect

Re-scored every saved reading across the seventeen Armenian evaluation sets: no leader changes on any register; character similarity moves by at most 0.002, word recall by at most 0.016 (plain Tesseract on Հայկական տպագրութիւն, which emits the ligature where the page sets two sorts). registers.csv is not regenerated here: the eight published rows move by under 0.002, and the nine new classical registers join it at brief 014's publish stage.

Test plan

  • pytest tests/ocr/test_accuracy.py tests/test_register_comparison.py: 35 passed
  • ruff clean
  • CI

🤖 Generated with Claude Code

Brief 014, decided 2026-10-08. Classical-orthography presses split 21 to
16 on which form they set and reformed presses set the ligature, so an
engine that emits one where the transcript has the other has not misread
anything. Ground truth stays as printed; the metric folds եւ to և after
lowercasing. The trainer's copy of this module carries the same change.

Co-authored-by: Yvette Mankerian <yvettekm@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Deploying tetrak with  Cloudflare Pages  Cloudflare Pages

Latest commit: d284edf
Status: ✅  Deploy successful!
Preview URL: https://b2be605f.tetrak.pages.dev
Branch Preview URL: https://feat-ew-ligature-metric.tetrak.pages.dev

View logs

Copilot AI balanced review requested due to automatic review settings October 8, 2026 17:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation is focused, correctly ordered, tested, and synchronized with the trainer change.

0 open findings

What changed in this PR

Updates OCR scoring to treat Armenian եւ and և as equivalent while preserving printed ground truth.

Changes:

  • Normalizes the two-letter form to the ligature after lowercasing.
  • Tests lowercase and capitalized forms.
File Description
src/​tetrak_ocr/​accuracy.py Adds the Armenian equivalence normalization.
tests/​ocr/​test_accuracy.py Verifies normalization and word recall.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@stephen-masters
stephen-masters merged commit d9a746a into main Oct 9, 2026
9 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.

2 participants