Apply a house style to your dictation¶
If you write to a house style — "e-mail" not "email", US spelling, "cannot" not "can not" — the Style-Consistency Enforcer (styleguard) rewrites each dictation to match, so you don't have to remember the rule mid-sentence. A local Vale-lite pass, entirely offline. Off by default.
1. Enable the feature¶
2. Write your style rules¶
Create style-rules.toml next to config.toml (~/.config/yazses/style-rules.toml). Each rule maps a preferred term to the variants it replaces:
# ~/.config/yazses/style-rules.toml
[[rule]]
preferred = "e-mail"
variants = ["email", "e mail"]
[[rule]]
preferred = "cannot"
variants = ["can not"]
[[rule]]
preferred = "U.S."
variants = ["US"]
ignore_case = false # only the uppercase "US" is rewritten, not "us"
- Matching is whole-word and case-insensitive by default (
ignore_case = true); setignore_case = falsefor terms where case carries meaning. -
Set
regex = trueon a rule to read each entry invariantsas a regular expression instead of a literal word —preferredis still the literal text that replaces it: -
A rule is skipped, and the reason logged, if it is missing
preferred, has an emptyvariantslist, uses a non-string term, or setsregex = truewith a pattern that does not compile. The rest of the file still applies — a mistyped rule costs you that rule, never the daemon and never the other rules.
3. Point the config at the file (optional) and restart¶
[styleguard] path defaults to style-rules.toml (relative to the config dir), so the file above is found automatically. To use a different location:
# config.toml
[styleguard]
enabled = true # written by `yazses features enable styleguard`
path = "style-rules.toml" # relative to config dir, or an absolute path
Say "send an email" and it lands as "send an e-mail".
See also¶
- Configuration reference —
[styleguard] - Feature reference
- Create spoken macros and snippets — another config-driven, off-by-default text transform on the dictation path.