Repository navigation
fix(asr): keep punctuation around vocabulary replacements - #1088
Merged
Alex-Wengg merged 2 commits intoNov 1, 2026
Merged
Alex-Wengg merged 2 commits into
Alex-Wengg merged 2 commits into
Conversation
A replacement wrote the bare term over the matched words, dropping their punctuation: "Speak Mac, let's" became "Speakmac let's". Keep the closing punctuation of the span's last word and the opening punctuation of its first word; apostrophes stay with preservingPossessive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A term that ends in punctuation ("Inc.", "Yahoo!") kept the whole closing run of the span, so "Acme Ink.," became "Acme Inc..,". Add only the part of the opening and closing runs the term doesn't already carry.
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.
Why is this change needed?
A vocabulary replacement writes the bare term over the matched words and drops their punctuation. With
Speakmacin the vocabulary,…with Speak Mac, let's see…becomes…with Speakmac let's see…(CLI onmain, Parakeet v3). #1041 keeps possessives; this keeps the rest.What changes?
applyReplacementkeeps the closing punctuation of the span's last word and the opening punctuation of its first (preservingBoundaryPunctuation, next topreservingPossessive).Chat, GPT,→ChatGPT,). Apostrophes stay withpreservingPossessive.replacementWordis still the bare term, soctcAppliedTermsis unchanged.Validation
FLUIDAUDIO_RUN_ASR_E2E=1.swift format lintis clean.🤖 Generated with Claude Code