DIRECTORY Rope USING [ROPE], Xl USING [Point]; --Package depends only on types from Xl, not code. Handwriting: CEDAR DEFINITIONS ~ BEGIN Stroke: TYPE = LIST OF Xl.Point; --Representing one stroke within one character Strokes: TYPE = LIST OF Stroke; --Representing one character TrainingDB: TYPE = REF; --A reference database of normalized character's Normalized: TYPE = REF; --A set of normalized strokes (representing one character) IsTrainingDB: PROC [x: REF] RETURNS [BOOL]; NarrowTrainingDB: PROC [x: REF] RETURNS [TrainingDB]; IsNormalized: PROC [x: REF] RETURNS [BOOL]; NarrowNormalized: PROC [x: REF] RETURNS [Normalized]; ReadDB: PROC [name: Rope.ROPE] RETURNS [TrainingDB]; WriteDB: PROC [name: Rope.ROPE, db: TrainingDB]; MergeDB: PROC [into: TrainingDB ¬ NIL, db: TrainingDB] RETURNS [TrainingDB]; UnTrainDB: PROC [db: TrainingDB, x: Normalized] RETURNS [TrainingDB]; TrainDB: PROC [db: TrainingDB, strokes: Strokes, ch: INT] RETURNS [TrainingDB]; TrainDBNormalized: PROC [db: TrainingDB, x: Normalized] RETURNS [TrainingDB]; NextNormalized: PROC [db: TrainingDB, x: Normalized] RETURNS [Normalized]; Normalize: PROC [strokes: Strokes, ch: INT ¬ -1] RETURNS [Normalized]; UnNormalize: PROC [x: Normalized, sizemax: INT ¬ 40] RETURNS [strokes: Strokes]; GetChar: PROC [x: Normalized] RETURNS [ch: INT]; SetChar: PROC [x: Normalized, ch: INT]; Report: TYPE = RECORD [ ch: INT, x: Normalized, badness: INT --Smaller value means higher probability of correctness ]; Recognize: PROC [db: TrainingDB, strokes: Strokes] RETURNS [LIST OF Report]; RecognizeNormalized: PROC [db: TrainingDB, x: Normalized] RETURNS [LIST OF Report]; END. ^ Handwriting.mesa Copyright Σ 1992, 1993 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, September 8, 1992 4:05 pm PDT Christian Jacobi, May 6, 1993 8:53 pm PDT Simple interface for dynamic handwriting recognition. Dynamic means it is used in interactive context, character by character. This interface is not yet really stable. Types Temporary design consideration: TrainingDB and Normalized are not opaque so it is possible to change these types while developing the package. Clients must treat them as opaque. Database operations, input output May raise IO and PFS errors Copies db and merges it in into. May or may not be destructive or share data with into but not with db. Training A "Normalized" MUST NOT be trained more than once Training and UnTraining may or may not be destructive to the database Normalization and access Offset to [0, 0] from some center, sizemax maximum dimension in any direction from center Char can be set or changed until x has been included into any training database Recognition Returns guess for recognized character, in order of probability ΚΛ•NewlineDelimiter ™code™Kšœ Οeœ7™BK™:K™*™5K™HK™(—K™—šΟk ˜ Kšœžœžœ˜Kšœžœ Οc2˜EK˜—KšΟn œžœž œž˜&head™Kšœžœžœžœ Ÿ.˜PKšœ žœžœžœ Ÿ˜