RecognizerContext.IsStringSupported Method
Returns a value that indicates whether the system dictionary, user dictionary, or WordList contain a specified string.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)
Syntax
'Declaration
Public Function IsStringSupported ( _
s As String _
) As Boolean
'Usage
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
Not applicable.
Parameters
- s
The string to look up in the dictionaries and word list.
Return Value
A value that indicates whether the system dictionary, user dictionary, or WordList contain a specified string.
Value |
Meaning |
---|---|
true |
The string is in the dictionary or word list |
false |
The string is in neither the dictionary nor the word list |
Remarks
This method considers all flags and factoid, among other things, that give context to the string that is being tested.
The IsStringSupported method checks the System dictionary, user dictionary, and WordList depending on whether speech is enabled in Microsoft Office. The following table lists the places the Recognizer checks for the specified string.
WordList condition |
Microsoft® Office speech recognition is enabled |
Microsoft® Office speech recognition is not enabled |
---|---|---|
WordList is set |
WordList |
WordList |
WordList is a null reference (Nothing in Visual Basic) |
User Dictionary and System Dictionary |
System Dictionary |
Use the Factoid property to limit the search to the system dictionary or the word list that is associated with the context. For example, to limit the search to the system dictionary, specify the SystemDictionary factoid. To improve the results, you may also need to set the RecognitionFlags property.
Example
This C# example uses the IsStringSupported method to query the WordList object that is used by the RecognizerContext object, theRecognizerContext
, for a specific string, "thunk". If "thunk" is not in the word list, it is then added to the word list.
String theString = "thunk";
WordList theWordList = theRecognizerContext.WordList;
if (!theRecognizerContext.IsStringSupported(theString))
{
theWordList.Add(theString);
theRecognizerContext.WordList = theWordlist;
}
This Microsoft® Visual Basic® .NET example uses the IsStringSupported method to query the WordList object that is used by the RecognizerContext object, theRecognizerContext
, for a specific string, "thunk". If "thunk" is not in the word list, it is then added to the word list.
Dim theString as String
theString = "thunk"
Dim theWordList As WordList
Set theWordList = theRecognizerContext.WordList
If Not theRecognizerContext.IsStringSupported(theString) Then
theWordList.Add(theString)
TheRecognizerContext.WordList = theWordList
End If
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
RecognizerContext Class
RecognizerContext Members
Microsoft.Ink Namespace
Factoid
WordList