[code] [textadept] Spell-check poll

From: Richard Philips <richard.philips.att.gmail.com>
Date: Mon, 31 Aug 2015 16:25:15 +0200

Hi Mitchell,

Last weekend, (on reacting to a question from Giovanni) I looked at my
spellchecking software (see: attachment)

I refactored it (crudely) but I think - with some work - it can be used.

The essence of the code is in:

function XSpell.server(lg)
  if not lg then return end
  if XSpell['_server'][lg] and XSpell['_server'][lg]:status() ~= 'running'
then
    XSpell['_server'][lg] = nil
  end
  if not XSpell['_server'][lg] then
    XSpell['_cache'][lg] = nil
    XSpell['_server'][lg] = spawn('hunspell -a -d ' .. lg, nil, nil, nil,
nil)
    if XSpell['_server'][lg]:status() ~= 'running' then
      XSpell['_server'][lg] = nil
      return nil
    end
    XSpell['_server'][lg]:read()
  end

  return XSpell['_server'][lg]
end

There is no need to link extra code: for everey language `lg`, I run a new
instance of the hunspell executable and let it handle the intricacies of
spelling.

[ the system can handle several languages at the same time, something I
need for work ]

Richard

Last weekend, (reacting on a question from

On Sunday, August 30, 2015, Mitchell <m.att.foicica.com
<javascript:_e(%7B%7D,'cvml','m.att.foicica.com');>> wrote:

> Hi,
>
> I've been experimenting with compiling hunspell (a spell checking library)
> directly into Textadept and think I've got something workable. The only
> potential problem is that the textadept executables grow in size by about
> 300k from ~850k to ~1.1MB.
>
> My question to you is: is this worth it? Is spell checking something
> particularly desirable to justify this size growth? (I'll also need to
> bundle a ~600K dictionary file for at least the Windows platform.)
>
> I don't want to use shared libraries or dll's because that complicates
> things on the Windows side. I also don't want to support shared linking on
> one platform and static linking on another. (Basically if there's any
> built-in spellcheck support, it needs to be available out of the box on all
> 3 platforms.)
>
> Please let me know if you have any thoughts or other comments. Thanks in
> advance.
>
> Note: this will not be in the upcoming 8.2 release.
>
> Cheers,
> Mitchell
> --
> You are subscribed to code.att.foicica.com.
> To change subscription settings, send an e-mail to code+help.att.foicica.com.
> To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
>
>

-- 
Richard Philips
<http://anet.be>
Bibliotheek UAntwerpen
Stadscampus - S.A.085
Prinsstraat 9 - 2000 Antwerpen
richard.philips.att.uantwerpen.be
T +32 3 265 49 71
<http://anet.be>

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 31 Aug 2015 - 10:25:15 EDT

This archive was generated by hypermail 2.2.0 : Tue 01 Sep 2015 - 06:40:08 EDT