AnalysisAlternate 类

表示 ContextNode 对象的一个可能的手写识别单词匹配项。

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

语法

声明
Public Class AnalysisAlternate
用法
Dim instance As AnalysisAlternate
public class AnalysisAlternate
public ref class AnalysisAlternate
public class AnalysisAlternate
public class AnalysisAlternate

备注

因为用户的手写内容之间差异很大,所以识别器转换手写内容所获得的文本有时与用户的预期不同。InkAnalyzerStrokeCollection 执行分析时,InkAnalyzer 查找手写内容最可能表示的一组单词。此外,InkAnalyzer 还将查找备选识别匹配项的集合,这些匹配项存储在 AnalysisAlternateCollection 中。为了让用户利用识别备选项,您必须创建一个用户界面让用户选择正确的 AnalysisAlternate。

通常通过 InkAnalyzer.GetAlternates 方法获取 AnalysisAlternate 对象。集合中的第一个 AnalysisAlternate 对象是 InkAnalyzer 认为最有可能的备选项。

示例

此示例对名为 theInkAnalyzer 的 InkAnalyzer 调用 GetAlternates。然后,此示例遍历 AnalysisAlternateCollection,并使用识别置信级别不为 Poor 的所有备选项填充 ListBox (alternatesListBox)。

alternatesListBox.Items.Clear()
Me.currentAlternates = theInkAnalyzer.GetAlternates(selectedSubNodes)
Dim alternate As AnalysisAlternate
For Each alternate In  Me.currentAlternates
    ' Add only those that are not Poor confidence
    If alternate.InkRecognitionConfidence <> InkRecognitionConfidence.Poor Then
        alternatesListBox.Items.Add(alternate.RecognizedString)
    End If
Next alternate
alternatesListBox.Items.Clear();
this.currentAlternates = theInkAnalyzer.GetAlternates(selectedSubNodes);
foreach (AnalysisAlternate alternate in this.currentAlternates)
{
    alternatesListBox.Items.Add(alternate.RecognizedString);
    // Add only those that are not Poor confidence.
    if (alternate.InkRecognitionConfidence !=
        InkRecognitionConfidence.Poor)
    {
        alternatesListBox.Items.Add(alternate.RecognizedString);
    }
}

继承层次结构

System.Object
  System.Windows.Ink.AnalysisAlternate

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

AnalysisAlternate 成员

System.Windows.Ink 命名空间

System.Windows.Ink.AnalysisAlternateCollection

InkAnalyzer.GetAlternates