Share via


AnalysisHintNode.GetRecognizedString Method

Returns the concatenation of the recognized strings for all writing nodes to which the InkAnalyzer has applied this analysis hint.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

Syntax

'Declaration
Public Function GetRecognizedString As String
'Usage
Dim instance As AnalysisHintNode 
Dim returnValue As String 

returnValue = instance.GetRecognizedString()
public string GetRecognizedString()
public:
String^ GetRecognizedString()
public function GetRecognizedString() : String

Return Value

Type: System.String
The concatenation of the recognized strings for all writing nodes to which the InkAnalyzer has applied this analysis hint. The default is an empty string ("").

Remarks

The string returned by this method is the same string that you would get by concatenating the recognized strings of the Microsoft.Ink.ContextNode objects to which the hint is linked. The order of the recognized strings matches the order in which they occur in InkAnalyzerBase.GetRecognizedString.

Examples

This example creates a System.Text.StringBuilder, notes, and adds information about all the hints currently attached to the InkAnalyzer, theInkAnalyzerWithHint. For each hint, the hint's name, word list, and recognized string are added to notes.

Dim notes = New System.Text.StringBuilder()
notes.AppendLine("List of all the current AnalysisHintNodes:")

Dim theHint As Microsoft.Ink.AnalysisHintNode
For Each theHint In Me.theInkAnalyzerWithHint.GetAnalysisHints()
    notes.AppendLine(" Hint Name: " + theHint.Name)

    If 0 < theHint.GetWordlist().Length Then
        notes.Append(" - WordList: ")
        Dim first As Boolean = True 
        Dim theWord As String 
        For Each theWord In theHint.GetWordlist()
            If Not first Then
                notes.Append(", ")
            Else
                first = False 
            End If
            notes.AppendFormat("'{0}'", theWord)
        Next theWord
        notes.AppendLine()
    Else
        notes.AppendLine(" - No WordList specified")
    End If 

    If String.Empty <> theHint.GetRecognizedString() Then
        notes.AppendLine(" - Recognized string: " _
            + theHint.GetRecognizedString())
    Else
        notes.AppendLine(" - No recognized string.")
    End If

    notes.AppendLine()
Next theHint
System.Text.StringBuilder notes = new StringBuilder();
notes.AppendLine("List of all the current AnalysisHintNodes:");

foreach (Microsoft.Ink.AnalysisHintNode theHint
    in this.theInkAnalyzerWithHint.GetAnalysisHints())
{
    notes.AppendLine(" Hint Name: " + theHint.Name);

    if (0 < theHint.GetWordlist().Length)
    {
        notes.Append(" - WordList: ");
        bool first = true;
        foreach (String theWord in theHint.GetWordlist())
        {
            if (!first)
            {
                notes.Append(", ");
            }
            else
            {
                first = false;
            }
            notes.AppendFormat("'{0}'", theWord);
        }
        notes.AppendLine();
    }
    else
    {
        notes.AppendLine(" - No WordList specified");
    }

    if (string.Empty != theHint.GetRecognizedString())
    {
        notes.AppendLine(" - Recognized string: "
            + theHint.GetRecognizedString());
    }
    else
    {
        notes.AppendLine(" - No recognized string.");
    }

    notes.AppendLine();
}

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

See Also

Reference

AnalysisHintNode Class

AnalysisHintNode Members

Microsoft.Ink Namespace