How to use this feature? Is there a configuration option to choose an alternative backend?
The answer to that question is a bit complicated, so let’s take an example.
plugins and providers
On my machine, the
enchant library was built with the following plugins:
Each plugin implements a provider. In this case, Enchant was built with
voikko plugins, so it can use dictionaries coming from those
Now let’s assume you have these packages installed:
aspell-en : Aspell dictionary for English
aspell-fi : Aspell dictionary for Finnish
voikko-fi: Voikko dictionary for Finnish
Enchant has to decide which package to use when spellchecking a Finnish
document - and there are two possible answers here (
In order to solve this, Enchant uses a file named ordering that looks like this:
voikko is the first provider listed on the
fi line, it will use
In short, it is Enchant’s job to determine which provider the most suited
for the requested language, not the end user. In that case it makes sense, since
voikko is a provider dedicated to the Finnish language.
But what if you really want to use
forcing the aspell provider
Well, the first option is to use the
set_ordering method on the broker object:
>>> from enchant import Broker
>>> broker = Broker()
>>> broker.set_ordering("fi", "aspell,voikko")
>>> fi_dict = broker.request_dict("fi")
kak-spell never uses the
set_ordering method on the broker object, so this won’t work
But before implementing something like a
kak_spell_ordering option, I should point out there’s a much easier solution to the problem at hand: just remove the
voikko-fi package from your system!
I hope this clarify things - for now I think that implementing
is overkill, unless there’s something about your use case I’m missing.