[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    KSpell2 and some other things
From:       Zack Rusin <zack () kde ! org>
Date:       2004-03-30 5:57:51
Message-ID: 200403300057.51750.zack () kde ! org
[Download RAW message or body]

Ave,

so I got the basic port of kotext and kword to kspell2 finished.
http://www.automatix.de/~zack/kspell2_koffice.tar.bz2 for those who wish 
to test it out. As you'll notice it's mostly removing code from 
koffice.

In no particular order:
- why? because kspell, kospell and out of process spell checking sucks.
- kotext is pretty much finished. Here's what happening there:
 - kospell.h, kospell.cpp - these are pretty much new files which 
replace the older kospell.h, kospell.cpp completely. It's a completely 
different class implementing KSpell2::BackgroundChecker. The 
BackgroundChecker is a class in KSpell2 which performs all background 
checking (it's used by dialog and highlighter). Reimplementing that 
class is equal to reimplementing "QString getMoreText();" method which 
feeds the text to the background checker. KoSpell operates either on 
KoTextIterator of KoTextParag. 
 - kobgspellcheck.h, kobgspellcheck.cpp : here's what happens here since 
these have been also completely rewritten. kobgspellcheck uses KoSpell 
to perform the actual checking but it's aimed to be optimized for 
background checking in koffice. What happens is:
 - On startup the kobgspellcheck fetches a KoTextIterator for the whole 
text and feeds it to KoSpell which goes into background and checks the 
text. So user gets the control on the spot. What happens now is that if 
a user modifies text while the background checker is still checking 
text the paragraph is added to a cache in kobgspellcheck. As soon as 
the background checker goes over the whole document it starts poping 
KoTextParag's from the cache (the cache is unique so the parags are 
always there only once). KSpell2 checks about 1000 words a second on my 
1ghz pentium so  this thing is _really_ fast. If we'll decide that it's 
not enough it's not a problem whatsoever to add another KoSpell object 
to kobgspellcheck and divide checking into the two.
  - whenever a new kotextobject is created in the application the app 
should call kobgspellcheck::registernettextobject which lets 
kobgspellcheck listen for paragraph modified, created and deleted 
signals from kotextobjects. Once of those signals is catched only the 
relevant part of the text is checked.

And that's pretty much it.
What needs to be done before we'll be able to switch it:
- implementing kcmdialog for KSpell2. The idea is to allow all plugins 
(aspell, ispell and soon myspell and hspell) to have seperate 
configuration pages in the dialog.

What I'll be doing :
- finishing grammar checking interfaces. I'd like to adds Daniel's 
language tool to add the ability of some basic grammar checking to 
KOffice and KDE in general.
=======================================
One more thing. Last year we talked about scripting a little bit. Ian's 
is working hard on implementing a simple macro editor for me. Once I'll 
have that and I'll be happy with the way KSpell2 is working I'll start 
working on adding kjsembed support. 

I'll have final exams in four weeks and I'm finishing this semester in 
the first week of May so I'll be really busy in the coming month. 
Therefore the schedule is as follows:
1) KSpell2 in KOffice by the second week of May.
2) Ability to spell check one document in multiple languages by the end 
of May.
3) KoText with grammar checking infrastructure by the end of May.
4) Scripting done to show off on our conference in August.

Zack

-- 
If at first you don't succeed, skydiving is not for you 
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic