Skip to content

Spellchecker Investigation

Matthew Gramigna edited this page Oct 26, 2018 · 1 revision

This investigation was for Jira 1494: "Explore changing our editor's spell checker and investigate lift required for adding medical terminology"

Key Points

  • The spellchecker is not logic handled by Slate. There is only a boolean prop that is passed around that eventually gets set on a content-editable div
  • This means that the Slate spellchecker relies on the native browser spellchecker
  • I looked into modifying the words that are part of the dictionary that Chrome uses to do spellchecking

Modifying the Chrome Dictionary

I was able to add medical terms (e.g. "imatinib") go the dictionary used by Chrome so it no longer classifies them as misspelled words. The method of doing this is different for Mac and Windows.

Mac

Adding words to the dictionary on chrome places them in the file ~/Library/Spelling/LocalDictionary. We can add words to this file directly without having to go through Chrome. The syntax is one word per line with no quotes. Example:

# ~/Library/Spelling/LocalDictionary

wordone
wordtwo
wordthree

To get the changes to be saved, I had to restart my Mac. Now, "wordone" "wordtwo" and "wordthree" will be recognized as correctly spelled words in Chrome and added to the spellchecker.

Windows

Windows behaved differently than Mac in the sense that it did not modify any files on the disk, but rather stored the dictionary words in Chrome itself. Words can be added in the Chrome settings manually:

  1. In the settings page of Chrome, go to the "Languages" section and click on "Custom Spelling" image

  2. Add medical terms to the Chrome spellchecker: image

  3. Restart Chrome for the changes to activate

Clone this wiki locally