diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-20 14:40:12 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-20 14:40:12 +0200 |
| commit | 405910d2fd245e7a11e09eecb8c6fffb68d2169c (patch) | |
| tree | 7cb7e0011fee6c1c07ae81762640f0ab867e88b6 /lib/citation/book.mli | |
| parent | 1aeca948c2a2a82bffaaec65077140aa05f7b3f4 (diff) | |
| download | colitur-405910d2fd245e7a11e09eecb8c6fffb68d2169c.tar.gz colitur-405910d2fd245e7a11e09eecb8c6fffb68d2169c.zip | |
feat(citation): canonical book ids and tradition mapping
Seven books arrive in two spellings, inherited from lectio's ini and
ultimately from Divinum Officium. Collapse them onto one id here rather
than editing generated data.
Naming and renumbering are kept apart: a tradition decides which book an
id denotes, a language file decides what it is called.
Diffstat (limited to 'lib/citation/book.mli')
| -rw-r--r-- | lib/citation/book.mli | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/citation/book.mli b/lib/citation/book.mli new file mode 100644 index 0000000..dd04e0d --- /dev/null +++ b/lib/citation/book.mli @@ -0,0 +1,49 @@ +(* SPDX-License-Identifier: AGPL-3.0-or-later *) + +(** Bible books: one canonical id per book, and the tradition that decides + which book an id denotes. + + Ids follow the VULGATE structure ([kings_3], [esdras_2], + [ecclesiasticus]), because the Vulgate is the default tradition and the + shipped 1962 data is Vulgate throughout. An id is internal -- it is never + shown to a reader, exactly as a slug is never shown. *) + +type id + +val to_string : id -> string + +(** Resolve one spelling as it appears in the data. Returns [None] for + anything not in {!tokens}. + + SEVEN books arrive in two spellings ([Isa]/[Isa.], [3 Kgs.]/[3 Kings], + and five more). That inconsistency is INHERITED from lectio's own ini, + which is itself generated from missalemeum/Divinum Officium -- it is not + a colitur transcription error, and the data is deliberately left + untouched. Both spellings resolve here instead. *) +val of_token : string -> id option + +(** Every id this build knows, for coverage checks. *) +val all : id list + +(** Every accepted spelling paired with its id. *) +val tokens : (string * id) list + +(** A numbering tradition: which book an id denotes. Separate from NAMING + (what a book is called), which lives in a language file's [\[bible\]] + section, because naming varies by language and this does not -- "modern + numbering" is the same decision in Latin, Polish and English. *) +type tradition + +(** The identity tradition: the Vulgate, as the 1962 Missal prints it. The + default; colitur never silently renumbers. *) +val vulgate : tradition + +(** Build a tradition from an ini section's fields. An entry naming an + unknown id on either side is IGNORED, not fatal: a traditions file + written for a newer colitur must still work on an older one. Use + {!unknown_fields} to report them. *) +val tradition_of_fields : (string * string) list -> tradition + +val unknown_fields : (string * string) list -> string list + +val map : tradition -> id -> id |
