aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen-sanctoral.go
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gen-sanctoral.go')
-rw-r--r--scripts/gen-sanctoral.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/gen-sanctoral.go b/scripts/gen-sanctoral.go
index b179b67..561bec0 100644
--- a/scripts/gen-sanctoral.go
+++ b/scripts/gen-sanctoral.go
@@ -77,13 +77,23 @@ func slugify(title string) string {
}
// classOf infers the celebration class from its English title (precedence hint).
+// Feasts of the Lord (class lord) outrank Ordinary Sundays; the BVM class carries
+// Marian-commemoration precedence. Order matters: the Lord tests run before the
+// saint default; "holy cross" (the feast) is distinguished from "of the cross"
+// (saints like John of the Cross), which stay saints.
func classOf(en string) string {
l := strings.ToLower(en)
switch {
- case strings.Contains(l, "blessed virgin mary"), strings.Contains(l, "our lady"), strings.Contains(l, "of mary"):
- return "bvm"
- case strings.Contains(l, "the lord"), strings.Contains(l, "of the cross"), strings.Contains(l, "transfiguration"), strings.Contains(l, "holy trinity"):
+ case strings.Contains(l, "holy cross"), strings.Contains(l, "transfiguration of the lord"),
+ strings.Contains(l, "presentation of the lord"), strings.Contains(l, "holy name of jesus"),
+ strings.Contains(l, "sacred heart"), strings.Contains(l, "holy trinity"),
+ strings.Contains(l, "body and blood"), strings.Contains(l, "dedication of the lateran"),
+ strings.HasSuffix(l, "of the lord"), strings.Contains(l, "of the lord,"):
return "lord"
+ case strings.Contains(l, "blessed virgin mary"), strings.Contains(l, "our lady"),
+ strings.Contains(l, "of mary"), strings.Contains(l, "queenship"),
+ strings.Contains(l, "immaculate heart"), strings.Contains(l, "the annunciation"):
+ return "bvm"
default:
return "saint"
}