From 806503cc3da3be227855910b222de8b72be549bc Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Wed, 29 Jul 2026 12:09:57 +0200 Subject: bible(corpus-check): warn on a verse present but stubbed vs the Vulgate The count-based checks (gap, duplicate, missing chapter) only see a verse's presence, so a verse that IS there but truncated -- a lost opening line, a merge artifact, the exact class that lost 44 psalm openings and Acts 6:5 from the old Wujek scrape -- passes silently. Add a warning for it, compared CROSS-CORPUS to the aligned Vulgate verse (never within the chapter). That is deliberate: a genuinely terse verse ("Non occides", "Jesus wept") is short in the Vulgate too, so it is not flagged; only a corpus stub against a substantial Vulgate verse fires (corpus <12 chars, <1/4 of a Vulgate verse >=40). Rune-counted (script-agnostic) and skipped on the Psalms when the corpus renumbers them (psalm_system != vulgate), where per-verse alignment with the Vulgate would not hold. Warning only, never an error. Zero false positives across vul/wuj/drb/grb; a `stub` testdata fixture (Genesis 1:1 = "x") exercises a real hit. --- internal/bible/validate_test.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'internal/bible/validate_test.go') diff --git a/internal/bible/validate_test.go b/internal/bible/validate_test.go index 9cfec26..a3ed622 100644 --- a/internal/bible/validate_test.go +++ b/internal/bible/validate_test.go @@ -1,6 +1,9 @@ package bible -import "testing" +import ( + "strings" + "testing" +) func TestCheckCorpus(t *testing.T) { SetUserCorporaDir("testdata/corpora") @@ -21,4 +24,18 @@ func TestCheckCorpus(t *testing.T) { if r := CheckCorpus("badsystem"); r.OK() { t.Fatal("bad psalm_system not caught") } + // A verse present but a stub next to the Vulgate's (Genesis 1:1 = "x") is a + // warning, never an error -- the count-based checks can't see it. + if r := CheckCorpus("stub"); !hasWarning(r.Warnings, "suspiciously short") { + t.Fatalf("stub verse not warned; warnings: %v", r.Warnings) + } +} + +func hasWarning(ws []string, substr string) bool { + for _, w := range ws { + if strings.Contains(w, substr) { + return true + } + } + return false } -- cgit v1.3