Pref keys ↔ body .txt naming authority
Created: 24-07-2026 · Last updated: 24-07-2026
Handoff: H1569 · Issue: csl-guides#123 · Prior: H1530 · H1543 · H1560 · H1592 (UC-8 fold table) · Enrichment proposal: preface-front-matter-enrichment-use-cases.md
Ruling (24-07-2026)
csl-orig body .txt for CDSL dictionaries was already human-edited over a long correction history. Front-matter pref Markdown is OCR of the printed Vorwort/legend and has not yet been brought to the same editorial standard.
We do not “modernise” 19th‑c. orthography for its own sake. We ensure that how a work is named (siglum) in the body is the same way it is named in the pref legend, so both channels share one naming for the same cited work.
| Layer | Authority |
|---|---|
Body csl-orig/v02/{dict}/{dict}.txt | Wins for siglum orthography / naming |
Pref OCR source pages (*prefNN.md) | Corrected toward body; every key change logged in a meta change log |
| Print scan | Audit trail; rare/MS works never in body stay in the legend |
This supersedes the H1530–H1560 non-goal “no bulk pref overwrite / scan remains truth for keys.” Expansions (full titles) remain scan-faithful unless a key rewrite requires a minimal key-side fix.
Apply gate
| Apply | Hold |
|---|---|
ortho · ocr_key · spacing with body-attested alt_form (alt_body_count ≥ 1) | rare (handschrift / occasional) |
OCR artifacts (leading \ / quotes) when bare form hits body | true_unused long bibliographic titles |
| Dual-key / parenthetical strip when a body form is attested | ambiguous without body attestation |
| Invented forms with zero body hits |
Tools
| Script | Role |
|---|---|
scripts/pref_abbr_crosscheck.py | Census keys vs body (search-time fold_diacritics only) |
scripts/pref_only_decompose.py | Type residual pref_only |
scripts/pref_key_body_align.py | Apply gated key rewrites + write change log; loads fold table |
scripts/pref_fold_table.json | UC-8 documented orthography / OCR folds (examples + rules) |
scripts/build_pref_fold_table.py | Rebuild fold table from PWG/PW align change logs |
Paper / FINDINGS residual tables: Pref residual methods appendix (UC-13).
FAIR / related surfaces (UC-11)
Reciprocal entry points so a citing scholar or release packager can move between the public edition index, per-dict methods notes, this policy, and the machine legend store:
| Surface | Path |
|---|---|
| Public edition index | OCR'd prefaces |
| METHODS (how to cite OCR) | PWG · PW |
| Legend emit + schema | pref_legend_emit.py · legend.schema.json · pilot pwg_legend.json · pw_legend.json |
| Site feed / Abbreviations | src/data/pref-legends.json · Abbreviations & citations |
| Residual methods appendix | UC-13 |
| Artifact index | scripts/out/README.md |
UC-8 fold table (no silent invent-a-fold)
Orthography candidates that are not pure diacritic-strip live in scripts/pref_fold_table.json:
| Section | Content |
|---|---|
examples | Concrete old → new from PWG/PW align change logs, each with dict, body_n, class, source_log URL |
rules | Documented pattern/literal substitutions (j/y, Gṛhj/Gṛhy, Kâtj/Kâty, ḱ/c, ǵ/j, ç/ś, …) |
pref_key_body_align.candidate_alts loads the table additively (exact examples first, then rules, then residual heuristics). A candidate still applies only when the body attests the alt (body_n ≥ 1). Do not invent a new fold in code without a registry row + body evidence.
Canonical pilot examples (from the H1580 change logs):
| old (pref OCR) | new (body) | dict | body_n |
|---|---|---|---|
Âçv. Gṛhj. | Âśv. Gṛhy. | PWG | 1751 |
Kâtj. Çr. | Kâty. Śr. | PWG | 8694 |
Çâńkh. Gṛhj. | Śâńkh. Gṛhy. | PWG | 897 |
Laghuǵ. | Laghuj. | PWG | 242 |
Mahâvîraḱ. | Mahâvîrac. | PW | 277 |
Mṛḱḱh. | Mṛcch. | PW | 246 |
Validate: python scripts/pref_key_body_align.py --self-check (requires ≥10 PWG/PW examples with body_n ≥ 1).
Search-time diacritic strip in crosscheck (fold_diacritics) is a separate matching aid and is not a substitute for this registry.
Change logs
Per-dict apply runs write a dated change-log meta document under scripts/out/ (e.g. pwg_pref_key_body_align_changes.md) listing every old → new with class, body count, source file, and line. Those logs are the source of truth for new fold-table examples rows — regenerate with python scripts/build_pref_fold_table.py after a meaningful align pass.
After editing source pages, rebuild consolidated editions with each dict’s prefaces/build_combined.py.
Reproduce
python scripts/pref_abbr_crosscheck.py --dict PWG --out-dir scripts/out --json-summary
python scripts/pref_only_decompose.py --dict PWG
python scripts/pref_key_body_align.py --self-check
python scripts/pref_key_body_align.py --dict PWG --apply
# then in PWG/prefaces: python build_combined.py
Dr. Mārcis Gasūns