Skip to content

Commit 893610f

Browse files
committed
fix(gloss): Caesar audit fixes — impetus/pagus/barba/leuci/itis core + truncation + Gai citations (M-023l)
Whole-BG-I LLM audit (1968 lemmas) flagged 383 rows; browser triage showed most are candidate-lemma collisions the popup ranking suppresses. Fixed the 6 confirmed gloss defects: - core overrides + golden rows: impetus 'an attack, assault, onset, charge' (was rare sense[3] 'a fit, paroxysm'), pagus 'a district, canton, commune' (was 'the country'), barba 'beard' (WORDS narrative clause), leucus/leuci 'the Leuci, a people of Gallia Belgica near the Lingones' (was truncated 'whence, perh'), itis 'you (pl.) go, proceed' (was L&S Tuscan ghost 'Day'). - bestClause clause-split guard: don't split ',\s+the X' after an appositive hedge (perh./whence/i.e./viz./scil.) — fixes the leuci truncation mechanism. Verified only leucus/leuci affected (removing 'the' from the lookahead changed 698 rows and was reverted). - Gai citation-tail strip ([.,;:]\s*Gai(?:us)?[\s\S]*$, case-sensitive): removes 'Gai 2, 190' / 'Gai Inst. 1, 115 sq' from 13 juristic rows (certioro, condictio, usurecipio...). NOT a CIT entry (leaves bare-number remnants) and not case-insensitive (ate 'gain'/'gait' in 7 glosses). npm test green (22 unit + 81 IPA + 2075 gloss + 348 census); 9 popup e2e; Caesar BG-I 1928/1929 glossed.
1 parent 573b528 commit 893610f

6 files changed

Lines changed: 119 additions & 1 deletion

File tree

wiktionary_pron/docs/ISSUES.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,3 +1233,38 @@ src/core/Tokenization.ts.
12331233
**Status: FIXED.** New popup e2e test (Germanis → "The Germans", not "full
12341234
sister"); 9 popup + macronizer e2e + 22 unit + 81 IPA + 2069 golden + 348
12351235
census, all green.
1236+
1237+
## M-023l — Caesar gloss audit: fix confirmed defects (2026-08-13) ✅
1238+
1239+
**Symptom.** A whole-BG-I gloss audit (1,968 lemmas via gemini-3.5-flash-lite,
1240+
batch 40, concurrency 16) flagged 383 rows (19.5%). Triage with a live browser
1241+
probe showed the bulk were candidate-lemma collisions the popup ranking
1242+
suppresses (sine→Sinis, eos→Eos, more→morus…) and auditor false-positives
1243+
(explorator "a prying person" is L&S's own sense[0]). The real defects:
1244+
1245+
- **impetus** → "a fit, paroxysm" (rare sense[3]); L&S sense[0] is "an attack,
1246+
assault, onset". Shows on every impetus/impetum in Caesar.
1247+
- **pagus** → "the country"; Caesar means "a district, canton".
1248+
- **barba** → "The ancient Romans allowed the beard to grow long" (WORDS
1249+
narrative first clause); should be "beard".
1250+
- **leucus/leuci** → truncated "…whence, perh" (clause-split at ", the mod.
1251+
Liège" orphaned the dangling hedge); should be a clean ethnic gloss.
1252+
- **itis** → "Day" (L&S Tuscan ghost); should be "you (pl.) go, proceed" (2pl
1253+
of eo).
1254+
- **certioro** → trailing ", Gai 2" (Gaius cited WITHOUT a period, so the
1255+
citation strips miss it).
1256+
1257+
**Fix.**
1258+
- Core overrides for impetus, pagus, barba, leucus, leuci, itis (each with a
1259+
golden row; golden 2069→2075).
1260+
- `bestClause` clause-split guard: don't split ",\s+the X" after an appositive
1261+
hedge (perh./whence/i.e./viz./scil.) — fixes the leuci truncation mechanism
1262+
(was: split at ", the mod. Liège"). Verified: only leucus/leuci affected.
1263+
- Gai citation-tail strip (`[.,;:]\s*Gai(?:us)?[\s\S]*$`, case-sensitive):
1264+
removes "Gai 2, 190" / "Gai Inst. 1, 115 sq" from 13 juristic-gloss rows.
1265+
NOT a CIT-list entry — "Gai" in CIT left a bare-number remnant ("…Ulpian) 2")
1266+
and case-insensitive matching ate "gain"/"gait" in 7 real glosses.
1267+
1268+
**Status: FIXED.** Artifact 34,413 lemmas / 450 KB / L&S 89.8%; golden 2075,
1269+
census 348, Caesar BG-I 1928/1929 (only the ide proper-noun false-positive);
1270+
9 popup e2e green.

wiktionary_pron/docs/LESSONS.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,3 +760,33 @@ Catilinam I, Vergil Aeneid I, Ovid Metamorphoses I.
760760
or BEHIND the upstream `latin-macronizer-wasm` repo. Before editing, diff the two
761761
to learn which is the source of truth — do NOT `npm run build` + sync blindly, or
762762
you'll clobber whichever side carries the newer fixes.
763+
764+
## A whole-corpus LLM audit is mostly noise for a good pipeline — but the real finds are worth it (2026-08-13)
765+
766+
- **Symptom.** Full Caesar BG-I gloss audit (1,968 lemmas, gemini-3.5-flash-lite
767+
batch audit) → 383 flags (19.5%).
768+
- **Triage lesson.** ~300 of the 383 were **candidate-lemma collisions** — the
769+
wordlist maps a common form to a proper-noun/ghost lemma (`sine``Sinis`,
770+
`eos``Eos`, `more``morus`, `saepe``saepes`). The audit flags the *candidate
771+
universe* (my prep script collected ALL lemmas a form maps to), but the popup
772+
shows the *ranked reading*. A live browser probe of 16 high-frequency words
773+
proved the ranking suppresses every wrong candidate — **verify candidate-class
774+
flags in the browser, never trust lemma-universe counts.**
775+
- **The real finds were gloss-quality defects invisible to lemma-level checks**:
776+
`impetus`→"a fit, paroxysm" (extractor picked rare sense[3] over sense[0]),
777+
`pagus`→"the country" (context-primary mismatch), `barba`→a WORDS narrative
778+
clause, `leucus`→truncated "whence, perh", `itis`→"Day" (L&S Tuscan ghost),
779+
`certioro`→trailing ", Gai 2".
780+
- **Two build traps hit while fixing the truncation:**
781+
1. Removing `the\s` from the `bestClause` split lookahead changed **698 rows**
782+
(68 lost glosses) — the ", the X" split is load-bearing. The narrow fix is a
783+
**lookbehind before the comma** (`(?<!perh\.)(?<!whence)(?<!i\.e\.)(?<!viz\.)
784+
(?<!scil\.),`) — and a lookbehind placed AFTER `,\s+` checks the wrong
785+
position (past the whitespace), silently doing nothing.
786+
2. Adding "Gai" to the CIT author list stripped ", Gai" but left a bare
787+
number ("…Ulpian) 2"); and a case-INSENSITIVE `Gai(?:us)?` ate "gain" and
788+
"gait" in 7 real glosses (merito2 "To earn, gain"→"To earn"). The working
789+
form is a case-sensitive citation-tail strip: `[.,;:]\s*Gai(?:us)?[\s\S]*$`.
790+
- **Lesson.** When a build change "fixes" a rare case, always diff the FULL
791+
artifact before/after (the 698-row and 7-row blow-ups only showed up there),
792+
and keep new citation strippers case-sensitive with a sentence-boundary anchor.
-101 Bytes
Binary file not shown.

wiktionary_pron/utils/build_glosses.cjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ function cleanOne(t) {
266266
// the "de or" inside English words — "asiDE OR away" → declino "to turn asi",
267267
// "disquietUDE OR confusion" → interturbo "To produce disquietu".
268268
t = t.replace(/[.,;:]\s+\bde\s+Or\.?[\s\S]*$/i,"").trim();
269+
// "Gai 2, 190", "Gai Inst. 1, 115 sq" — Gaius is cited WITHOUT the period (so
270+
// the 3+-letter CIT author list and CIT_FULL miss it), leaving "Gai Inst" or a
271+
// bare "Gai 2" in the gloss (certioro "...used by Ulpian), Gai 2"; astipulator
272+
// "...stipulation, Gai Inst"). Strip the whole ", Gai…" citation to the end.
273+
t = t.replace(/[.,;:]\s*Gai(?:us)?[\s\S]*$/,"").trim();
269274
t = t.replace(CIT,"");
270275
t = t.replace(/\([^)]*\)\s*$/,"").trim();
271276
t = t.replace(/\([^)]*$/,"").trim(); // unclosed trailing paren (clause-split broke "(syn.: ...)" across clauses)
@@ -566,7 +571,7 @@ function isGlossyOpen(raw) {
566571
return first.length >= 3 && (EN_WORDS.has(first) || BIO_WORDS.has(first) || /(?:ous|ful|able|ible|ive|ish|less|like|some|ed|ing)$/.test(first));
567572
}
568573
function bestClause(s, pos) {
569-
const clauses = s.split(/[;:]/).flatMap(c => c.split(/,\s+(?=to\s|a\s|an\s|the\s|of\s|in\s|by\s|for\s|from\s|with\s|who\s|which\s|one\s|that\s|much\b|few\b|little\b|many\b|great\b|upper\b|lower\b|former\b|latter\b)/))
574+
const clauses = s.split(/[;:]/).flatMap(c => c.split(/(?<!perh\.)(?<!whence)(?<!i\.e\.)(?<!viz\.)(?<!scil\.),\s+(?=to\s|a\s|an\s|the\s|of\s|in\s|by\s|for\s|from\s|with\s|who\s|which\s|one\s|that\s|much\b|few\b|little\b|many\b|great\b|upper\b|lower\b|former\b|latter\b)/))
570575
// definitions that follow a closing etymology bracket: "Engl. else], another, other"
571576
.flatMap(c => c.split(/\]\s*,?\s+(?=a\b|an\b|the\b|one\b|who\b|which\b|what\b|to\b|another\b|other\b)/))
572577
// L&S chains subordinate notes with an em-dash ("a probe, Cels. 7, 17.—Hence,

wiktionary_pron/utils/core_gloss.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226
"bacchylides": "a Greek lyric poet, contemporary of Pindar",
227227
"badia": "a kind of cloak, capote",
228228
"ballista": "a catapult, engine for hurling missiles",
229+
"barba": "beard",
229230
"barcas": "a surname of Hamilcar",
230231
"basilica": "a basilica, public hall",
231232
"beatus": "blessed, happy, fortunate; wealthy",
@@ -878,6 +879,7 @@
878879
"immortalis": "immortal, undying, everlasting",
879880
"immunitas": "immunity, exemption",
880881
"impertior": "to impart, bestow, give a share of",
882+
"impetus": "an attack, assault, onset, charge",
881883
"impositio": null,
882884
"imprimis": "especially, particularly, in the first place",
883885
"improfessus": "unavowed, undeclared, unprofessed",
@@ -943,6 +945,7 @@
943945
"ischias": null,
944946
"iste": "that of yours; that",
945947
"ita": "so, thus, in this manner; yes",
948+
"itis": "you (pl.) go, proceed (2nd pl. of eo)",
946949
"iudex": "a judge",
947950
"iudicium": "a judgment, decision, trial; discernment",
948951
"iugum": "a yoke; a ridge, mountain-range; a pair (of yoked animals)",
@@ -1004,9 +1007,11 @@
10041007
"leporinus": "of a hare, leporine",
10051008
"lerne": "Lerna, a marshy region of Argos",
10061009
"lethaea": "the wife of Olenus, turned to stone for her pride",
1010+
"leuci": "the Leuci, a people of Gallia Belgica near the Lingones",
10071011
"leucographis": "a plant used as a remedy for spitting blood",
10081012
"leucon": "one of Actaeon's hounds",
10091013
"leucothoe": "a daughter of Orchamus, king of Babylon, and Eurynome",
1014+
"leucus": "the Leuci, a people of Gallia Belgica near the Lingones",
10101015
"levatus": "raised, lifted up",
10111016
"levis": "light, not heavy; trifling, fickle",
10121017
"lex": "a law, statute",
@@ -1311,6 +1316,7 @@
13111316
"otium": "leisure, idleness, rest",
13121317
"otium2": "leisure, ease, rest, idleness",
13131318
"paeniteo": "to repent, regret, be dissatisfied",
1319+
"pagus": "a district, canton, commune",
13141320
"palam": "openly, publicly (adv.); in the presence of (prep.)",
13151321
"palamedes": "a son of Nauplius, a Greek hero before Troy, falsely accused by Ulysses",
13161322
"palatinus": "of or belonging to the Palatine hill",

wiktionary_pron/utils/gloss_golden.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,13 @@
13741374
},
13751375
"note": "core_gloss"
13761376
},
1377+
{
1378+
"lemma": "itis",
1379+
"expect": {
1380+
"contains": "you (pl.) go"
1381+
},
1382+
"note": "Caesar gloss audit (M-023l)"
1383+
},
13771384
{
13781385
"lemma": "jam",
13791386
"expect": {
@@ -2996,6 +3003,13 @@
29963003
},
29973004
"note": "core_gloss"
29983005
},
3006+
{
3007+
"lemma": "barba",
3008+
"expect": {
3009+
"contains": "beard"
3010+
},
3011+
"note": "Caesar gloss audit (M-023l)"
3012+
},
29993013
{
30003014
"lemma": "caesar",
30013015
"expect": {
@@ -4758,6 +4772,13 @@
47584772
},
47594773
"note": "core_gloss"
47604774
},
4775+
{
4776+
"lemma": "leucus",
4777+
"expect": {
4778+
"contains": "the Leuci, a people of Gallia Belgica"
4779+
},
4780+
"note": "Caesar gloss audit (M-023l)"
4781+
},
47614782
{
47624783
"lemma": "ligdus",
47634784
"expect": {
@@ -5437,6 +5458,13 @@
54375458
},
54385459
"note": "core_gloss"
54395460
},
5461+
{
5462+
"lemma": "leuci",
5463+
"expect": {
5464+
"contains": "the Leuci, a people of Gallia Belgica"
5465+
},
5466+
"note": "Caesar gloss audit (M-023l)"
5467+
},
54405468
{
54415469
"lemma": "leucon",
54425470
"expect": {
@@ -11208,6 +11236,13 @@
1120811236
},
1120911237
"note": "core_gloss"
1121011238
},
11239+
{
11240+
"lemma": "impetus",
11241+
"expect": {
11242+
"contains": "an attack, assault, onset, charge"
11243+
},
11244+
"note": "Caesar gloss audit (M-023l)"
11245+
},
1121111246
{
1121211247
"lemma": "distribuo",
1121311248
"expect": {
@@ -11971,6 +12006,13 @@
1197112006
},
1197212007
"note": "core_gloss"
1197312008
},
12009+
{
12010+
"lemma": "pagus",
12011+
"expect": {
12012+
"contains": "a district, canton, commune"
12013+
},
12014+
"note": "Caesar gloss audit (M-023l)"
12015+
},
1197412016
{
1197512017
"lemma": "misereo",
1197612018
"expect": {

0 commit comments

Comments
 (0)