New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spell checker is active for partial words. #166
Comments
Good point. I tried a few options, but wasn't able to find a satisfying one. The relevant code is this: manuskript/manuskript/ui/editors/basicHighlighter.py Lines 82 to 87 in 3b1a3f7
(Code has to be modify like that:) WORDS = '(?iu)([\w\']+)\W' # ← added a capturing group on the word
if hasattr(self.editor, "spellcheck") and self.editor.spellcheck:
for word_object in re.finditer(WORDS, text):
if self.editor._dict and not self.editor._dict.check(word_object.group(1)): # ← spell check the group Maybe somebody has a better idea? |
Well actually I do... I add a space at the end of every checked line, except if the text cursor is there: manuskript/manuskript/ui/editors/basicHighlighter.py Lines 84 to 91 in ee058a3
Please test (on branch |
The behavior is clearly much better now, but an observation would be that it extends the wavy line to include the word terminator as well, whether that's the tailing space or a non word character -- but seemingly only the first one. Here is a word that is behaving strangely, most likely due to the "special character" actually being a part of the word -- the wavy line goes away after adding a space by the end of the word: |
Yep, stupid mistake. Fixed :)
Previous commit should fix that too: It showed me another issue: in some cases, right-click does not select the same word to suggest corrections: Memo: I need to correct that here: manuskript/manuskript/ui/views/textEditView.py Lines 407 to 412 in 3b1a3f7
|
I noticed that both FocusWriter and Gedit suffer from the same issue where the word will be underlined as misspelled if i.e. |
(That was closed in 0.5.0 but I forgot to close it) |
@gedakc @olivierkes Did this issue nestle its way back in again at some point? |
See PR #<to-be-inserted-later> This commit restores the functionality that prevents spell checking a word that is being actively typed at the end of a paragraph. The goals for the spell check word match regexp are: A. Words should include those with an apostrophe *E.g., can't* B. Words should exclude underscore *E.g., hello_world is two words* C. Words in other languages should be recognized *E.g., French word familiarisé* D. Spell check should include word at absolute end of line with no trailing space or punctuation *E.g., tezt* E. Spell check should ignore partial words in progress (user typing) *E.g., paragr while midway through typing paragraph* This commit addresses all five of the above goals. HISTORY: - See issue olivierkes#166 and commit 6ec0c19 in the 0.5.0 release. - See issue olivierkes#283 and commit 63b471e in the 0.7.0 release. Also fix minor incorrect utf-8 encoding at top of source file.
See PR olivierkes#651 This commit restores the functionality that prevents spell checking a word that is being actively typed at the end of a paragraph. The goals for the spell check word match regexp are: A. Words should include those with an apostrophe *E.g., can't* B. Words should exclude underscore *E.g., hello_world is two words* C. Words in other languages should be recognized *E.g., French word familiarisé* D. Spell check should include word at absolute end of line with no trailing space or punctuation *E.g., tezt* E. Spell check should ignore partial words in progress (user typing) *E.g., paragr while midway through typing paragraph* This commit addresses all five of the above goals. HISTORY: - See issue olivierkes#166 and commit 6ec0c19 in the 0.5.0 release. - See issue olivierkes#283 and commit 63b471e in the 0.7.0 release. Also fix minor incorrect utf-8 encoding at top of source file.
See PR #651 This commit restores the functionality that prevents spell checking a word that is being actively typed at the end of a paragraph. The goals for the spell check word match regexp are: A. Words should include those with an apostrophe *E.g., can't* B. Words should exclude underscore *E.g., hello_world is two words* C. Words in other languages should be recognized *E.g., French word familiarisé* D. Spell check should include word at absolute end of line with no trailing space or punctuation *E.g., tezt* E. Spell check should ignore partial words in progress (user typing) *E.g., paragr while midway through typing paragraph* This commit addresses all five of the above goals. HISTORY: - See issue #166 and commit 6ec0c19 in the 0.5.0 release. - See issue #283 and commit 63b471e in the 0.7.0 release. Also fix minor incorrect utf-8 encoding at top of source file.
I am not certain if this is a feature or a bug, but the spell checker is active even when a word has not been completed.
If I type "paragraph", the spell checker will kick in and highlight the word at "parag" since it's not a proper word (yet).
Could a better behaviour be to only check words for spelling once a space or a special character has been added by the end of it?
The text was updated successfully, but these errors were encountered: