傳回值,這個值表示系統字典、使用者字典或 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® Office 語音辨識 |
沒有啟用 Microsoft® Office 語音辨識 |
|---|---|---|
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