POW: Get ispell working


Subject: POW: Get ispell working
From: Dom Lachowicz (cinamod@hotmail.com)
Date: Mon Apr 23 2001 - 22:58:20 CDT


I have this feeling that no one cares about Applix, but in case this
interests someone, here's another suggested POW:

The next release of AbiWord is *not* getting released until ispell support
works at least as well as it did before. Preferably, we'd like it to work as
well as the pspell class.

So the important question is "what needs to be done?"

Well, as it stands, ispell is a horrible mess. It utilizes some 20-30 global
variables and has a bunch of functions that take very few arguments.

So, what to do? Well, if you look at ispell_checker.cpp, you'll see a
section called "reduced globals." What you'll want to do is turn this into a
struct probably containing all of those global vars. You'll then want an
instance of this Ispell_var_t struct in your ISpellChecker class.

Now, ispell defines an interface of about 10 or so functions that utilize
these variables. We'll want to:

1) rename *.c -> *.cpp
2) Pass an instance of this Ispell_var_t from our ISpellChecker class to
each one of these functions (they can remain functions, there's no need to
make them into a class, unless you're feeling really ambitious).

So, now we have a stateful version of ispell. This is a GOOD THING (tm).

Now, the final bit is to map our language tags to ispell dictionaries. So
"en-US" -> AbiSuiteLibDir->dictionary/american.hash, "de-DE"-> german.hash,
etc... you should be able to do with a lookup table here. These path names
get passed to the linit() function, which loads the ispell hash file into
memory.

That should just about do it. Then ispell *should* work just about as well
as pspell, at least for our purposes. It's not conceptuall hard, just a bit
of work.

Good luck! Please someone ZAP this ASAP!!!

Dom
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com



This archive was generated by hypermail 2b25 : Mon Apr 23 2001 - 22:58:24 CDT