Skip to content

Conversation

@vatsan-madhavan
Copy link
Member

@vatsan-madhavan vatsan-madhavan commented Apr 10, 2020

WPF's spell-checker on Win8+ ignores punctuations like . (period) at the end of words like etc. This results in well-formed words like etc., Mr., Mrs. being marked as spelling-errors.

Further, it is impossible to correct these words in WPF.

Because of the way word-breaking is performed by MS.Data.Text.WordsSegmenter under the hood, these punctuations are always dropped during word-breaking. The older spell-checker (NaturalLanguage6.dll) used on Win7 does not have this defect.

MS.Data.Text.WordsSegmenter has declined to 'fix'/'modify this behavior, so we are adding a workaround in WPF.

This change introduces a wrapper on top of the word-breaker and recalculates the tokens, taking into account dropped text that occurs immediately after a token that is likely to fail spell-checking.

Note: See #2753 for the main discussion

@ghost ghost requested a review from rladuca April 10, 2020 21:14
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Apr 10, 2020
@ghost ghost requested a review from SamBent April 10, 2020 21:14
…t the end of words like "etc." This results in well-formed words like "etc.", "Mr.", "Mrs." being marked as spelling-errors.

Further, it is impossible to "correct" these words in WPF.

Becasue of the way word-breaking is performed by MS.Data.Text.WordsSegmenter under the hood, these punctuations are always dropped during word-breaking. The older spell-checker (NaturalLanguage6.dll) used on Win7 does not have this defect.

MS.Data.Text.WordsSegmenter has declined to 'fix'/'modify this behavior, so we are adding a workaround in WPF.

This change introduces a wrapper on top of the word-breaker and recalculates the tokens, taking into account dropped text that occurs immediately after a token that is likely to fail spell-checking.
@vatsan-madhavan vatsan-madhavan requested a review from a team as a code owner May 11, 2020 17:38
@vatsan-madhavan vatsan-madhavan merged commit 7511538 into dotnet:master Jun 3, 2020
@vatsan-madhavan vatsan-madhavan deleted the 5.0/speller-fixup branch June 3, 2020 22:24
@JesikaDG
Copy link

JesikaDG commented Sep 29, 2020

This issue seems like it is contributing to massive performance issues with the July .Net update, documented in #3350. This is one of very few issues that touched the relevant files. One other I found was #3092
There was mention in #2753 about performance concerns, but no discussion here about managing those concerns.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants