Condividi tramite


RecognizerContext.Factoid Property

RecognizerContext.Factoid Property

Gets or sets the string name of the factoid used by the RecognizerContext object.

Definition

Visual Basic .NET Public Property Factoid As String
C# public string Factoid { get; set; }
Managed C++ public: __property String* get_Factoid();
public: __property void set_Factoid(String*);

Property Value

System.String. The name of the factoid used by the RecognizerContext object.

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

Exceptions

COMException Leave Site:
ObjectDisposedException Leave Site:

Remarks

A factoid provides context information for ink within a particular field. You specify a factoid if an input field is of a known type. For example, if the input field contains a date, specify a factoid value of "(!IS_DATE)".

If you combine the IS_DEFAULT input scope by ORing it with any other input scope, the effect is that the recognizer can return either any single expression that the default language model supports (for example, one word from the system dictionary or a date) with or without punctuation, or any value that meets the rest of the regular expression passed in to the recognizer.

To ensure the correct context association, set this property before the ink is processed for the first time.

The Factoid property takes or returns a String Leave Site, not a Factoid object. For a list of possible values for the Factoid property, see InputScope.

For more information about factoids and how to use them, see Improving Tablet PC Recognition Accuracy by Setting Context. For a list of supported factoids, see the InputScope.

Note: String representations of factoids are case-sensitive.

Setting the Factoid property succeeds only if the Strokes property is null. You must set the Factoid 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 Factoid property (and possibly reattach the Strokes collection).

Examples

[C#]

This C# example sets the Factoid property of the RecognizerContext object, theRecognizerContext, to the IS_ADDRESS_POSTALCODE input scope.

theRecognizerContext.Factoid = "(!IS_ADDRESS_POSTALCODE)";

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example sets the Factoid property of the RecognizerContext object, theRecognizerContext, to the IS_ADDRESS_POSTALCODE input scope.

theRecognizerContext.Factoid = "(!IS_ADDRESS_POSTALCODE)"

See Also