cgreet
Deterministic locale-correct greeting and salutation helpers. No models, no I/O: same input always yields the same output.
cgreet owns salutation rules for formal correspondence: which honorifics
and academic titles render, how the surname is found, and which regions
punctuate the German salutation with a comma. Rules are sourced from the
national correspondence norms (SN 010130 for ch/li, DIN 5008 for de/at; at
follows DIN since ÖNORM A 1080 was withdrawn in 2018). Only lowercase
region codes: ch, li, de, at.
use ;
assert_eq!;
assert_eq!;
Use
Rust:
[]
= "0.2"
TypeScript (zero dependencies, runs in browsers, edge runtimes, and Node):
Run cargo test, cargo fmt --check, and
cargo clippy --all-targets -- -D warnings before pushing.
Contract for ports
Behavior is defined by data, not by the Rust code: tables/*.json holds
the rules (schema and the normative token normalization are documented in
tables/README.md) and tests/vectors/*.json is the executable
conformance suite every language port runs. A port is done when every
vector passes; add vectors whenever behavior changes.
License
Dual-licensed under MIT or Apache-2.0, at your option: LICENSE-MIT,
LICENSE-APACHE. Versions tagged v0.1.0 and earlier remain under
FSL-1.1-ALv2.