Share via


InkAnalyzer.GetAlternates Method (ContextNodeCollection)

Returns up to 10 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 _
) As AnalysisAlternateCollection
'Usage
Dim instance As InkAnalyzer 
Dim nodes As ContextNodeCollection 
Dim returnValue As AnalysisAlternateCollection 

returnValue = instance.GetAlternates(nodes)
public AnalysisAlternateCollection GetAlternates(
    ContextNodeCollection nodes
)
public:
AnalysisAlternateCollection^ GetAlternates(
    ContextNodeCollection^ nodes
)
public function GetAlternates(
    nodes : ContextNodeCollection
) : AnalysisAlternateCollection

Parameters

Return Value

Type: Microsoft.Ink.AnalysisAlternateCollection
Up to 10 of the top analysis alternates for nodes.

Remarks

The top alternate is returned as the first alternate of the collection. If there are more that 10 alternates, only the first 10 are returned.

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.

Examples

This example gets up to 10 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 analysis alternates for the context node collection and add the 
' recognized strings to a string collection.
theAlternateCollection = Me.theInkAnalyzer.GetAlternates(theContextNodes)
theAlternateStrings.Clear()
Dim theAlternate As Microsoft.Ink.AnalysisAlternate
For Each theAlternate In theAlternateCollection
    theAlternateStrings.Add(theAlternate.RecognizedString)
Next theAlternate
// Get analysis alternates for the context node collection and add the 
// recognized strings to a string collection.
theAlternateCollection = this.theInkAnalyzer.GetAlternates(theContextNodes);
theAlternateStrings.Clear();
foreach (Microsoft.Ink.AnalysisAlternate theAlternate
    in theAlternateCollection)
{
    theAlternateStrings.Add(theAlternate.RecognizedString);
}

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

InkAnalyzer Class

InkAnalyzer Members

GetAlternates Overload

Microsoft.Ink Namespace

Microsoft.Ink.AnalysisAlternate

Microsoft.Ink.AnalysisAlternateCollection

Microsoft.Ink.ContextNode

Microsoft.Ink.ContextNodeCollection