AnalysisHintNode.GetRecognizedString 方法

返回 InkAnalyzer 已经为之应用当前分析提示的所有书写节点的已识别字符串的串联。

命名空间:  System.Windows.Ink
程序集:  IAWinFX(在 IAWinFX.dll 中)

语法

声明
Public Function GetRecognizedString As String
用法
Dim instance As AnalysisHintNode
Dim returnValue As String

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

返回值

类型:System.String
InkAnalyzer 已经为之应用当前分析提示的所有书写节点的已识别字符串的串联。默认值为空字符串 ("")。

备注

此方法返回的字符串与此提示所链接的各个 System.Windows.Ink.ContextNode 对象的已识别字符串相互串联所得到的字符串是相同的。已识别字符串的顺序与在 InkAnalyzerBaseGetRecognizedString() 中采用的顺序相同。

示例

此示例创建名为 notes 的 StringBuilder,并且添加有关当前附加到 InkAnalyzer(名为 theInkAnalyzerWithHint))的所有提示的信息。对于每个提示,提示的名称、单词列表和已识别字符串均会添加到 notes。

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

Dim theHint As 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 System.Text.StringBuilder();
notes.AppendLine("List of all the current AnalysisHintNodes:");

foreach (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();
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

AnalysisHintNode 类

AnalysisHintNode 成员

System.Windows.Ink 命名空间