Re: Grammar Checking

From: <msevior_at_physics.unimelb.edu.au>
Date: Fri Sep 03 2004 - 00:49:40 CEST

> There are some cases in which the existing proofer in Word will green
> underline just one word or short phrase. If we go with this idea, which
> I still like anyway, we would have to provide a way for the checker to
> be invoked just on that instance or a small area, so that large
> documents do not have to be fully checked in order to find out
> information about the proofing results of one sentence.
>

Conceptually, an on-the-fly grammar checker would work pretty much the way
our spellchecker works.

Modified pointers to modified blocks are placed in a queue which checks
them in a background timer. Blocks are the ideal level of granuality for a
grammar checker as we can be sure the user meant them to consist of one or
more sentences.

The main difference between how the spell-chcker works and how the grammar
checker works is that for the grammar checker we should not check the
block while the caret is in the paragraph since in the process of
constructing the text, sentences will neccessarily be grammatically
incorrect. Once the caret leaves the paragraph we can grammar check it.
This actually makes implementing on-the-fly grammar checking easier. We
can do this check (is the caret in the block examined with a very very
simple check).

if( pBlock->getPosition() <= pView->getPoint() && pView->getPoint <=
pBlock->getPosition() + pBlock->getLength())
{
// caret is in, come back later
}
else
{
//
// caret is out, grammar check me!
//
}

In fact the more I think about it the easier the on-the-fly thing is. It
prolly easier than the phase one technique I talked about before.

Of course this assumes we can steal/borrow/implement a high quality
grammar checking piece of code.

Hmm /me is getting ichy fingers...

Cheers

Martin
Received on Fri Sep 3 00:35:24 2004

This archive was generated by hypermail 2.1.8 : Fri Sep 03 2004 - 00:35:24 CEST