Share via


RecognizerContext.PrefixText Property

Gets or sets the characters that come before the Strokes collection in the RecognizerContext object.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)

Syntax

'Declaration
Public Property PrefixText As String
'Usage
Dim instance As RecognizerContext
Dim value As String

value = instance.PrefixText

instance.PrefixText = value
public string PrefixText { get; set; }
public:
property String^ PrefixText {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_PrefixText ()

/** @property */
public void set_PrefixText (String value)
public function get PrefixText () : String

public function set PrefixText (value : String)
Not applicable.

Property Value

The characters that come before the Strokes collection in the RecognizerContext object. Must be less than 1k in length.

Remarks

The prefix helps improve recognition results by supplying the recognizer with more context about the handwriting.

Setting the PrefixText property succeeds only if the Strokes property is a null reference (Nothing in Visual Basic). You must set the PrefixText property before you attach a Strokes collection to the Strokes property of the RecognizerContext or you must set the Strokes property to a null reference (Nothing in Visual Basic) and then set the PrefixText property.

Note

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

Setting the PrefixText to null removes any prefix text from the RecognizerContext object.

The prefix text is ignored unless you have set both the Coerce and WordModeRecognitionModes flags in the RecognitionFlags property.

The SuffixText property gets or sets the characters that come after the strokes in the recognizer context and also helps improve the recognition result.

If your application provides a correction interface when converting ink to text, the application may allow the user to select characters within a word and use the pen to generate replacement characters. Your application can use the PrefixText and SuffixText properties to improve recognition of the new ink.

Example

This C# example returns the prefix text of the RecognizerContext object, theRecognizerContext.

string thePrefixText = theRecognizerContext.PrefixText;

This Microsoft® Visual Basic® .NET example returns the prefix text of the RecognizerContext object, theRecognizerContext.

Dim thePrefixText As String = theRecognizerContext.PrefixText

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

RecognizerContext Class
RecognizerContext Members
Microsoft.Ink Namespace
RecognitionModes
RecognizerContext.Strokes
RecognizerContext.RecognitionFlags
RecognizerContext.SuffixText