kspell2 reorganization

Zack Rusin zack at kde.org
Mon Apr 10 17:09:41 BST 2006


On Monday 10 April 2006 14:00, you wrote:
> Any objections? I'll proceed with the move otherwise (tomorrow I
> guess).

I have a more of a observation than an objection here. 
There has been a number of problems with KSpell2 as it is. Two main ones 
is that 
a) it's a little hard to understand (e.g. does the Dictionary::check() 
method return true or false if the word is misspelled?)
b) it tries to do too much

Oh, and just to be clear it's not that I don't want to maintain, it's 
just that I don't agree with some of the commits and simply don't like 
to play the "revert-commit" ping-pong game so I kinda left it for 
others. 

I did create Sonnet 
https://user@svn.kde.org/home/kde/branches/work/kde4/playground/libs/sonnet
Which is more of a pet project of mine than anything else. I never got 
to announce it, so here it is.

Sonnet is a collection of linguistic tools for use with any Qt4 based 
application/library. It's going to be composed of seven small 
libraries:
- spell checking
- grammar checking
- thesaurus
- text segmentation
- language recognition
- dictionary
- translator
In KDE SVN. The spell checking plugin is basically in the state in which 
I'd expect it to be, if I kept working on KSpell2. 

In my experience spell checking library should do just that - spell 
checking. Text segmentation (KSpell2::Filter) and so on do not belong 
there and make it rather difficult to see how things work. Doesn't mean 
they couldn't be build as part of the same so, but then the name of 
that .so should reflect it's real purpose.

Porting from the KSpell2 to Sonnet is basically trivial. KSpell2::Broker 
is in Sonnet QSpell::Loader (again because in my experience it's a lot 
more comfortable term for non-native speakers and reflects it's purpose 
a lot better). KSpell2::Dictionary class is not QSpell::Speller 
(because Sonnet has an actual Dictionary class that, suprise, suprise, 
you can use to lookup word definitions) and the 
KSpell2::Dictionary::check method has been converted to 
QSpell::Speller::isCorrect, Speller::isMisspelled methods. The spelling 
library in Sonnet has also a new plugin: Enchant. And it removes the 
ispell plugin which never worked. Enchant plugin if available is the 
default one currently. (The QSpell should really be replaced by Sonnet 
but I wrote QSpell before I decided to go all out with Sonnet).

Sonnet doesn't have a KDE  or GUI dependency at the moment at all (all 
it depends is QtCore and QtNetwork). 

Now, would it make sense to use Sonnet or at least QSpell for KDE4 
instead of KSpell2? I sure think so. Otherwise I suggest the people who 
have been committing to KSpell2 to go to Sonnet/spelling and just steal 
all the changes I did there. 

Zack


-- 
Elvis is dead, Mozart is dead, Einstein is dead, and I'm not feeling so
great myself.




More information about the kde-core-devel mailing list