beautypg.com

Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 389

background image

C H A P T E R 1 0

Recognition: Advanced Topics

Using Advanced Topics in Recognition

10-13

Manipulating Dictionaries

10

You can control the view’s use of dictionaries by including in your

recConfig

frame the

dictionaries

,

rcSingleLetters

, or

inhibitSymbolsDictionary

slots as appropriate. These slots are described in

“protoRecConfig” (page 8-36) in Newton Programmer’s Reference.

Single-Character Input Views

10

When recognizing single characters, the recognizer sometimes has difficulty
determining individual characters’ baseline or size; for example, it can be difficult
to distinguish between an upper case

P

and a lower case

p

when relying strictly on

user input. If you know where the user will be writing with respect to a
well-defined baseline, you can provide an

rcBaseInfo

or

rcGridInfo

frame to

specify to the recognition system precisely where characters are written.

The rcBaseInfo Frame

10

The

rcBaseInfo

frame is especially valuable in improving the recognition of

single characters, for which it is sometimes difficult to derive baseline or letter-size
values from user input.

Figure 10-3 depicts the editing box that an

rcBaseInfo

frame defines.

Figure 10-3

Single-character editing box specified by

rcBaseInfo

frame

The NewtonScript code used to create the baseline information for the editing box
shown in Figure 10-3 looks like the following example.

rcBaseInfo := {

base:

140,// global y-coordinate of baseline

smallHeight:15,// height of a lower case x

bigHeight:30,// height of an upper case X

descent:15,// size of descender below baseline

};

base

descent

smallHeight

bigHeight