[PATCH] Hspell plugin for KSpell2

heiko.evermann at gmx.de heiko.evermann at gmx.de
Fri Apr 29 22:17:02 BST 2005


Hi Nadav,

> Why? What's wrong with C++ junkies knowing that this is a C library, and
> therefore they need to do
>
> extern "C" {
> #include <hspell.h>
> }
That is a valid point. You are definitely right. It might however be useful to 
add this as a comment to the header file. Something like "if you want to use 
c++, use hspell like this:
...
That would make it easier for those C++-junkies who do not know extern "C". I 
know that some years ago I didn't know either. So that little bit of 
assistance might prove to be useful and lead to less questions about hspell.

> This is a delicate issue. We understand this need, but also the opposite
> view also has merit; Our current implementation assumes that the user's
> personal dictionary should be handled by the calling program, NOT by
> Hspell. 
Well, I have some thoughts about that, that I would like to share with you.
> There are a number of reasons why we had this view: First, the 
> calling program, not the Hspell library, should be responsible for where
> this personal dictionary should reside. T
The application could tell hspell where to look for it. For example: the 
enchant broker has a function 
>Dict * request_pwl_dict (const std::string & pwl) 
that seems to have the meaning "open a private word list with the name...".

>The second reason is that a word processor (for example) would
> normally like to have a multilingual personal dictionary, and allow the
> user to view it to remove excess words or add words, etc. If Hspell handled
> Hebrew words, and some other library handled French words, the word
> processor won't have control over the entire list.
Well, why should the word processor need to have that control, when all the 
work is delegated to the libraries?

> But, we may reconsider this decision, especially if we understand more
> about the needs of spell-checking library users. Doesn't KDE keep its
> own list of correct words? Or does it assume that every spell-checking
> library keep its own list?
And now I want to make my most important point:
One main responsibility of a spell checker is to find similar words. If the 
work of a spell checker was just to check against a fixed word list then we 
would not have so many different spell checkers. Spell checkers differ in how
misspelled words are mapped to similar correctly spelled words and a spell 
checker is good at making useful suggestions, e.g. taking into account which 
letters have similar pronunciations or taking into account which misspellings 
might be common in a languag or taking into account which grammatical rules 
need to be checked for compound words or declination. I am pretty sure that 
this also applies for hspell and that hspell knows some tricks about 
misspelled Hebrew words that other spell checkers don't know. (If not, then 
why did anyone bother to write hspell in the first place?) 

And now I would expect that a user word list would be processed when looking 
for good suggestions for misspelled words. But how should KWord ever be able 
to do so without delegating this work to aspell, hspell etc. So there needs 
to be a way to tell hspell about where to find a user word list.

I think that this is a convincing argument. Or is there any other way to solve 
that problem in hspell without hspell being aware of a user word list?

Kind regards,

Heiko Evermann




More information about the kde-core-devel mailing list