Compartir a través de


HRECOCONTEXT Handle

HRECOCONTEXT Handle

The HRECOCONTEXT handle is used to add ink to the context, perform ink recognition (synchronously or asynchronously), retrieve the recognition result, and retrieve alternates.

The primary reason for having recognizer context handles is to differentiate between ink inputs. For example you can create an application with two windows, the user being able to ink in either window. You do not want to have the ink of the first window mixed up with the ink of the second window when you ask the recognizer to recognize the ink of one of the window. In this kind of application you create two recognizer contexts (one for each window) and you add strokes coming into window 1 into recognizer context 1 and strokes from window 2 into recognizer context 2. To return recognition results, call process on recognizer context 1 or recognizer context 2 depending on if you want the results for window 1 or 2.

The recognizer context handle can be anything you want. But typically it is an index in a global array of structures. The structures may contain all the strokes that have been entered and all the variables that the recognizer uses for that particular piece of ink (for example, your internal lattice structure, or the current state of recognition). One structure may contain all the information the recognizer needs and uses for one particular piece of ink.

To get an HRECOCONTEXT handle, call the CreateContext function.

HRECOCONTEXT Functions

Function Description
AddStroke Adds an ink stroke to the recognizer context.
AdviseInkChange Stops the recognizer from processing ink because a new stroke is being added or deleted.
CloneContext Creates a recognizer context that contains the same settings as the original. The new recognizer context does not include the ink or recognition results of the original.
EndInkInput Indicates that no more ink will be added to the context.
GetAlternateList Returns a list of alternates for the best result string.
GetBestAlternate Returns an HRECOALT Handle pointer for the best result alternate.
GetBestResultString Returns the best result string.
GetContextPropertyList Returns a list of properties the recognizer supports.
GetContextPropertyValue Returns a specified property value from the recognizer context.
GetEnabledUnicodeRanges Returns a list of Unicode point ranges enabled on the context.
GetGuide Returns the guide used for boxed or lined input.
GetLatticePtr Returns a pointer to the lattice for the current results.
IsStringSupported Returns a value that indicates whether a word, date, time, number, or other text that is passed in is contained in the dictionary.
Process Performs ink recognition synchronously.
ResetContext Deletes the current ink and recognition results from the context.
SetCACMode Specifies character Autocomplete mode for character or word recognition.
SetContextPropertyValue Adds a property to the recognizer context. If a property already exists, its value is modified.
SetEnabledUnicodeRanges Enables one or more Unicode point ranges on the context.
SetFactoid Sets the factoid a recognizer uses to constrain its search for the result.
SetFlags Sets how the recognizer interprets the ink and determines the result string.
SetGuide Sets the guide to use for boxed or lined input.
SetTextContext Provides the text strings that come before and after the text contained in the recognizer context. For recognizers of East Asian languages, the SetTextContext function provides characters rather than text strings.
SetWordList Sets the word list for the current recognizer context to recognize.