Spell check: don't flag words wrapped in single quotes (#11975)#11976
Merged
Conversation
A subtitle line wrapped in single quotes used as quotation marks, e.g.
'Een ridder heeft moed gezworen.' kept the leading apostrophe attached to
the first word ('Een) during word splitting, so the dictionary lookup failed
and the word was flagged. The apostrophe is intentionally not a split char
because it is part of contractions ('n, don't), so retry the lookup with the
surrounding apostrophes trimmed when the original word is not found.
Applied to both the interactive spell-check window (SpellCheckManager) and the
editor's misspelled-word underline (SpellChecker base), mirroring the existing
OcrFixEngine behavior.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Fixes #11975
Problem
A subtitle line wrapped in single quotes used as quotation marks, e.g.
'Een ridder heeft moed gezworen.', was flagged by the spell checker on the first word. The issue reporter saw the common wordeenflagged.The leading
'(which the reporter calls an "accent") stays attached to the first word during word splitting, producing'Een. The apostrophe is intentionally not a split character because it's part of contractions like'nanddon't, so'Eenfails the dictionary lookup and gets flagged.Fix
When a word isn't found, retry the lookup with the surrounding apostrophes trimmed — only accepting it when the trimmed form is a real dictionary word, name, or user word (so genuine typos like
'Eenn'are still flagged). This mirrors the existing behavior inOcrFixEngine, which already trims' " -and re-checks.Applied in two places that lacked it:
SpellCheckManager— the interactive spell-check window (shown in the screenshot).SpellCheckerbaseIsWordCorrect— used by the editor's red-underline highlighting, so quoted words aren't underlined either.🤖 Generated with Claude Code