InkAnalyzer.GetAlternates Method (ContextNodeCollection, Int32)
Returns up to the specified number of analysis alternates for the nodes in a specified ContextNodeCollection.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in microsoft.ink.analysis.dll)
Syntax
'Declaration
Public Function GetAlternates ( _
nodes As ContextNodeCollection, _
maximumAlternates As Integer _
) As AnalysisAlternateCollection
'Usage
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
Not applicable.
Parameters
- nodes
The nodes for which to get analysis alternates.
- maximumAlternates
The number of analysis alternates to return.
Return Value
Up to maximumAlternates of the top analysis alternates for nodes.
Remarks
The top alternate is returned as the first alternate of the collection.
The ContextNode objects in nodes do not have to represent adjacent areas of the document.
For each analysis hint in nodes, the InkAnalyzer returns only the top alternate.
Example
This example gets up to five of the top alternates for the ContextNodeCollection, theContextNodes
, associated with the InkAnalyzer, theInkAnalyzer
. It then adds the recognized strings for the alternates to the 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);
}
Platforms
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Version Information
.NET Framework
Supported in: 3.0
See Also
Reference
InkAnalyzer Class
InkAnalyzer Members
Microsoft.Ink Namespace
Microsoft.Ink.AnalysisAlternate
Microsoft.Ink.AnalysisAlternateCollection
Microsoft.Ink.ContextNode
Microsoft.Ink.ContextNodeCollection