<<>> <> <> <> <> <> <> <> <<>> 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.