Поделиться через


RecognizerContext.IsStringSupported - метод

Обновлен: Ноябрь 2007

Returns a value that indicates whether the system dictionary, user dictionary, or WordList contain a specified string.

Пространство имен:  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
    The string to look up in the dictionaries and word list.

Возвращаемое значение

Тип: 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

Заметки

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 nullссылка null (Nothing в 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.

Примеры

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;
}

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

RecognizerContext Класс

RecognizerContext - члены

Microsoft.Ink - пространство имен

Factoid

WordList