Skip to main content

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.

LayerAuthority
Body csl-orig/v02/{dict}/{dict}.txtWins for siglum orthography / naming
Pref OCR source pages (*prefNN.md)Corrected toward body; every key change logged in a meta change log
Print scanAudit 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

ApplyHold
ortho · ocr_key · spacing with body-attested alt_form (alt_body_count ≥ 1)rare (handschrift / occasional)
OCR artifacts (leading \ / quotes) when bare form hits bodytrue_unused long bibliographic titles
Dual-key / parenthetical strip when a body form is attestedambiguous without body attestation
Invented forms with zero body hits

Tools

ScriptRole
scripts/pref_abbr_crosscheck.pyCensus keys vs body (search-time fold_diacritics only)
scripts/pref_only_decompose.pyType residual pref_only
scripts/pref_key_body_align.pyApply gated key rewrites + write change log; loads fold table
scripts/pref_fold_table.jsonUC-8 documented orthography / OCR folds (examples + rules)
scripts/build_pref_fold_table.pyRebuild fold table from PWG/PW align change logs

Paper / FINDINGS residual tables: Pref residual methods appendix (UC-13).

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:

SurfacePath
Public edition indexOCR'd prefaces
METHODS (how to cite OCR)PWG · PW
Legend emit + schemapref_legend_emit.py · legend.schema.json · pilot pwg_legend.json · pw_legend.json
Site feed / Abbreviationssrc/data/pref-legends.json · Abbreviations & citations
Residual methods appendixUC-13
Artifact indexscripts/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:

SectionContent
examplesConcrete old → new from PWG/PW align change logs, each with dict, body_n, class, source_log URL
rulesDocumented 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)dictbody_n
Âçv. Gṛhj.Âśv. Gṛhy.PWG1751
Kâtj. Çr.Kâty. Śr.PWG8694
Çâńkh. Gṛhj.Śâńkh. Gṛhy.PWG897
Laghuǵ.Laghuj.PWG242
Mahâvîraḱ.Mahâvîrac.PW277
Mṛḱḱh.Mṛcch.PW246

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