6
$\begingroup$

Is there a tool for editing the spelling dictionary? Now that Mathematica 12 does spellchecking on the fly, I've been using it. And of course, as I was wondering how I might delete a word accidentally added to the dictionary, I accidentally added a misspelled word to the dictionary. I'm sure I can hunt it down and edit it by hand, but it seems safer to use a proper tool if one exists. Is there one?

$\endgroup$
  • 1
    $\begingroup$ Open the options inspector under edit->Preferences->Advanced, lookup SpellingDictionaries, edit the CorrectWords entry... $\endgroup$ – ciao May 14 '19 at 7:26
6
$\begingroup$

For removing a misspelled word from the correct word list, go to Edit->Preferences, select the Advanced tab, select Open Option Inspector, lookup/search for SpellingDictionaries, click on the edit button for the CorrectWords entry, highlight the incorrect entry and select remove.

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Apparently that change doesn't apply to the current session. At least that's what I experienced. $\endgroup$ – Steven Thomas Hatton May 15 '19 at 12:34
  • $\begingroup$ Can there be other hidden locations for accidental additions? Or does Mma actually recognize Euclidian (vs Euclidean) as a correct word, which just happened in my v.12. $\endgroup$ – Alan Aug 30 '19 at 22:48
  • $\begingroup$ @Alan Please see my answer. $\endgroup$ – Alexey Popkov Sep 28 '19 at 15:33
4
$\begingroup$

Answer by ciao shows a way to edit user-supplied list of correct words via GUI. The same can be done via setting $FrontEnd option:

Options[$FrontEnd, SpellingDictionaries]
{SpellingDictionaries -> {"CorrectWords" -> {}, "IncorrectWords" -> {}, "Suggestions" -> {}}}

The meaning of the sub-options is documented:

  • "CorrectWords"->{"word1",""word2"",...} means that if any word in the list is found during a spell check, it is skipped even if it does not exist in the main dictionary.

  • "IncorrectWords"->{"word1",""word2"",...} means that if any word in the list is found, the spell check stops, even if the word exists in the main dictionary.

  • "Suggestions"->{{"word1"->"newword1"},...} means that if any word in the list is found, the spell check stops and the corresponding new word is offered as an alternative in the Check Spelling dialog box.

Note that there is also the "IncorrectWords" option with rather strange documented meaning: "... if any word in the list is found, the spell check stops...". I would assume that the spell checking doesn't stop at such word but rather marks it as misspelled.


Can there be other hidden locations for accidental additions? Or does Mma actually recognize Euclidian (vs Euclidean) as a correct word, which just happened in my v.12.

Searching through all textual files in the directory

FileNameJoin[{$InstallationDirectory, "SystemFiles", "Components", "SpellingData", "SpellingDictionaries"}]

reveals that the whole word "Euclidian" is indeed present in the files "en_Supplemental.dic" and "ro_RO.dic" located in that directory. So it looks like the word "Euclidian" is indeed considered as a correct word by Mathematica's spellchecker because it is included in one of the basic dictionaries for English. We can try to add this word to the list of incorrect words via the "IncorrectWords" option:

SetOptions[$FrontEnd, SpellingDictionaries -> {"IncorrectWords" -> {"Euclidian"}}]

Unfortunately it doesn't have any effect: even after restarting Mathematica this word isn't marked as misspelled. I would consider this as a bug.

P.S. It is also interesting that this word is present in the file

FileNameJoin[{$InstallationDirectory, "SystemFiles", "Components", "OpenPHACTS", "Kernel", "OpenPHACTS.m"}]

UPDATE1. I've moved the file "en_Supplemental.dic" outside of the $InstallationDirectory and then restarted Mathematica. After the restart the word "euclidian" is still considered as correctly spelled. So there seems to be some other place from where the spellchecker takes it...

UPDATE2. The word "Euclidian" is so well-protected that even setting the language of spell checking to Russian doesn't affect it: now all usual English words are marked as misspelled including the word "Euclidean" but excepting the word "Euclidian":

screenshot

UPDATE3. Searching for the word "euclidian" in the all files in the $InstallationDirectory (including binary files) reveals that it is present in the following files:

FileNameJoin[{$InstallationDirectory,"Documentation","English","Index","_e.cfs"}]
FileNameJoin[{$InstallationDirectory,"Documentation","English","SearchIndex","2","_1.cfs"}]
FileNameJoin[{$InstallationDirectory,"Documentation","English","SpellIndex","_19s.cfs"}]

Especially suspicious is the file in the directory "SpellIndex". But even moving this directory outside of $InstallationDirectory and restarting Mathematica doesn't change the described behavior...

UPDATE4. The Entity framework considers the words "euclidean" and "euclidian" as synonyms:

Entity["Word", "euclidian"]@EntityProperty["Word", "SynonymsList"]
Entity["Word", "euclidean"]@EntityProperty["Word", "SynonymsList"]
{"euclidean"}

{"euclidian"}
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.