DivisionUnit.RecognitionString Property
Gets the recognized text for the Strokes collection in the DivisionUnit object.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
Public ReadOnly Property RecognitionString As String
'Usage
Dim instance As DivisionUnit
Dim value As String
value = instance.RecognitionString
public string RecognitionString { get; }
public:
property String^ RecognitionString {
String^ get ();
}
public function get RecognitionString () : String
Property Value
Type: System.String
The recognized text for the Strokes collection in the DivisionUnit object.
Remarks
The RecognitionString property returns null for drawing elements.
The following table describes the recognized text for each type of DivisionUnit object.
DivisionUnit Type |
RecognitionString Value |
---|---|
The top alternate for the recognition segment. |
|
The RecognizedText for each segment in the line, separated by spaces. |
|
The RecognizedText for each line in the paragraph, separated by new line characters. |
|
nulla null reference (Nothing in Visual Basic) |
The RecognitionString property and the DivisionUnit.ToString method return the identical strings.
Examples
This C# example creates a Divider object, theDivider, which contains a Strokes collection, theStrokes, and uses a RecognizerContext object, theRecognizerContext. The Divide method is called to get a snapshot of the analysis results, theResult. The ResultByType method is called with the divisionType parameter set to Line, a InkDivisionType enumeration, to retrieve all of the line units within theResult. For each line, theLine, in the collection, the DivisionType, Strokes, RecognitionString, and Transform properties are retrieved.
// Create the Divider and assign a Strokes collection to it.
Divider theDivider = new Divider(theStrokes, theRecognizerContext);
// Retrieve the analysis result, and divide the result by line.
DivisionResult theResult = theDivider.Divide();
DivisionUnits theDivisionUnits =
theResult.ResultByType(InkDivisionType.Line);
foreach (DivisionUnit theLine in theDivisionUnits)
{
// For each line element in the collection
// retrieve the division type, the strokes,
// the recognition string, and the rotation transform.
InkDivisionType theDivisionType = theLine.DivisionType;
Strokes elementStrokes = theLine.Strokes;
string theRecognitionString = theLine.RecognitionString;
System.Drawing.Drawing2D.Matrix theInkTransform =
theLine.Transform;
}
This Microsoft® Visual Basic® .NET example creates a Divider object, theDivider, which contains a Strokes collection, theStrokes, and uses a RecognizerContext object, theRecognizerContext. The Divide method is called to get a snapshot of the analysis results, theResult. The ResultByType method is called with the divisionType parameter set to Line, a InkDivisionType enumeration, to retrieve all of the line units within theResult. For each line, theLine, in the collection, the DivisionType, Strokes, RecognitionString, and Transform properties are retrieved.
' Create the Divider and assign a Strokes collection to it.
Dim theDivider As Divider = New Divider(theStrokes, theRecognizerContext)
' Retrieve the analysis result, and divide the result by line.
Dim theResult As DivisionResult = theDivider.Divide()
Dim theDivisionUnits As DivisionUnits = _
theResult.ResultByType(InkDivisionType.Line)
Dim theLine As DivisionUnit
For Each theLine In theDivisionUnits
' For each line element in the collection
' retrieve the division type, the strokes,
' the recognition string, and the rotation transform.
Dim theDivisionType As InkDivisionType = theLine.DivisionType
Dim elementStrokes As Strokes = theLine.Strokes
Dim theRecognitionString As String = theLine.RecognitionString
Dim theInkTransform As System.Drawing.Drawing2D.Matrix = _
theLine.Transform
Next
Platforms
Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0