View Single Post
Old 07-22-2015, 09:36 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,837
Karma: 6120478
Join Date: Nov 2009
Device: many
Hi,

Is it just the user words and Hunspell dictionaries (.affl, .dic) files you want?
If so, you could read and parse them by a python script from the user's Preferences location (or shared dictionary location on Linux).

Or do you want to do actual spell checking?

If you want to do actual spell-checking, that would be much more difficult.
The plugin interface simply passes information about the currently open book location to a python environment and so is not a bi-directional call interface.

The python environment can manipulate the files and then creates an XML response telling the Sigil C++ environment which files it needs to copy or change.

Spell checking inside the Sigil app is done via a HunSpell interface. The easiest way for you to use HunSpell inside a python plugin would be to either find a Hunspell Python interface package (see the Python Package Index) (or a pure python spell-checker and then get permission to include it in your plugin OR use python "ctypes" calls to access the HunSpell dynamic library version that comes with Sigil.

KevinH

Quote:
Originally Posted by CalibUser View Post
I need to access the spelling dictionaries (default and user ones) in a plugin that I intend to produce.

How can I access the words in these dictionaries in a plugin?

Thanks.
KevinH is offline   Reply With Quote