feat: spell out dev acronyms espeak mispronounces in normalize#37
Merged
Conversation
963fa6b to
62403d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
espeak mispronounces several common dev acronyms — it reads them as a word instead of spelling them out (
CLI→"kligh",CI→"sigh",IDE→"eyed",AWS→"awz",URI→"yuri",IAM→"eeyam") and manglesCI/CDinto "sigh slash C-D". This adds a small, curated pronunciation map applied by default innormalize, so read-aloud output says "C-L-I", "A-W-S", "C-I-C-D", etc.Changes
_DEV_PRONUNCIATIONSmap instackvox/text.py, applied by default via a newdev_terms=Trueparameter onnormalize_for_speech. Whole-word and case-insensitive (reusingapply_pronunciations), so lowercasecliis fixed too. Caller-supplied--pronunciationsstill override the defaults.--no-dev-termsflag on thenormalize/say/speaksubcommands to opt out.API,URL,JSON("jason"),YAML,HTTP,SDK,nginx("engine-x"),CRUD,REST— are deliberately left untouched. Plus a few said-as-a-word fixes:SaaS→"sass",PaaS→"pass",TUI,postgresql→"postgres",kubectl→"kube control".docs/speech-normalization.md): clarifies that generic pronunciation corrections live in core, while domain/org dictionaries (StackOne, Redis, …) stay per-consumer.No change to correctly-voiced text; opt-out preserves the old behaviour exactly.
Testing
pytest— 181 passed;ruff check .clean.Kokoro().tokenizer.phonemize(term, "en-us")(no audio needed): confirmed the six target acronyms read as words before and spell out after, and thatAPI/URL/JSON/HTTP/SDKwere already correct (hence excluded).Related issues
None.