RecognizerContext.IsStringSupported 方法

返回一个值,该值指示系统字典用户字典WordList 是否包含指定的字符串。

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

语法

声明
Public Function IsStringSupported ( _
    s As String _
) As Boolean
用法
Dim instance As RecognizerContext
Dim s As String
Dim returnValue As Boolean

returnValue = instance.IsStringSupported(s)
public bool IsStringSupported(
    string s
)
public:
bool IsStringSupported(
    String^ s
)
public boolean IsStringSupported(
    String s
)
public function IsStringSupported(
    s : String
) : boolean

参数

  • s
    类型:System.String
    要在字典和单词列表中查找的字符串。

返回值

类型:System.Boolean
一个值,指示系统字典用户字典WordList 是否包含指定的字符串。

含义

true

该字符串位于字典或单词列表中

false

该字符串既不在字典也不在单词列表中

备注

此方法会考虑为所测试的字符串提供上下文的所有标志及智能标记 等设置。

IsStringSupported 方法根据 Microsoft Office 中是否启用了语音来检查系统字典、用户字典和 WordList。下表列出了识别器检查指定字符串的位置。

WordList 条件

启用了 Microsoft(R) Office 语音识别

未启用 Microsoft(R) Office 语音识别

已设置 WordList

WordList

WordList

WordList 为nullnull 引用(在 Visual Basic 中为 Nothing)

用户字典和系统字典

系统字典

使用 Factoid 属性可将搜索范围限定为系统字典或与上下文关联的单词列表。例如,若要将搜索范围限定为系统字典,请指定 SystemDictionary 智能标记。若要改进结果,可能还需要设置 RecognitionFlags 属性。

示例

此示例将实例化 RecognizerContext 对象,并向其 WordList 属性分配一个新的 WordList 对象。然后,使用 IsStringSupported 方法确定是否支持指定字符串。如果不支持,则将该字符串添加到 WordList 中。

Dim RC As RecognizerContext = New RecognizerContext()
RC.WordList = New WordList()
Dim testStr As String = "thunk"
If Not RC.IsStringSupported(testStr) Then
    Dim WL As WordList = RC.WordList
    WL.Add(testStr)
    ' testStr is not available for use in recognition
    ' until the WordList property is re-assigned
    RC.WordList = WL
End If
RecognizerContext RC = new RecognizerContext();
RC.WordList = new WordList();
string testStr = "thunk";
if (!RC.IsStringSupported(testStr))
{
    WordList WL = RC.WordList;
    WL.Add(testStr);
    // testStr is not available for use in recognition
    // until the WordList property is re-assigned
    RC.WordList = WL;
}

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

RecognizerContext 类

RecognizerContext 成员

Microsoft.Ink 命名空间

Factoid

WordList