AnalysisHintNode.GetRecognizedString 方法
返回 InkAnalyzer 已经为之应用此分析提示的所有书写节点的已识别字符串的串联。
命名空间: Microsoft.Ink
程序集: Microsoft.Ink.Analysis(在 Microsoft.Ink.Analysis.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 已经为之应用此分析提示的所有书写节点的已识别字符串的串联。默认值为空字符串 ("")。
备注
此方法返回的字符串与通过将此提示所链接的各个 Microsoft.Ink.ContextNode 对象的已识别字符串串联所得到的字符串是相同的。已识别字符串的顺序与它们在 InkAnalyzerBase.GetRecognizedString 中的顺序相同。
示例
此示例创建 System.Text.StringBuilder (notes),并添加有关 InkAnalyzer (theInkAnalyzerWithHint) 当前所有附加提示的信息。对于每个提示,提示的名称、单词列表和已识别字符串均会添加到 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();
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0