共用方式為


RecognizerContext.RecognitionFlags Property

RecognizerContext.RecognitionFlags Property

Gets or sets the flags that specify how the recognizer interprets the ink and determines the result string.

Definition

Visual Basic .NET Public Property RecognitionFlags As RecognitionModes
C# public RecognitionModes RecognitionFlags { get; set; }
Managed C++ public: __property RecognitionModes* get_RecognitionFlags();
public: __property void set_RecognitionFlags(RecognitionModes*);

Property Value

Microsoft.Ink.RecognitionModes. The flags that specify how the recognizer interprets the ink and determines the result string.

This property is read/write. This property has no default value.

None0 Specifies that the recognizer applies no recognition modes.
WordMode1 Specifies that the recognizer treats the ink as a single word.

For example, if the context contains to get her, the recognizer returns together.

Note: Some compound words in the dictionary are treated as single words by recognizers of Latin script (for example, Los Angeles). In addition, certain factoids such as Date in U.S., U.K., German, and French treat some multiple word dates as single words (such as January 21, 2000).
TopInkBreaksOnly4 Disables multiple segmentation.

This turns off the recognizer's ability to return recognition results based on more than one recognition segment of the ink, where each segment corresponds to a word (in recognizers of Latin script) or a character (in recognizers of East Asian characters).

The word "together" always returns alternates based on "together" being a single word, and the recognizer does not consider the string might also be "to get her" or some other variation with differing segmentation.

Turning on this flag enhances recognition speed.

Coerce2 Specifies that the recognizer coerces the result based on the factoid that you specified for the context.

For example, if the Telephone factoid is specified and the user enters the word hello, the recognizer may return a random phone number or an empty string. If this flag is not specified, the recognizer returns hello as the result.

Exceptions

COMException Leave Site:
ObjectDisposedException Leave Site:

Remarks

The RecognitionFlags property gets or sets flags that specify things such as whether the recognizer treats all ink as a single word or whether the recognizer coerces the result based on the factoid that you specified for the context.

Setting the RecognitionFlags property succeeds only if the Strokes property is null. You must set the RecognitionFlags property before you attach a Strokes collection to the Strokes property of the RecognizerContext, or you must set the Strokes property to null and then set the RecognitionModes flags.

Note: If you use the latter method, you may need to reattach the Strokes collection to the Strokes property of the RecognizerContext.

For a list of modes that you can use, see the RecognitionModes enumeration type.

Note: You can combine modes using the bitwise OR operator.

Examples

[C#]

This C# example sets the RecognitionFlags property of the RecognizerContext object, theRecognizerContext, to word mode.

theRecognizerContext.RecognitionFlags = RecognitionModes.WordMode;

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example sets the RecognitionFlags property of the RecognizerContext object, theRecognizerContext, to word mode.

theRecognizerContext.RecognitionFlags = RecognitionModes.WordMode

See Also