diff options
Diffstat (limited to 'internal/calendar/precedence_ef.go')
| -rw-r--r-- | internal/calendar/precedence_ef.go | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/internal/calendar/precedence_ef.go b/internal/calendar/precedence_ef.go index a1788be..9f5016f 100644 --- a/internal/calendar/precedence_ef.go +++ b/internal/calendar/precedence_ef.go @@ -1,6 +1,9 @@ package calendar -import "sort" +import ( + "sort" + "strings" +) // efRankOrder orders EF (1960) ranks: class-1 highest, then class-2..4, // commemoration, ferial lowest. @@ -69,10 +72,42 @@ func precedenceEF(c candidate) int { // falls on (unlike a saint's feast, which is only commemorated). Give it // the edge over the Sunday's tie-break bonus. p -= 2 + } else if c.Cel.Rank == RankClass1 && beatsClass1Sunday(c.Cel.Slug) { + // RG 91 entries 4 (Immaculate Conception, Assumption BVM) and 5 + // (Vigil & Octave day of the Nativity) both sit ABOVE entry 6 + // (Sundays of Advent/Lent/Passiontide, Low Sunday) -- unlike an + // ORDINARY I-class feast (entry 11, e.g. St Joseph, the Precious + // Blood), which yields to a I-class Sunday, these win the tie. + // Found while verifying defect 4 (Sunday ranks): before that fix, + // Advent/Lent Sundays were wrongly II class, so these feasts beat + // them outright on base class alone, accidentally right; once + // Sundays became I class the tie-break mattered, and without this + // branch the Sunday would wrongly win. Two live cases in the fixed + // calendar: the Immaculate Conception (8 December) on an Advent + // Sunday, and the Vigil of Christmas (24 December) on Advent IV -- + // the latter is not merely a wrong winner but a WORSE bug without + // this branch: transferIfImpededEF has no way to re-place a + // transfer that crosses the Dec31/Jan1 boundary (celebrationDate + // re-resolves a fixed date using the YEAR OF THE DAY BEING QUERIED, + // so a walk landing in January of the following year can never + // match the query that produced it), so the Vigil simply vanished + // for the year instead of landing on the wrong day. The Assumption + // (15 August) never falls in Advent or Lent, so its own share of + // this branch is citation-complete but not live. + p -= 2 } return p } +// beatsClass1Sunday reports whether slug is one of RG 91's entries 4 or 5 -- +// the Immaculate Conception, the Assumption, or the Vigil of Christmas -- +// all of which sit above entry 6's Sundays in the Table of Precedence. +func beatsClass1Sunday(slug string) bool { + return strings.Contains(slug, "immaculate-conception") || + strings.Contains(slug, "assumption-of-the-blessed-virgin-mary") || + slug == "vigil-of-christmas" +} + // pickEF returns the observed EF celebration and the commemorations, ordered // deterministically by precedence then slug. func pickEF(cands []candidate) (candidate, []candidate) { |
