InkRecognizerContext Class

InkRecognizerContext Class

Enables the ability to perform ink recognition, retrieve the recognition result, and retrieve alternates. The InkRecognizerContext enables the various recognizers that are installed on a system to use ink recognition to process input appropriately.

Members

EnumerationDescription
InkRecognitionModesDefines values that specify how the recognizer interprets the ink and determines the result string.
InkRecognizerCharacterAutoCompletionModeDefines values that specify types of character input modes.
EventDescription
RecognitionOccurs when the InkRecognizerContext has generated results from the BackgroundRecognize method.
RecognitionWithAlternatesOccurs when the InkRecognizerContext has generated results after calling the BackgroundRecognizeWithAlternates method.

MethodDescription
BackgroundRecognizeSpecifies that the recognizer should recognize the associated strokes and fire a Recognition event when recognition is complete.
BackgroundRecognizeWithAlternatesSpecifies that the recognizer should recognize the associated strokes and fire a RecognitionWithAlternates event when recognition is complete.
CloneCreates a duplicate InkRecognizerContext.
EndInkInputEnds ink input to the InkRecognizerContext.
IsStringSupportedIndicates whether the system dictionary, user dictionary, or word list contain a specified string.
RecognizePerforms recogntion on an InkStrokes collection and returns recognition results.
StopBackgroundRecognitionEnds background recognition that was started with a call to BackgroundRecognize or BackgroundRecognizeWithAlternates.

PropertyDescription
CharacterAutoCompletionGets or sets the character Autocomplete mode, which determines when characters or words are recognized.
FactoidGets or sets the string name of the factoid used by the InkRecognizerContext object.
GuideGets or sets the InkRecognizerGuide to use for ink input.
PrefixTextGets or sets the characters that come before the InkStrokes collection in the InkRecognizerContext object.
RecognitionFlagsGets or sets the flags that specify how the recognizer interprets the ink and determines the result string.
RecognizerGets or sets the IInkRecognizer object used by the InkRecognizerContext object.
StrokesGets or sets the InkStrokes collection associated with the InkRecognizerContext object.
SuffixTextGets or sets the characters that come after the InkStrokes collection in the InkRecognizerContext object.
WordListGets or sets the InkWordList object that is used to improve the recognition results.

Remarks

This object can be instantiated by calling the CoCreateInstance method in C++ or by using the New keyword in Microsoft® Visual Basic® 6.0.

There are two types of recognition: background (asynchronous) or foreground (synchronous). Background recognition is started by a call to the BackgroundRecognize or BackgroundRecognizeWithAlternates methods, occurs on a background thread, and reports results to the application through an event mechanism. Foreground recognition does not return until all recognition is completed, thus making recognition results available to the calling thread without listening for the recognition event.

Ink is processed continuously in the background. If a IInkStrokeDisp is added to the InkStrokes collection to which the InkRecognizerContext refers, then the IInkStrokeDisp is then recognized immediately. See remarks in the EndInkInput method topic for more details.

All recognition occurs through a recognizer context. The context defines the settings for a single recognition session. It receives the ink that must be recognized and defines the constraints on the ink input and on the recognition output. The constraints that can be set on the context include the language, the dictionary, and grammar that is being used.

Note: Setting properties other than the Strokes or CharacterAutoCompletion properties succeeds only if the InkStrokes collection is NULL (Nothing in Visual Basic 6.0). You must set the other properties before you attach the InkStrokes collection to the InkRecognizerContext, or you must set the InkStrokes collection to NULL and then set the other properties. If you set the InkStrokes collection to NULL and then set the other properties, you may have to reattach the InkStrokes collection. This is because the recognition starts right after you assign the InkStrokes to the InkRecognizerContext. When a call is made to Recognize or BackgroundRecognize, call results might be available already.

To improve your application's performance, dispose of your InkRecognizerContext object when it is no longer needed.

COM Implementation

This object implements the IInkRecognizerContext COM interface.

Related Topics

Show: