background image
C H A P T E R 1 0
Recognition: Advanced Topics
Using Advanced Topics in Recognition
application's NTK project; they might be supplied by the user in an input line
view; they might even arrive as serial data. Because dictionary items can originate
from a number of sources, the example here presumes that you know how to store
your word strings and pass them, one at a time, to the
function. This function adds its argument to the specified custom dictionary.
function does not place any restrictions on the
strings to be entered in the dictionary; however, your intended use of the dictionary
entry may influence its content. For nonrecognition purposes, such as validating
input to a field, any string is a valid dictionary entry. For use in stroke recognition,
strings in enumerated dictionaries must not include spaces. The printed recognizer
accepts the full set of ASCII characters; the cursive recognizer does not. Digits
or non-alphabetic characters in dictionary entries used by the cursive recognizer
must appear in the input string in order to be recognized. Do not use the
function to add items to the review dictionary; use the
methods instead.
You can take the following steps to create a RAM-based enumerated dictionary at
run time:
1. Use the global function
to create a new empty dictionary.
2. Use the global function
to add dictionary items to
the new dictionary.
3. Use the global function
to create a binary
representation of the completed dictionary, which can then be stored in a soup.
Another way to do this is to create a new dictionary and restore its data from a soup.
The next several sections describe the numbered steps in greater detail. Following
this discussion, the section "Restoring Dictionary Data From a Soup" (page 10-28),
describes how to restore an existing dictionary from soup data.
Creating the Blank Dictionary
You can create a blank RAM-based dictionary anywhere in your application that
makes sense; a common approach is to take care of this in the
method of the application's base view. You must also
create a slot in which to store the RAM-based dictionary. The following code
fragment creates a dictionary in the
ViewSetupFormScript := func()
mySpecialDictionary := NewDictionary('custom);
This code example uses the
function to create a blank dictionary
in the
slot. The
function accepts the
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна