Copyright (c) 2005, Julien Couvreur; Released under the GPL license
version 0.2, 2008-03-01, John Urban
version 0.3, 2010-07-08, John Urban
This tantalizing script reads mouse motions and recognizes what
letters you drew in a way very reminiscent of my first Palm Pilot
(but it's definitely not exactly the same). Draw a letter with the
mouse and see if the script guesses which letter your wrote.
If you have any history with Palm devices, you're probably familiar
with the popular "Graffiti" text input method. Graffiti is a
handwriting-recognition system that translates strokes made with
the Palm stylus into characters, effectively allowing you to type
I made a few changes to Julien Couvreur's work so this would
- read the mouse position more accurately
- use an absolutely positioned CANVAS so that the drawing in the CANVAS lined up reliably with the mouse movements
- changed it so it would work in Opera and Safari instead of just Firefox browsers
- I added an option to display the patterns being best matched
- and other tweeks like space and backspace.
A better explanation of how this works and how the main algorithm
can be improved can be found with the original and the references
it points to.
If anyone extends this to do the full character set let me
know. Another good thing to do would be to have it echo all the stroke
patterns at once as an alphabet so that basically, it generates it's
own stroke diagram.
- Only alphameric characters are defined
- My old PALM's table may not be appropriate. He may be using grafitti.2/Jot or something else as a basis for the stroke patterns.
- Tested in firefox(1), opera.
Documentation for the Graffiti alphabet (pdf)
Algorithms for hardwriting recognition; machine learning; pattern recognition