Exorcising KSpell

Zack Rusin zack at kde.org
Tue Feb 3 03:09:21 GMT 2004


On Monday 02 February 2004 00:43, Don Sanders wrote:
> Is the concept of filters compatible with QSyntaxtHighlighter? Does
> this address the issue of spell checking rich text documents?

That's the idea behind it. KSpell::Filter is the text feeder for 
KSpell::Dictionary. KSpell::Dictionary spellchecks only individual 
words (go figure). So if you want to check a whole buffer, the buffer 
has to be divided into individual words. That's the job of 
KSpell::Filter which decides what will be checked. KSpell::Dialog uses 
Filter::nextWord() and Filter::previousWord() (btw yes it's possible to 
go back in buffer while checking it in KSpell2) to move through the 
buffer. So it's pretty simple to write custom filters. KSpell2 provides 
right now KSpell::defaultFilter() which spellchecks simple text 
documents. I might also write a htmlfilter to spellcheck html 
documents, but technically it's always better when the application that 
wants to use kspell2 with some specified text format provides the 
filters (mainly because these apps already have parsers which know what 
state is the buffer at the given location, so by intefacing the 
specific filter with that parser one can get an incredible efficient 
spellchecking for custom documents).

> I'm due to think about KMail html editing and as-you-type spell
> checking this weekend. If possible I would like to deliver html
> editing with spellchecking for the separate kdepim release, (but I
> suspect it will be difficult).

Welll, as you can imagine it wouldn't be hard at all, but since the 
separate release of kdepim will be based on kdelibs 3.2 we really can't 
use it.

> Hmm, I believe on-the-fly spell checking is working correctly,
> reliably and performing well for the 3.2 release. At least I'm not
> experiencing problems with it (are you?).

Yeah, it's still acting up here. Mainly because we made it use way too 
small treshhold for errors in the automatic detection (it's virtually 
always off).

Zack

-- 
15% of the populace will never steal. 5% of the populace will steal 
almost anything not nailed down.




More information about the kde-core-devel mailing list