background image
C H A P T E R 1 0
Recognition: Advanced Topics
10-24
Using Advanced Topics in Recognition
The
wordInfo
frame provides methods that you can use to manipulate its
contents; for more information, see "WordInfo Methods" (page 8-62) in Newton
Programmer's Reference
.
The alternate interpretations of a recognized word are provided as
wordInterp
frames based on the
protoWordInterp
system prototype. An array of
wordInterp
frames resides in the
wordInfo
frame's
words
slot.
Each
wordInterp
frame contains the following information:
a string that is one interpretation of the original input strokes.
a score indicating the recognizer's confidence in the accuracy of the interpretation.
the dictionary identifier of the recognized word (for internal use only).
the position occupied by this word in the original list of interpretations returned
by the recognizer.
For more information, see the descriptions of the
protoCorrectInfo
,
protoWordInterp
, and
protoWordInfo
prototypes in Newton Programmer's
Reference
.
You can provide an optional
ViewCorrectionPopupScript
method that
modifies or replaces the picker that displays correction information when a word is
double-tapped. For a description of this method, see "Application-Defined
Recognition Methods" (page 8-66) in Newton Programmer's Reference.
Using Custom Dictionaries
10
In addition to the system-supplied dictionaries, your application can use custom
dictionaries to facilitate the recognition of specialized vocabulary such as medical
or legal terms. It's relatively easy to create a RAM-based enumerated dictionary at
run time; however, this approach is not recommended for dictionaries containing
more than a few words.
Note that you cannot cause the built-in applications (Names, Dates and so on) to
use custom dictionaries. The only way to enable these applications to recognize
specialized terminology is to add words to the user dictionary. However, you are
strongly discouraged from doing so, because each entry added to the user dictionary
reduces the amount of system RAM available to the user. For more information,
see "System Dictionaries" beginning on page 9-11.
Creating a Custom Enumerated Dictionary
10
To create a custom enumerated dictionary, you must populate a blank RAM-based
dictionary with your dictionary items. Dictionary items can come from a number of
places: they might be elements of your own array of strings stored in the application's
NTK project data; they might be represented as binary resource data in your
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна