diff options
Diffstat (limited to 'bin/main.ml')
| -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) |
