[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: RFP: Enchant Spell Checker



Hi Zack,

> I'm just checking out the code. The idea is great. I
> have a few 
> questions if you don't mind:

Not at all.

> 1) From my quick look at enchant++.h and
> understanding of the initial 
> goal - backends are completely abstracted and
> there's no way to set one 
> specific using enchant++.h api. For some languages
> dictionaries in 
> ispell are more comprehensive than in aspell. I was
> wondering how, if 
> at all, Enchant handles the situation of one spell
> checker having a 
> more complete set of words than the other.

Well, firstly, I'm not entirely happy with
enchant++.h. The authoritative header is enchant.h -
just for the record. I'd like to redo this. Plus it's
a little out of sync with the enchant.h file's
capabilities.

Enchant uses the first spell checker backend that
claims to support a given language. That said, you can
provide an ordering suggestion. It takes the form:

*:aspell,ispell,myspell
en_US:ispell,aspell
de_DE:myspell,ispell

Which is to say:

language_TAG:provider1,provider2,providerN

with no spaces between providers and the commas (I got
lazy writing my parser - this can be fixed later). The
'*' tag is a shortcut. It means "apply this ordering
to all languages not explicitly set in the ordering
file."

If such an ordering exists, the dictionary request
broker iterates through your suggested provider list
for the given language tag. It matches the provider's
name with a plugin that advertizes said name. If said
provider doesn't support the language tag, it moves on
to the next provider in the ordered list until it
finds one that does, or exhausts the ordering list. If
a match ultimately doesn't exist, it uses the first
provider it can find that supports said language.

> 2) Related to #1 : if it Enchant checks multiple
> backends for 
> suggestions what happens if one marks a word as
> misspelled (e.g. lack 
> of it in the dictionary), and the other says it's
> spelled correctly?

Enchant uses the first backend it finds (according to
the ordering rules above) that claims to support a
given language. It does not compare, merge, or
otherwise negotiate results across various backends.

> 3) Is there a preference as to which backends are
> checked first?

If you specify an ordering, yes, as per the above
rules. If not, it's "implementation specific", which
in this case means "in whatever order GDir returns
directory entries."

The ordering files are:

$prefix/share/enchant/enchant.ordering
~/.enchant/enchant.ordering

The private one takes precedence. It is an overlay of
the globally installed one. So that if the global file
is this:

en_US:foo,bar
fr_FR:bar,foo

and the local file is this:

*:foo,bar,baz
en_US:bar,foo

The ultimate result would be:

*:foo,bar,baz
en_US:bar,foo
fr_FR:bar,foo
 
Best regards,
Dom

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]