background image
C H A P T E R 1 0
Recognition: Advanced Topics
10-36
Using Advanced Topics in Recognition
Removing Words From the Auto-Add Dictionary
10
The
RemoveAutoAdd
function deletes a specified word from both the user and
auto-add dictionaries. This function returns
true
if the word was removed and
returns
nil
if the word was not removed. This method does not remove the word if
it is not present in the auto-add dictionary or if there are case inconsistencies
between the argument to this function and the word actually found in the dictionary.
Using protoCharEdit Views
10
The
protoCharEdit
proto provides a comb-style view that facilitates the
correction of individual characters in misrecognized words. The view provided by
this proto uses an
rcGridInfo
frame internally to provide a horizontal row of
single-character input areas. The system-supplied corrector available from the
picker displayed when the user taps a recognized word makes use of this view.
Figure 10-7 illustrates a typical
protoCharEdit
view.
Figure 10-7
Example of a
protoCharEdit
view
This section describes how to position a
protoCharEdit
view, how to manipulate
the text string it displays, and how to restrict its input to a specified set of characters.
Positioning protoCharEdit Views
10
There are two ways to position a
protoCharEdit
view within its parent view.
You can set the values of its
top
and
left
slots to values that position it at the top
left corner of the view, or you can provide a similar value for its
viewBounds
slot.
If you specify the values of the
top
and
left
slots, then the
ViewSetupFormScript
method of the
protoCharEdit
view supplies an
appropriate value for the
viewBounds
slot based on the values of the
cellHeight
,
cellWidth
, and
maxChars
slots. On the other hand, if you
provide the values of the
viewBounds
and
cellWidth
slots, then this view
supplies appropriate values for the
maxChars
and
cellHeight
slots for you.
This proto provides useful default values for the
cellWidth
and
cellHeight
slots; it is recommended that you do not change these values.
The technique you use depends on how you want to set the slots that this proto
provides. For detailed information, see "protoCharEdit" (page 8-41) in Newton
Programmer's Reference
.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна