Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
original version of the Character Recogniser Page
Last updated at 12:19 pm UTC on 31 October 2003
From the Squeak Mailing Lists, October 27, 1997:

You might guess correctly that pen-computing and a pen-based Squeak are close to our hearts.

If you go to the class browser, you will find under System Support a class called CharRecog that implements my version of the great original GRAIL character recognizer done at RAND in the sixties by Gabe Groner. The recognizer today most in the spirit of Gabe's is Graffiti, but the latter is not really as good!

It was written quickly (a few days) to help calibrate the original Squeak implementation, and is not currently hooked into the text input channel, but it is fully operational. It has lots of comments and is very short so you should be able to see how it works and how to experiment with it.

Like GRAIL (and Graffiti) it takes each character as a single stroke. Unlike Graffiti, it is trainable. Each time it doesn't recognize a character, it gives you the opportunity to tell it what the character was supposed to be. A dictionary is gradually built up. You will get good results if you train it on the Graffiti character set. The recognizer is plenty good enough to not need Graffiti's case shifts to have lots of characters.

One last comment: The current version is set to show you both the stroke and the filtered points that are chosen. You can comment out the latter if you wish. Generally the fewer filtered points the better! You might want to filter out more points since Squeak is at least 10 times faster now than it was when I wrote the code. A more sophisticated version should obviously time sample in order to be uniform over all of the ports.



Note that the recognizer can be activated in any text view by entering command-R. But, you must first filein the attached fix to the CharRecog>>recognizer method to prevent failure by error in the standard release of Squeak version 1.23, and likely earlier versions too.

Thanks for the note Alan. I had tried it out but was unaware it was trainable. I'll go back and teach it Graffiti per your suggestion. – EdKleban


Thanks for the note and fix. I must confess I haven't used it for more than a year (Disney is a busy place...), but we will shortly integrate the recognizer into Morphic.

Re: training. You should be able to make a number of dictionaries that hold different experiments in taking a stroke -> character.

Also: since the start and order of a stroke are features, you can make a shape e.g. "O" mean lots of things in the same dictionary: lower case and caps, zero, rectangle, and oval, etc., can all coexist.

I also did a buffered version that forked a new recognizer instance each time you touched down the pen so that you could print as fast as you could go; Grail did this. I don't think this is in the current release, but you could easily try it yourself. – Alan Kay