Repository navigation
Fit an iOS keyboard dictation placed mid-sentence to the text around it - #99
Merged
Merged
Conversation
The keyboard now passes the text after the cursor as well as before it to the shared InsertionContextFormatter, which replaces the iOS-only spacing rules: a dictation placed mid-sentence starts lowercase and drops punctuation the following text makes redundant.
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.
In the iOS keyboard, a dictation inserted into the middle of a sentence kept the model's capital and final punctuation:
…like this one Which ends like this one..The keyboard now passes the text after the cursor (
documentContextAfterInput) as well as the text before it to the shared formatter from #97. That formatter replaces the iOS-only spacing rules. A dictation placed mid-sentence now starts lowercase and drops punctuation that the following text makes redundant. The spacing rules are unchanged.Contract change: in the existing
TextInsertionFormatterTests, a transcript after the context "Prefix" (which ends in a letter, so mid-sentence) now starts lowercase. Those two cases now use the context "Prefix." so they keep testing what they were written for, and a new test covers the mid-sentence fitting.The text around the cursor is used only to format the insertion. It's never stored.
Proof:
make -C iOS checkpasses on a Mac (868 host tests). Device test pending in a TestFlight build from this branch.Sol Loop: 2 rounds, 3 fixes (1 high, 2 medium, 0 low, 0 rejected). These counts cover the whole stack; none of the fixes is iOS-specific.
Created with Claude Opus 5.5 in Claude Code; reviewed by gpt-6.1-sol in Codex.