Hunspell interface for SciTE under Linux

111 views
Skip to first unread message

zetah

unread,
Apr 7, 2012, 8:36:13 PM4/7/12
to scite-i...@googlegroups.com
I wanted to add spell-checking to SciTE somehow
  1. I first found obvious result: luahunspell which works on Windows. Could it work on Linux by wrapping this tiny luahunspell.cpp file around Hunspell and SciTE source is impossible task for me as I don't know C
  2. I then found luaspell on GitHub, and additionally luascript for TextAdept (Scintilla based editor) but it's not very obvious how to "port" it to SciTE
  3. I found scite+hunspell project on SourceForge, and huge patch for SciTE 2.01 which I managed to apply on current hg version, with one issue: changes in respect to class Accessor makes it hard to figure what next:

  ../src/HunspellWrapper.h:62:56: error: ‘Accessor’ has not been declared
  make: *** [SciTEGTK.o] Error 1

which points to:

  virtual bool OnStyle(unsigned int p, int q, int r, Accessor *s);

Accessor.h was moved from ./scintilla/include/ to ./scintilla/lexlib/ and if I include it in makefile it doesn't solve the problem, so I stopped here.

Can someone help make working spell-checker under Linux by any project available?

Thanks

zetah

unread,
Apr 10, 2012, 2:43:22 AM4/10/12
to scite-i...@googlegroups.com

Here is moderate alternative, until a more skilled user provides better: http://paste.pocoo.org/raw/578815/

It's a Lua script that uses SciTE strip feature and does not use extman script. It works on selection (if there is any) or on whole document, by calling Aspell in ispell mode and processes output to Lua table, then all misspelled words are underlined and strip dialog pops and traverses through misspelled words:



Words can be added to dictionary if there is appropriate file in user's home folder, which should be changed to desired language. Similarly desired language can be set by adding dictionary to aspell io.popup command line.

"sed" intervention is because there is bug in aspell ispell mode, and it does no harm otherwise. I could've used hunspell, but perhaps there is yet other bug which makes it unnaturally slow in ispell mode.

Known issue: if user presses Escape on strip dialog, indicators are not cleaned, cleaning is done by Cancel button or if traversing ends

zetah

unread,
Apr 10, 2012, 3:04:07 AM4/10/12
to scite-i...@googlegroups.com

It works on selection (if there is any) or on whole document, ...

on selected lines, not on arbitrary selection which does not start on line start.

I'll post perhaps update, when I play enough with the script

zetah

unread,
Apr 10, 2012, 7:55:52 AM4/10/12
to scite-i...@googlegroups.com
On Tuesday, April 10, 2012 9:04:07 AM UTC+2, zetah wrote:

I'll post perhaps update, when I play enough with the script

I corrected script to work on arbitrary selection and I uploaded it here: https://github.com/klonuo/scite-strip-spell
Reply all
Reply to author
Forward
0 new messages