DSpellcheck
-
I just installed DSpellcheck, and am surprised to find produces hundreds of false error reports on my Web page files (*.htm). A few examples:
● In a line beginning <link rel=“stylesheet”, it flags the word “stylesheet” as misspelled, even though in the DSPellCheck settings I checked the boxes to check only comments and strings in code. As you know, the word “stylesheet” is an HTML standard.
● It flags all words with soft hyphens (U+00AD). Soft hyphens should be ignored during spell checks!
● In hyperlinks it flags all file names, and the file extension “htm,” as misspelled.
All of my Web pages are cluttered with bogus spelling errors.
I looked at the DSpellcheck settings, but didn’t see an obvious way to prevent these false alarms. If I can’t get rid of them, I’m going to have to abandon DSpellcheck and un-install it.
Has anyone else run into these problems?
Notepad++ v8.6.7 (64-bit)
Build time : May 12 2024 - 20:04:00
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : OFF
OS Name : Windows 10 Home (64-bit)
OS Version : 22H2
OS Build : 19045.4412
Current ANSI codepage : 1252
Plugins :
ComparePlugin (2.0.2)
DSpellCheck (1.5)
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4) -
@Sylvester-Bullitt said in DSpellcheck:
In a line beginning <link rel=“stylesheet”, it flags the word “stylesheet” as misspelled
DSpellCheck does not have programming-language aware spelling files. It uses whatever dictionary you chose: if you chose a dictionary that does not know “stylesheet”, then you could just add that word to your custom dictionary. (But given your other complaints, see below for a better solution…)
In a line beginning <link rel=“stylesheet”, it flags the word “stylesheet” as misspelled, even though in the DSPellCheck settings I checked the boxes to check only comments and strings in code. As you know, the word “stylesheet” is an HTML standard.
In most programming languages, a “string” is something within single or double quotes.
rel="stylesheet"
sure looks likestylesheet
is in a string. And if I toggle that setting and Apply it, I get the results I expect:
vs
… that is, if the “Strings” option is on, then it checks spelling on attribute values; when “Strings” setting is off, then it ignores unknown words in attributes. However, whichever setting for that, it still properly spellchecks the content of the hypertext (
<tag attribute="value">content content content</tag>
)If you don’t want it to spell check HTML attributes, then tell it to not spellcheck strings.
It flags all words with soft hyphens (U+00AD). Soft hyphens should be ignored during spell checks!
That makes sense. I never use soft-hyphens myself, but I can see why you could make that argument that a soft-hyphen should be completely ignored, and the word should be spellchecked pretending the soft-hyphen wasn’t there. Plugins > DSpellCheck > About has a link to report an issue. You could request a feature there to enable ignoring soft-hyphens.
But while waiting for that to be implemented, you might try a workaround using the Plugins > DSpellCheck > Settings > Advanced: Copy the soft hyphen character, and paste it into the “Split words by non-alphabetic characters except” entry field, so that it treats words with a soft-hyphen as a single-word instead of splitting it into multiple. Then add a RegExp in the “Ignore Words” section – I tried
\w+\xAD\w+
(one or more word characters, the soft hyphen, then one or more word characters): that makes it completely ignore words that have the embedded soft-hyphenBut since it completely ignores them, it won’t spell-check them at all:
… that’s why I suggest you put in a request for it to pretend soft-hyphens aren’t there, because they shouldn’t be considered part of the spelling of a word.
On those same words, if you have the soft-hyphen in the “exception” list, but don’t define a RegExp, then it treats the soft-hyphen-containing as a single word, but it doesn’t have words with that character in its dictionary, so it calls “unbelieveable” misspelled when it has the soft-hyphen:
In hyperlinks it flags all file names, and the file extension “htm,” as misspelled.
Hyperlinks, like other attributes, are “strings” in the DSpellCheck definition of “string”. Again, if you don’t want it to spell-check attributes, turn off “strings”.
Has anyone else run into these problems?
I primarily focus on the DSpellCheck squiggles for plain-text files, and tend to ignore them in any code, except maybe in programming comments or strings (because when I’m coding, I often do want it to spellcheck the plain English in the comments and sometimes even in strings); but I guess I have enough of a mental filter that when I’m doing coding, I don’t mind the extra squiggle underline.
-
You’re right. Unchecking the “strings” box removed thousands of false alarms! Not only HTML attributes, but also file names in links. Would not have guessed that in a thousand years. The documentation needs to updated to explain that better.
I also found a way to ignore the soft hyphens. Though the interface should be updated to allow this, I manually added a line to the .aff file saying
IGNORE –
For now, I only have problems left to solve for DSpellCheck:
-
Can’t edit the dictionary to remove mis-spelled words which were accidentally added.
-
Can’t add a word to the dictionary if it has a right single quote (’) at the start or end.
-
-
@Sylvester-Bullitt said in DSpellcheck:
Would not have guessed that in a thousand years. The documentation needs to updated to explain that better.
We in the Community are just fellow users of Notepad++, as you well know. If you want a change in the DSpellCheck plugin’s documentation, I suggest creating an issue in the DSpellCheck repository.
I also found a way to ignore the soft hyphens. Though the interface should be updated to allow this, I manually added a line to the .aff file saying
IGNORE –
Thanks for sharing. My guess is that’s documented somewhere in the Hunspell library’s documentation, but I didn’t go looking for that library’s documentation – I am sure you have the internet search skills to find such a location.
- Can’t edit the dictionary to remove mis-spelled words which were accidentally added.
In the same folder as the
.aff
file you edited is presumably a.usr
with the same basename (I haveen_US.dic
,en_US.aff
, anden_US.usr
in that directory). The.usr
is the one where it stores the user-added words. Just delete those lines out of.usr
, and then restart Notepad++, and those words will no longer be in the user dictionary. (Might be able to do Plugins > DSPellCheck > Additional Actions > Reload Hunspell Dictionaries instead of restarting Notepad++.)- Can’t add a word to the dictionary if it has a right single quote (’) at the start or end.
I tried manually adding that to the
.usr
, but the word'tis
still didn’t show up as valid.Also, the advanced settings do have the
Ignore Words: ... ☐ That Start or End with '
option: but I couldn’t get it to accept'tis
even when I set that option. Unless someone else can tell us what we’re doing wrong, that’s something I suggest you report at the DSpellCheck issues list. -
Where does one find the DSpellCheck issues list?
-
@Sylvester-Bullitt said in DSpellcheck:
Where does one find the DSpellCheck issues list?
Um. I literally answered that a few posts above, where I said,
Plugins > DSpellCheck > About has a link to report an issue.
-
@PeterJones Ok, sorry. I missed that one.
Guess I need new glasses. Oops—I forgot: I don’t have glasses since my cataract surgery. Maybe I should have them re-install the cataracts! 8=)