Sublime Forum

ST2 & 3, OSX: CheckBounce, a spell-check plugin

#5

Hi,
I’m very interested by this plugin but I can not find it in the “package control : install packages” list … so, stupid question : how can I install it ?

0 Likes

#6

[quote=“GerardLambert”]Hi,
I’m very interested by this plugin but I can not find it in the “package control : install packages” list … so, stupid question : how can I install it ?[/quote]

You can either clone it from the Github repository into your Sublime packages directory or use the “↓ZIP” link to download it as a zip file. If you download the zip, be sure to rename the folder that’s extracted from “CheckBounce-master” to “CheckBounce” before dropping it in with your packages.

0 Likes

#7

thanks for your answer ! I installed it and now I have probably other stupid questions :smile:
I have an unknown word and when I right click on it, I still have the suggestions for the default SpellCheking plus the classic “ignore XXXX” but I know also have three more options
“Ignore Word”
“Add Word to dictionnary”
“suggest corrections”

I click on “Add Word to dictionnay” (that is the main reason I want to try your package) but nothing happens : the word stay underlined … Did I do something wrong ?
thanks

0 Likes

#8

up ?

0 Likes

#9

[quote=“GerardLambert”]thanks for your answer ! I installed it and now I have probably other stupid questions :smile:
I have an unknown word and when I right click on it, I still have the suggestions for the default SpellCheking plus the classic “ignore XXXX” but I know also have three more options
“Ignore Word”
“Add Word to dictionnary”
“suggest corrections”

I click on “Add Word to dictionnay” (that is the main reason I want to try your package) but nothing happens : the word stay underlined … Did I do something wrong ?
thanks[/quote]

Hi there,
Sorry it took me a while to see this. In the last version, the underline stays there until you edit the document again. Just keep typing after you add a word to the dictionary and it should disappear from all over the file. (And everywhere else in OS X: “Learn” uses the global spelling dictionary, whereas “Ignore” is document- and session-specific.) I’m almost done with a new version that’s much less of a resource hog and includes some nifty new features; hopefully I’ll be able to fix that kludge as well.

0 Likes

#10

[quote=“GerardLambert”]thanks for your answer ! I installed it and now I have probably other stupid questions :smile:
I have an unknown word and when I right click on it, I still have the suggestions for the default SpellCheking plus the classic “ignore XXXX” but I know also have three more options
“Ignore Word”
“Add Word to dictionnary”
“suggest corrections”

I click on “Add Word to dictionnay” (that is the main reason I want to try your package) but nothing happens : the word stay underlined … Did I do something wrong ?
thanks[/quote]

Just pushed to Github a new version that’s faster, less of a resource hog, and able to refresh itself after a word is added or ignored so that the error disappears immediately. It’s fully compatible with ST2 and ST3 as of the evening of April 5th.

0 Likes

#11

Hi! I have a question. When I place the renamed CheckBounce folder in Packages, nothing really happens. I have the settings under Preferences added, and to be sure I copied the CheckBounce.sublime-settings content into the user specific settings file. I’m on Sublime Text 2. If I have the ST2 spell-check disabled, absolutely nothing happens (I have tried writing the weirdest words…) and with ST2 spell check on no other options are available when I right-click the words. Any idea what’s wrong? Thanks in advance!

0 Likes

#12

“When I place the renamed CheckBounce folder in Packages” implies that there is already another CheckBounce folder with a different name. Hopefully, you just have one (1) CheckBounce folder. Obviously, you would not want more than one version of the same plugin running simultaneously. As long as the CheckBounce folder is in the Packages directory, you can call the folder “holene” instead of CheckBounce if you want to. When the Sublime Text application opens, check the python panel shell console to see if there are any errors loading any plugins – if everything is okay, you should see the python plugins from CheckBounce loading on startup without any issues reported. Do that, and then report back.

0 Likes

#13

The reference to the renamed CheckBounce folder was that you instruction to remove the “-master” part of the name in “README.mdown” :wink:

Anyhow; the output from the console on start-up seems legit to me:

theme loaded app ready pre session restore time: 0.562632 using gamma: 2 (err: 6.9282) Loading dictionary Packages/Language - English/en_GB.dic wrote startup cache, added files: 58 orphaned files: 0 total files: 167 cache hits: 109 startup time: 1.286 (package setup was not run) loaded 860 snippets Package Control: No updated packages

But I still lack spell check unless I turn on (F6) the internal ST2 spell check (which of course is what we don’t want) …

0 Likes

#14

There are a couple of things you may want to try. First off, I’d recommend updating to the latest commit, which I pushed about an hour ago; it adds (optional) grammar checking and makes it easier to turn the package on and off in individual views (see the updated README for more info). Next, make sure you’re trying to use either one of the built-in whitelisted syntaxes—LaTeX, Markdown, and Plain Text—or one that you’ve added to the settings yourself. If you’ve added a new syntax on your own, be aware that you want it to match the scope selector, not the name of the .tmLanguage file.

The most likely cause is that I published a revision-in-progress to Github too early and you happened to get a buggy edition—a terrible habit of mine. I’ve tested the version that’s now on Github in both ST2 and ST3 for at least a solid hour or two each, and haven’t encountered any problems. So you may want to see if you have better luck with this commit. Sorry for the inconvenience, though, and please let me know if you continue to encounter trouble.

0 Likes

#15

Hey again!

I’m testing in LaTeX, Markdown, Text and tried to add “MATLAB” (“matlab” and “source.matlab”, what does define scope selector for the different languages?) as well, without much success. I downloaded the new latest commit, and added to Packages. The python console output is reporting some errors:

Reloading plugin /Users/holene/Library/Application Support/Sublime Text 2/Packages/CheckBounce/act_on_word.py Traceback (most recent call last): File "./sublime_plugin.py", line 62, in reload_plugin File "./act_on_word.py", line 8, in <module> from spellchecker import SpellChecker File "./spellchecker.py", line 179 sublime.status_message('Learned "{0}."'.format(word)) ^ IndentationError: unexpected indent Reloading plugin /Users/holene/Library/Application Support/Sublime Text 2/Packages/CheckBounce/autocorrect_listener.py Traceback (most recent call last): File "./sublime_plugin.py", line 62, in reload_plugin File "./autocorrect_listener.py", line 10, in <module> from spellchecker import SpellChecker File "./spellchecker.py", line 179 sublime.status_message('Learned "{0}."'.format(word)) ^ IndentationError: unexpected indent Reloading plugin /Users/holene/Library/Application Support/Sublime Text 2/Packages/CheckBounce/background.py Traceback (most recent call last): File "./sublime_plugin.py", line 62, in reload_plugin File "./background.py", line 14, in <module> from spellchecker import SpellChecker File "./spellchecker.py", line 179 sublime.status_message('Learned "{0}."'.format(word)) ^ IndentationError: unexpected indent Reloading plugin /Users/holene/Library/Application Support/Sublime Text 2/Packages/CheckBounce/check_contextual.py Reloading plugin /Users/holene/Library/Application Support/Sublime Text 2/Packages/CheckBounce/const.py Reloading plugin /Users/holene/Library/Application Support/Sublime Text 2/Packages/CheckBounce/spellchecker.py Traceback (most recent call last): File "./sublime_plugin.py", line 62, in reload_plugin File "./spellchecker.py", line 179 sublime.status_message('Learned "{0}."'.format(word)) ^ IndentationError: unexpected indent found 10 files for base name Default.sublime-keymap found 33 files for base name Main.sublime-menu

0 Likes

#16

Strange thing about that is, that’s not what’s on line 179. I’d recommend, just to be certain, that you quit Sublime, delete the whole “Packages/CheckBounce” folder, copy in the Github version, the restart Sublime, just to be certain none of the compiled Python files ST2 generates are lingering behind and confusing it. I just did this with my copy of ST2, after double-checking that the code on Github was up-to-date and uncorrupted (as of the commit from 7 hours ago), and it seemed to run okay. Let me know if that works any better!

0 Likes

#17

thanks for the answer I updated to the new version … I still have questions …

  • Do I need to switch off the default spell tools ? I’m using ST2 and when a word is unknown I have a red underline under it AND a red box around it … when I do “add word to dictionary” only the red box disappears (not the red underline).

  • can I change the dictionary (for the default spell I have 3 : en_GB, en_US and french) ? when I do so I’m not sure to really understand what happens with your package but it does not seem to work we;;

  • I do not manage to toggle of the spell cheking by CheckBounce (I did it through the palette but the red boxes are staying … even when I edit the document etc…)

[quote]Traceback (most recent call last):
File “./spelling_background.py”, line 103, in
File “./spelling_background.py”, line 93, in reassign
File “./spellchecker.py”, line 71, in remove
AttributeError: ‘NoneType’ object has no attribute ‘clear’
Traceback (most recent call last):
File “./spelling_background.py”, line 103, in
File “./spelling_background.py”, line 93, in reassign
File “./spellchecker.py”, line 71, in remove
AttributeError: ‘NoneType’ object has no attribute ‘clear’[/quote]

  • If I did “add word to dictionary” by mistake, can I reverse it and suppress the word from the dictionary ? related: where are the added words saved ?

  • small remark: when I right click on a bad word , If the cursor is not on the word your package does not work (but the default spell does 0 : I can to ignore word but not add word to dictionary … I first have to click on it then I can right click …

0 Likes

#18

To take your questions in order:

  • This package does not integrate with Sublime’s built-in spell-checker, so you’ll get the best results if you only use one at a time. I don’t have any plans to do anything as elaborate as modify Sublime’s dictionary files based on the spelling results from CheckBounce.

  • Again, no integration with the built-in checker, so changing the dictionary files Sublime looks at won’t do anything for this package. OS X’s built-in spelling system is designed to automatically identify a document’s dominant language, however, and it seemed to work reasonably well in the limited testing I did, picking up on—and suggesting corrections for—German and French.

  • I’ll look into this later today and post an update to Github tonight.

  • OS X stores its learned words in ~/Library/Spelling, I believe, and I think you can edit the file that’s there if you really want to. Though I’ve never tried.

  • Since I don’t think there’s a way to capture mouse-down events, I think this is just how Sublime has to work.

0 Likes

#19

[quote=“GerardLambert”]thanks for the answer I updated to the new version … I still have questions …
[/quote]

I’ve just pushed an updated version that should address your problem with toggling the checker on and off. Give it a shot and let me know how it works.

0 Likes

#20

I downloaded the new update, and it now works! Thanks =)
Is there an exception-file for language syntax, or may I make one? For instance when you write LaTeX you wouldn’t want the spellcheck to react to \textsc etc.

0 Likes

#21

It is not syntax specific, but is easy to edit:

/Users/HOME/Library/Spelling/LocalDictionary

0 Likes

#22

[quote=“holene”]I downloaded the new update, and it now works! Thanks =)
Is there an exception-file for language syntax, or may I make one? For instance when you write LaTeX you wouldn’t want the spellcheck to react to \textsc etc.[/quote]

[quote=“lawlist”]It is not syntax specific, but is easy to edit:

/Users/HOME/Library/Spelling/LocalDictionary[/quote]

Yup. There’s no way that I can see for me to feed words to the OS X spell-checker on a per-syntax basis, unfortunately. Adding the commands to the checker’s local dictionary is your best bet.

I’ve picked up some problems with the keystroke commands, so please bear with me as I try to work out the bugs. I have some other work to do tonight, but expect to be able to devote some time to it this weekend.

0 Likes

#23

[quote=“phyllisstein”]To take your questions in order:

  • This package does not integrate with Sublime’s built-in spell-checker, so you’ll get the best results if you only use one at a time. I don’t have any plans to do anything as elaborate as modify Sublime’s dictionary files based on the spelling results from CheckBounce.

  • Again, no integration with the built-in checker, so changing the dictionary files Sublime looks at won’t do anything for this package. OS X’s built-in spelling system is designed to automatically identify a document’s dominant language, however, and it seemed to work reasonably well in the limited testing I did, picking up on—and suggesting corrections for—German and French.

  • I’ll look into this later today and post an update to Github tonight.

  • OS X stores its learned words in ~/Library/Spelling, I believe, and I think you can edit the file that’s there if you really want to. Though I’ve never tried.
    [/quote]

Thanks for your answer, I downloaded the new update and it seems to work better. I still had some problems with the toggle on/off which does not seem to always work but I did not identify a specific context in which it fails (sorry)

One question about the grammar checking : is there a way to have a clue about why a specific sentence is green boxed ?

ah that’s too bad … the standard “spell-checking” manage to work that way (even if the cursor is not on the word I can right click on the word). I think there is two point that will prevent me to use the package for now (even I am really looking for the “add word to dictionary” functionality)

  1. the fact that I have to click on the word before right-clicking
  2. the fact that once I right click, I do not have directly the suggestions (like in standard checkspelling) but there is one more step rightclick -> suggestcorrections -> suggestions

PS : Maybe my two remarks will be obsolete if I get used to the keyboard shortcuts …

0 Likes

#24

[quote=“GerardLambert”]
Thanks for your answer, I downloaded the new update and it seems to work better. I still had some problems with the toggle on/off which does not seem to always work but I did not identify a specific context in which it fails (sorry)

One question about the grammar checking : is there a way to have a clue about why a specific sentence is green boxed ?

ah that’s too bad … the standard “spell-checking” manage to work that way (even if the cursor is not on the word I can right click on the word). I think there is two point that will prevent me to use the package for now (even I am really looking for the “add word to dictionary” functionality)

  1. the fact that I have to click on the word before right-clicking
  2. the fact that once I right click, I do not have directly the suggestions (like in standard checkspelling) but there is one more step rightclick -> suggestcorrections -> suggestions

PS : Maybe my two remarks will be obsolete if I get used to the keyboard shortcuts …[/quote]

I agree that having to click on the word isn’t optimal. I’ll post a feature request for some kind of on_mouse_down event, but John being a busy man and all, I can’t guarantee that it’ll be implemented. The grammar checker should show information about the error in the status bar when the cursor is within an error region, but I warn you that OS X’s grammar checker isn’t too astute, and so it’ll often be something like “Consider using – or — instead of – or —” (super-annoying if you’re writing in LaTeX) or “The word ‘foo’ may not agree with the rest of the sentence,” sans any explanation why.

I’m going to really dig into the thing this weekend and see if I can’t resolve the issues with toggling and a few other lingering bugs. FYI, most of the package’s features are working rather better in Sublime Text 3 than in ST2, I suspect because ST3 is better at handling complex threading.

0 Likes