in

Emerald Hand

Emerald Hand, Inc. community home page.

This Blog

  • Home
  • Contact
  • About
  • Directory of Computers/Tech Blogs

Syndication

News

I'm back to blogging

Worm in liquid maze

Design and development of information management tools.

Word complete in JavaScript

I've recently found Word Complete web application. It's a cool little JavaScript program that offers word completion to the text user enters in a text area (just like IntelliSense, only in relationship to English. As letters are entered script automatically suggests a complete word).Word suggestion is not new in JavaScript and Google has been offering it (in beta) for some time. Actually that's one of the things that sparkled a lot of renewed interest in XMLHttp. This application seems to be simple, but pretty neat at the same time.

It is an important step towards on the fly spell-checking support (similar to how Microsoft Word marks misspelled words as you type). In fact, I think adding support for marking misspelled words is just a short step from Word Complete. Instead of suggesting a new word the script can try to look up the word in a dictionary, and if none is found underline it (or highlight it some other way). This leads to a problem of misspelled word indication.

The simplest solution would be to wrap the word in a span with CSS class name set to some class. A stylesheet could set background image to a wiggly red line at the bottom of the line for this class and so the word would get underlined. This would result in direct modification of the text entered by the user, and if the user would try to select and copy the text out the misspelled span tags would remain in the copied text (I think there's a way to format the text when it is copied or pasted, so this problem is probably solvable). An alternative solution could have a list of misspelled words next to the text area, or something similar. It would allow user to go to the selected word on click or directly fix it.

Another problem related to inline auto spell checking is showing a list of suggestions on the right click. Displaying a context menu or downloading a list of words from the server can be simple tasks on their own, but putting it all together and ensuring it's easy to reuse the code in web application development can be hard. I might some day have enough time to play around and try to come up with my own inline spell checker, but it would require setting up a spell checking web service, learning XMLHttp with which I'm not very familiar, etc.

Share this post: Email it! | bookmark it! | digg it! | reddit!
Readability Stats: Word Count: 412; Sentence Count: 18; Grade Level: 10.1, more info...
Published Sep 26 2005, 03:44 PM by Ornus
Filed under:

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add

About Ornus

Lead Sider and Xelog developer. I'm interested in information and how we can better manage it using computers. I'm also into design and understanding how to creating cool, useful, simple things.
Copyright © 2006-2007 EmeraldHand, Inc. All rights reserved.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems