[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [seul-edu] spell checker logic -- comments please



On Tue, Nov 09, 1999 at 09:48:05AM +0100, Bill Tihen -- TECHNOLOGY wrote:
> o split the message into an array of words.
> 
> o send each word to ispell using something like:
>            echo word | ispell -a
> (how to you verify nothing evil gets passed to the
> commandline? - I assume an echo is fairly safe and then
> it gets passed to echo which will only process it as
> text anyway)

I imagine ispell should be able to deal with all the words at once
in some sort of noninteractive mode.  This would be much, much
faster and efficient than one-by-one.  spell(1) is one such non-
interactive frontend to ispell.  You can make a temporary file,
run some form of ispell, parse the result (mostly, just make it
an array)... if you wanted to be fancy you could figure out a way
of getting spelling guesses, but I think it will be quit functional
without.  It might work to give the user a spell-check page where
misspelled words are replaced with text-input forms (by default, 
filled with the original word).

> o store the result of ispell in an array
> 
> o Generate an new webpage with the array of misspellings
> arrainged in pull down menu and some correction options.
> 
> o display the original  text at the bottom of the page
> with mispellings highlighted.
> 
> o wait for the user to choose the corrections and
> resubmit the work to the spell checker until done is
> chosen.
> 
> o send the corrected data back to the original textarea
> that was spell checked on the original html screen.  How
> do you update an html screen?  Do you destroy the
> original and create a new one just like it?

Just regenerate the form input screen, this time with the
value preloaded.  This means you have to keep track of a
fair amount (all the non-spellchecked options, in particular)
but I can't think of any other ways.  Maybe JavaScript could
do the updating if you spawned a new page for the spellcheck,
but I'm unclear about making contact in JavaScript between
different browser windows.  If you're interested in doing
it that way, I could look into how JavaScript might do that.


---------------------------------------------------------------------
| Ian Bicking                 |  bickiia@earlham.edu                |
| 4869 N. Talman Ave. Apt. G  |  http://www.cs.earlham.edu/~bickiia |
| Chicago, IL 60625           |                                     |
---------------------------------------------------------------------