diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-26 13:08:55 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-26 13:08:55 +0200 |
| commit | 1a3046e2a3793fe52ec518818b19a6f15aadbb75 (patch) | |
| tree | 83bb4bcc6d646b74093d18324076c32e2fede74b /bin | |
| parent | 37a3d4ee06717c24ad07db2bc365cad587ad6d5f (diff) | |
| download | colitur-1a3046e2a3793fe52ec518818b19a6f15aadbb75.tar.gz colitur-1a3046e2a3793fe52ec518818b19a6f15aadbb75.zip | |
fix(of): print the OF's own transcribed Latin/English names, not EF's
day_line_of/readings_line_of resolved every displayed name through
lang/la.ini -- data documented as "transcribed from the 1962 Missale
Romanum", i.e. EF vocabulary, keyed on slug. 18 of 222 shipped OF
sanctoral slugs collide with an EF slug there and all 18 printed the
WRONG (1962) title (e.g. "S. Marthae Virg.", a rank word the 1969
reform abolished, silently overriding amendment 011's own "Ss.
Marthae, Mariae et Lazari"); the other 204 had no entry and degraded
to a bare slug, so none of the 208 titles calendar-2002.sexp itself
transcribes (cited against the 2002 Missal) was ever reachable.
Add observed_name_of: prefer the observed celebration's own
Celebration.names (looked up by the requested language code), fall
back to the lang/*.ini table only on a miss. Under --raw this is a
no-op (Lang.raw's own code, "raw", is not a valid 2-letter ISO code,
so the names lookup always misses and falls through to the identity
table exactly as before). EF's day_line/readings_line are untouched --
EF's Celebration.names is almost always empty by design, lang/la.ini
is its real, independently-cited name table.
Regression net, two layers: test_lang_coverage.ml gains a test walking
the real assembled OF layer's entries, asserting that every genuine
lang/la.ini collision resolves to the OF's own name, never the EF
table's; test/cli.t pins one real collision (Martha, 29 July) through
the actual CLI in both la and en.
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/main.ml | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/bin/main.ml b/bin/main.ml index 6827fbc..eab41d8 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -664,10 +664,45 @@ let readings_report ~lang ~sigla ~overlays y = resolved_year_report ~line:(readings_line ~lang ~sigla) ~overlays y let rubrics_report ~overlays y = resolved_year_report ~line:rubrics_line ~overlays y +(* Fix wave I1 (final-review.md, 2026-08-25-colitur-of-phases-3-5): unlike + EF's [Celebration.names] (almost always empty -- lang/la.ini is EF's own + independently-cited Latin name table, keyed on slug, and that is + deliberate: see day_line's own header), the OF's data/of/calendar-2002 + .sexp carries a verified [names] entry (both [la] and [en]) for every one + of its 208 sanctoral slugs, transcribed and cited against the 2002 + Missal. [day_line]/[readings_line]'s original OF twins nonetheless + resolved names through the SAME [lang/*.ini] table EF uses -- 18 of 222 + OF slugs collide with an EF slug there and printed the WRONG (1962) + title (e.g. "S. Marthae Virg." instead of amendment 011's own "Ss. + Marthae, Mariae et Lazari"); the other 204 had no entry and degraded to + a bare slug, so calendar-2002.sexp's own transcription was reachable + from nothing. + + [observed_name_of] fixes this at the source: prefer the OBSERVED + CELEBRATION'S OWN [names] (keyed by the requested language code), and + fall back to the lang/*.ini table only on a miss -- which still covers + every slug the calendar data has no name for (the temporal-origin ones, + of-pentecost/of-advent-sunday-4/etc, correctly absent from both tables). + Under [--raw], [Colitur_naming.Lang.raw]'s own [code] is ["raw"], not a + valid 2-letter ISO-639-1 code, so {!Colitur_kernel.Lang.of_string} + rejects it, [from_data] is always [None], and this always falls through + to the lang-table lookup -- [Lang.raw]'s own identity table -- so [--raw] + output is byte-identical to before this fix. *) +let observed_name_of ~lang (cel : Rite_of.Vocab_of.rank Colitur_kernel.Celebration.t) slug_s = + let from_data = + match Colitur_kernel.Lang.of_string (Colitur_naming.Lang.code lang) with + | Error _ -> None + | Ok l -> Colitur_kernel.Names.find cel.Colitur_kernel.Celebration.names l + in + match from_data with Some n -> n | None -> Colitur_naming.Lang.celebration lang slug_s + (* Task 5 (2026-08-25-colitur-of-phases-3-5): [day_line]/[readings_line]'s OF twins -- same two row shapes, same [~lang]/[~sigla] append-only rules (see those functions' own citations just above for the full reasoning, - not repeated here), [Rite_of.Vocab_of] in place of [Rite_ef.Vocab_ef]. *) + not repeated here), [Rite_of.Vocab_of] in place of [Rite_ef.Vocab_ef]. + Names resolve through [observed_name_of] above, not directly through + [Colitur_naming.Lang.celebration] as EF's twins do -- see that + function's own header for why the two rites differ here. *) let day_line_of ~lang (d : (Rite_of.Vocab_of.season, Rite_of.Vocab_of.rank) Colitur_kernel.Liturgical_day.t) = let t = d.Colitur_kernel.Liturgical_day.temporal in let cel = d.Colitur_kernel.Liturgical_day.observed in @@ -679,7 +714,7 @@ let day_line_of ~lang (d : (Rite_of.Vocab_of.season, Rite_of.Vocab_of.rank) Coli String.concat "" (List.map commemoration_suffix d.Colitur_kernel.Liturgical_day.commemorations) in let slug_s = Colitur_kernel.Slug.to_string cel.Colitur_kernel.Celebration.slug in - let name = Colitur_naming.Lang.celebration lang slug_s in + let name = observed_name_of ~lang cel slug_s in let name_suffix = if name = slug_s then "" else " " ^ name in Printf.printf "%s %s %s %s %s %s %s%s%s\n" (D.to_iso8601 d.Colitur_kernel.Liturgical_day.date) (D.weekday_to_string t.Colitur_kernel.Temporal.weekday) @@ -702,7 +737,7 @@ let readings_line_of ~lang ~sigla | None -> "-" in let slug_s = Colitur_kernel.Slug.to_string cel.Colitur_kernel.Celebration.slug in - let name = Colitur_naming.Lang.celebration lang slug_s in + let name = observed_name_of ~lang cel slug_s in let name_suffix = if name = slug_s then "" else " | " ^ name in Printf.printf "%s %s | %s | %s%s\n" (D.to_iso8601 d.Colitur_kernel.Liturgical_day.date) |
