diff options
Diffstat (limited to 'internal/bible')
| -rw-r--r-- | internal/bible/corpora/wuj.ini | 1 | ||||
| -rw-r--r-- | internal/bible/corpusmeta.go | 9 | ||||
| -rw-r--r-- | internal/bible/registry.go | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/internal/bible/corpora/wuj.ini b/internal/bible/corpora/wuj.ini index 8364923..22eeca3 100644 --- a/internal/bible/corpora/wuj.ini +++ b/internal/bible/corpora/wuj.ini @@ -2,3 +2,4 @@ lang = pl name = Wujek (Polish) psalm_system = vulgate +autoselect = false diff --git a/internal/bible/corpusmeta.go b/internal/bible/corpusmeta.go index 04b9dcb..60d90a9 100644 --- a/internal/bible/corpusmeta.go +++ b/internal/bible/corpusmeta.go @@ -3,15 +3,20 @@ package bible import "github.com/lukaszkasprzak/lectio/internal/ini" // CorpusMeta is the sidecar metadata for a bible corpus (<code>.ini). +// Autoselect (default true) governs whether the corpus may be picked by the +// reading resolver's language auto-match; a corpus with Autoselect=false stays +// reachable only via an explicit reading_version or --ref (e.g. the built-in +// wuj, which is incomplete). See docs national-bibles design. type CorpusMeta struct { Code, Lang, Name, PsalmSystem, Sigla string + Autoselect bool } // parseCorpusMeta reads a section-less sidecar. ini.Parse returns // []ini.Section{Name, Pairs}; keys before any [section] land in the section // whose Name == "" (verified against internal/ini). func parseCorpusMeta(code string, data []byte) CorpusMeta { - m := CorpusMeta{Code: code} + m := CorpusMeta{Code: code, Autoselect: true} // absent autoselect => true secs, err := ini.Parse(data) if err != nil { return m @@ -30,6 +35,8 @@ func parseCorpusMeta(code string, data []byte) CorpusMeta { m.PsalmSystem = p.Val case "sigla": m.Sigla = p.Val + case "autoselect": + m.Autoselect = p.Val != "false" } } } diff --git a/internal/bible/registry.go b/internal/bible/registry.go index 2ab721b..28571ea 100644 --- a/internal/bible/registry.go +++ b/internal/bible/registry.go @@ -52,7 +52,7 @@ func buildRegistry() { if code, ok := strings.CutSuffix(name, ".tsv"); ok { regUserTSV[code] = filepath.Join(userDir, name) if _, have := regMeta[code]; !have { - regMeta[code] = CorpusMeta{Code: code, PsalmSystem: "vulgate"} + regMeta[code] = CorpusMeta{Code: code, PsalmSystem: "vulgate", Autoselect: true} } } } |
