jgarber / dvorak-typing-tutor

1 stars 0 forks source link

Accurate and adaptive error highlighting #10

Closed jgarber closed 12 years ago

jgarber commented 12 years ago

I'd like the SCAYT functionality to highlight only words that are mis-typed (don't match exact, case-sensitive letters or punctuation). By word, I mean anything separated by spaces.

I'd like it to check the whole document every time, so if you delete several words or even all the text in the box, it will continue to error check correctly.

I'd also like it to be able to adapt to missing/extra spaces. So if I miss a spaceor add an ex tra space while typing, subsequent correct words won't be marked as errors. Maybe I'm over-engineering it, but I think it'll need to use the McIlroy-Hunt longest common subsequence (LCS) algorithm. Unless you have a better idea. I found a JS implementation of it, but no idea how good it is: http://www.lshift.net/blog/2006/08/15/diff-for-javascript

Multiple spaces or returns where only one is required should not cause any errors.

Gonzih commented 12 years ago

So you are saying that SCAYT should check and highlight words (anything separated by spaces) and after that you are saying that extra spaces and miss of space are not errors. So how exactly should it works?

That what I'm thinking:

1) Get content, strip all html tags, extra spaces, EOL characters, etc. 2) Get current lesson, join all phrases using space character. 3) If our 2 strings are equal then there are no errors in text, otherwise: 4) make diff -- ignore extra spaces and EOL -- treat missing space as error -- return array of all mis-typed word and highligth them

Gonzih commented 12 years ago

Finally I did it, there are still some issue that i don't know how to fix (for example sometimes cursor jumps in Google Chrome, I can't detect spaces on the end of paragraph). Please take a look and say what you think.

Thanks, Max.

jgarber commented 12 years ago

Okay, I'll take a look. Thanks!

On Mon, May 28, 2012 at 6:20 AM, Max Gonzih < reply@reply.github.com

wrote:

Finally I did it, there are still some issue that i don't know how to fix (for example sometimes cursor jumps in Google Chrome, I can't detect spaces on the end of paragraph). Please take a look and say what you think.

Thanks, Max.


Reply to this email directly or view it on GitHub:

https://github.com/jgarber/dvorak-typing-tutor/issues/10#issuecomment-5962584

jgarber commented 12 years ago

Hi, Max. I finally got around to taking a look. Sorry for the delay. I can definitely see significant progress, though it's not working as smoothly as I'd hoped. Perhaps the task—integrating with CKEditor—is too hard. Sometimes software is so hard to integrate with other systems, it's almost not worth it. Other software drops in so easily that you hardly think about it. Usually you don't know until you've tried awhile. I know I wouldn't have been able to get as close to this result as you!

Take a break for a little while while I dig into the code and try to understand it for myself. I want to determine whether my vision for this is even possible and whether we keep hammering on the CKEditor to get it in the shape we want or double back a bit and try a different avenue. Either way, you've made a valiant effort—much more than I was capable of—and I'm thankful you gave it so much effort!

On Wed, May 30, 2012 at 8:40 AM, Jason Garber jg@jasongarber.com wrote:

Okay, I'll take a look. Thanks!

On Mon, May 28, 2012 at 6:20 AM, Max Gonzih < reply@reply.github.com

wrote:

Finally I did it, there are still some issue that i don't know how to fix (for example sometimes cursor jumps in Google Chrome, I can't detect spaces on the end of paragraph). Please take a look and say what you think.

Thanks, Max.


Reply to this email directly or view it on GitHub:

https://github.com/jgarber/dvorak-typing-tutor/issues/10#issuecomment-5962584