feat: add speech normalization for md files#30
Merged
Conversation
c51bad3 to
6261b76
Compare
4db2d9b to
265bc56
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
Adds
stackvox.text— a reusable speech-text normalization mechanism that turns real-world text (Markdown, Claude responses, prose) into something that sounds right when synthesized. Two consumers (behan.codes read-aloud and stackone-speaklast) had grown separate, diverging copies of this pre-step; this extracts the shared mechanism into StackVox while leaving each caller's pronunciation dictionary as per-consumer config. Seedocs/speech-normalization.mdfor the full proposal and API contract.Changes
stackvox/text.pymodule withnormalize_for_speech()as the primary entry point, plus each stage exposed for composition/testing:markdown_to_paragraphs,strip_emoji,strip_thousands_separators,decimals_to_words,expand_units,apply_pronunciations,shape_pauses,ensure_terminal_stop.£1.63→ "1.63 pounds"), decimals → words (1198.9→ "1198 point 9"), pause shaping, emoji stripping, and caller-supplied pronunciation dictionaries.speak/synthesizebehaviour is unchanged; normalization is opt-in.normalize_for_speechfrom the package root (stackvox/__init__.py).docs/speech-normalization.mdproposal.Testing
Ran the full CI-equivalent suite locally, all green:
Related issues