Spell Check: I can't get it to work at all!


#1

I can’t get spell check to actually do anything. With a misspelled word in a file saved with the .txt extension I don’t get any suggestions, can’t correct with Ctrl+Shift+; (also tried launching from command palate). I have red_wavy_underline installed and that doesn’t highlight anything.

From a suggestion I found in a similar question I tried moving ~/.atom/storage but this didn’t effect the spelling at all.

Does anyone have any idea what might be going on here?

Thanks in advance!

Atom version: 1.7.3
spell-check: 0.67.0

Config:

"*":
  core:
     disabledPackages: [
     "vim-mode"
     "ex-mode"
     ]
  editor:
     fontSize: 13
     softWrap: true
     softWrapAtPreferredLineLength: true
  "exception-reporting":
     userId: "<xxxxxxxxxxxxxxxxx>"
  "keyboard-localization":
      useKeyboardLayout: "en_GB"
   latex:
       viewerPath: "/usr/bin/epdfview"
  "spell-check":
       grammars: [
          "source.asciidoc"
          "source.gfm"
          "text.git-commit"
          "text.plain"
          "text.plain.null-grammar"
          "text.tex.latex"
      ]
   welcome:
      showOnStartup: false

#2

What platform are you on? Windows, Mac, Linux?


#3

I’m on arch linux


#4

On Linux, spell-check uses Hunspell. I don’t know if Arch installs that by default. One way to test is do this.

cd /tmp/
mkdir atom-spell-check
cd atom-spell-check
npm install spellchecker
echo "var spellchecker = require('spellchecker');" > run.js
echo "console.log(spellchecker.isMisspelled('bobz'));" >> run.js
node run.js

In theory, if everything worked, it would say true. But that assumes you have node and npm installed, which you may not. I’m not entirely sure how to access Atom’s version (I’m working from memory).


Spell checking not working despite all my efforts
#5

Thanks for your help!

I do have npm and node, and that returned “false”.

[EDIT]
It may also be useful to know that my package manager reports that I do have hunspell. I wondered if it could be a dictionary issue as I didn’t seem to have the english hunspell dictionary installed. However, after getting that package it doesn’s seem to have changed atom’s behaviour or the statement in your last post.


#6

I’m curious why that said false. “bobz” isn’t a valid English word. Now, it is suppose to use the packaged en-US dictionary that comes with spellchecker. That doesn’t seem to be working, which means it might be saying all words are not misspelled which would result in the behavior you are seeing.

One thing that you might try is making sure you have an appropriate dictionary, disable spell-check, and install spell-check-test. That is my sandbox for some proposed changed to spell-check which allows you to pick a Hunspell dictionary path and explicitly provide the locale (en-US for example). If that works, it would give me a better idea of what is failing.


#7

Your package works fine, I set the locale to en-GB and gave it the path of the hunspell directories (/usr/share/hunspell).

I also tried it with the US locale and that also highlighted incorrect spellings.


#8

You shouldn’t have to set the locale directories, /usr/share/hunspell is the first place I automatically check.

As for why it doesn’t work with the original, I’m not entirely sure. It might be your en-GB locale. The shipped version of spell-check isn’t aware of non-en-US domains and doesn’t always play well with other locales. I think there were a few issues on it, which is one reason why I’m proposing the spell-check-test code as a patch. I’m in the process of getting that accepted, so if you are willing to use spell-check-test for a while, hopefully I can that rolled in and you won’t have an issue.


#9

You’re right, it works fine without specifying the dictionary directory.

I’m more than happy to use spell-check-test for now, I’ve been using it all day and works fine. I look forward to it being rolled into the standard spell-check package.

Thank you very much for your help!


#10

Spell check not working on Mac OS.

I review your code and note that the path /System/Library/Spelling not exists on MacOS Sierra

“Locale paths” not working too. When I install hunspell with cs_CZ dictionary via macports and set correct path /usr/local/share/hunspell I got an error spell-check:cs-cz Can’t load cs_CZ: Cannot find dictionary for cs_CZ.