Apple Newton Utilities Guide de l'utilisateur Page 391

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 390
CHAPTER 10
Recognition: Advanced Topics
Using Advanced Topics in Recognition 10-15
If you provide a grid in which the user is to write characters or words, you need to
use an
rcGridInfo frame to dene the grid to the text recognizer. For example,
the
protoCharEdit system prototype uses an rcGridInfo frame internally to
dene the input areas (cells) in the comb view it provides.
The recognizer uses the information in an
rcGridInfo frame to make character-
segmentation decisions. You can use the
rcGridInfo frame in conjunction with
an
rcBaseInfo frame to provide more accurate recognition within boxes in a
single view. Recognition in the most recently used grid box begins as soon as the
user writes in a new box in the grid.
The NewtonScript code used to create the grid shown in Figure 10-4 looks like the
following example.
rcGridInfo := {
boxLeft: 100,// x coordinate of left of top-left box
boxRight:145,// x coordinate of right of top-left box
xSpace:55,// x distance from boxLeft to boxLeft
boxTop: 50,// y coordinate of top of top-left box
boxBottom:95,// y coordinate of bottom of top-left box
ySpace:55// y distance from boxTop to boxTop
};
To obtain the best performance and to conserve available memory, create your
rcGridInfo frame by cloning the frame provided by the
ROM_canonicalCharGrid constant. Store your frame in a slot named
rcGridInfo in your view’s recConfig frame.
For a detailed description of the
rcGridInfo frame, see “Data Structures Used in
recCong Frames” (page 8-24) in Newton Programmers Reference
Creating Single-Letter Input Views 10
The following code fragment creates a single-letter input view’s recConfig
frame. This frame, which includes
rcBaseInfo and rcGridInfo frames, is
based on the
ROM_rcSingleCharacterConfig frame supplied by the system.
// specify box (or horizontal array of boxes)
// into which character(s) are written.
myView := {
recConfig: ROM_rcsinglecharacterconfig,
…}
// height of a lowercase letter
constant kSmallHeight := 11;
Vue de la page 390
1 2 ... 386 387 388 389 390 391 392 393 394 395 396 ... 941 942

Commentaires sur ces manuels

Pas de commentaire