glossary/glossary_loader library

Typed loader for dialect/glossary.yaml — the project's copy policy.

The file carries two enforced blocks and one advisory one:

  • terms: — always say this (GlossaryTerm, enforced by the glossary rule).
  • banned: — never say this (BannedPattern, enforced by the banned_pattern rule).
  • style: — tone and formality, read by a human or an AI translator rather than by a rule, so it is not parsed here.

terms and banned are mirror images of one question a reviewer asks about wording, which is why they share a file and a diff rather than living one here and one in dialect.yaml. dialect.yaml is plumbing: locales, platforms, publish targets.

The on-disk shape is documented in templates/glossary.yaml. Missing file ⇒ empty glossary; malformed YAML ⇒ FormatException propagated to the caller (caught by dialect check and turned into exit 65).

Classes

BannedPattern
One banned: entry: copy this project does not ship, plus the reason a reviewer should read when it fires.
Glossary
GlossaryTerm
One glossary entry: a canonical English term, a meaning blurb, and translations keyed by locale.