From 5e1664b8008675177a551aff1de371f54d4e20e4 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 28 Jul 2026 18:01:33 +0200 Subject: bible: embed only the Vulgate by default; other corpora opt-in Split the bundled corpora so the default binary carries only the public-domain Latin Vulgate. wuj/drb/grb move to corpora_optional/ and are compiled in only with `-tags fullbible`, or dropped into the user corpora dir at runtime. This keeps the distributed AGPL binary free of third-party scripture text -- bible corpora are not covered by lectio's licence. - bible: read corpus files/metadata from core + optional embed FS (embReadCorpus/embCorpusFiles); optionalFS is set only under the tag. - config: default `versions` now reflects corpora actually available in the build (Vulgate first), so a vul-only binary offers no absent versions. - Makefile: `make build` = vul only; `make build-full` embeds the rest; `make test` runs with -tags fullbible; check-corpora validates both dirs. - tests: corpusmeta asserts on vul (the always-embedded corpus); the versions-default expectation follows availableVersions(). --- internal/bible/registry.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'internal/bible/registry.go') diff --git a/internal/bible/registry.go b/internal/bible/registry.go index 28571ea..794b48f 100644 --- a/internal/bible/registry.go +++ b/internal/bible/registry.go @@ -35,10 +35,9 @@ func buildRegistry() { } regMeta = map[string]CorpusMeta{} regUserTSV = map[string]string{} - // embedded first - ents, _ := corporaFS.ReadDir("corpora") - for _, e := range ents { - if code, ok := strings.CutSuffix(e.Name(), ".ini"); ok { + // embedded first (core FS = vul always; optional FS = rest under -tags fullbible) + for _, name := range embCorpusFiles() { + if code, ok := strings.CutSuffix(name, ".ini"); ok { if m, ok := embeddedCorpusMeta(code); ok { regMeta[code] = m } -- cgit v1.3