InkAnalyzer.GetAlternates 方法 (ContextNodeCollection, Int32)

为指定 ContextNodeCollection 中的节点返回最多指定数目的分析备选项。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink.Analysis(在 Microsoft.Ink.Analysis.dll 中)

语法

声明
Public Function GetAlternates ( _
    nodes As ContextNodeCollection, _
    maximumAlternates As Integer _
) As AnalysisAlternateCollection
用法
Dim instance As InkAnalyzer
Dim nodes As ContextNodeCollection
Dim maximumAlternates As Integer
Dim returnValue As AnalysisAlternateCollection

returnValue = instance.GetAlternates(nodes, _
    maximumAlternates)
public AnalysisAlternateCollection GetAlternates(
    ContextNodeCollection nodes,
    int maximumAlternates
)
public:
AnalysisAlternateCollection^ GetAlternates(
    ContextNodeCollection^ nodes, 
    int maximumAlternates
)
public AnalysisAlternateCollection GetAlternates(
    ContextNodeCollection nodes,
    int maximumAlternates
)
public function GetAlternates(
    nodes : ContextNodeCollection, 
    maximumAlternates : int
) : AnalysisAlternateCollection

参数

  • maximumAlternates
    类型:System.Int32
    要返回的分析备选项的数目。

返回值

类型:Microsoft.Ink.AnalysisAlternateCollection
nodes 的最多前 maximumAlternates 个分析备选项。

备注

最佳备选项作为集合的第一个备选项返回。

nodes 中的 ContextNode 对象不一定表示文档的相邻区域。

对于 nodes 中的每个分析提示,InkAnalyzer 仅返回最佳备选项。

示例

此示例为与 InkAnalyzer (theInkAnalyzer) 关联的 ContextNodeCollection (theContextNodes) 获取最多前五个备选项。然后,将这些备选项的已识别字符串添加到 System.Collections.Specialized.StringCollection (theAlternateStrings)。

' Get 5 analysis alternates for the context node collection and add the
' recognized strings to a string collection.
theAlternateCollection = Me.theInkAnalyzer.GetAlternates(theContextNodes, 5)
theAlternateStrings.Clear()
Dim theAlternate As Microsoft.Ink.AnalysisAlternate
For Each theAlternate In theAlternateCollection
    theAlternateStrings.Add(theAlternate.RecognizedString)
Next theAlternate
// Get 5 analysis alternates for the context node collection and add the
// recognized strings to a string collection.
theAlternateCollection = this.theInkAnalyzer.GetAlternates(theContextNodes, 5);
theAlternateStrings.Clear();
foreach (Microsoft.Ink.AnalysisAlternate theAlternate
    in theAlternateCollection)
{
    theAlternateStrings.Add(theAlternate.RecognizedString);
}

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkAnalyzer 类

InkAnalyzer 成员

GetAlternates 重载

Microsoft.Ink 命名空间

Microsoft.Ink.AnalysisAlternate

Microsoft.Ink.AnalysisAlternateCollection

Microsoft.Ink.ContextNode

Microsoft.Ink.ContextNodeCollection