Share via


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 function IsStringSupported(
    s : String
) : boolean

Parameters

  • s
    Type: System.String

    The string to look up in the dictionaries and word list.

Return Value

Type: System.Boolean
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 nulla 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.

Examples

In this example, a RecognizerContext object is instantiated, and a new WordList object assigned to its WordList property. The IsStringSupported method is then used to determine if a specified string is supported. If not, the string is added to the 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;
}

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

RecognizerContext Class

RecognizerContext Members

Microsoft.Ink Namespace

Factoid

WordList