cgreet 0.2.0

Deterministic locale-correct greeting and salutation helpers
Documentation
cgreet-0.2.0 has been yanked.

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 cgreet::{Region, de_salutation};

assert_eq!(
    de_salutation("Frau Dr. Müller", Region::Ch),
    "Sehr geehrte Frau Dr. Müller",
);
assert_eq!(
    de_salutation("Frau Dr. Müller", Region::De),
    "Sehr geehrte Frau Dr. Müller,",
);

Use

Rust:

[dependencies]
cgreet = "0.2"

TypeScript (zero dependencies, runs in browsers, edge runtimes, and Node):

npm install @corbet-labs/cgreet

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.