GrammarList Class
- java.
lang. Object - com.
microsoft. cognitiveservices. speech. Grammar - com.
microsoft. cognitiveservices. speech. GrammarList
- com.
- com.
Implements
public final class GrammarList
extends Grammar
implements java.lang.AutoCloseable
Allows adding multiple grammars to a SpeechRecognizer to improve the accuracy of speech recognition. GrammarLists are only usable in specific scenarios and are not generally available. Note: close() must be called in order to release underlying resources held by the object.
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
add(Grammar grammar)
Adds a single grammar to the current recognizer. |
void |
close()
Dispose of associated resources. |
static
Grammar |
fromRecognizer(Recognizer recognizer)
Creates a Grammar |
Methods inherited from Grammar
Methods inherited from java.lang.Object
Method Details
add
public void add(Grammar grammar)
Adds a single grammar to the current recognizer.
Parameters:
close
public void close()
Dispose of associated resources.
Overrides:
GrammarList.close()fromRecognizer
public static GrammarList fromRecognizer(Recognizer recognizer)
Creates a GrammarList from a given speech recognizer. Creating a grammar list from a recognizer is only usable in specific scenarios and is not generally available.
Parameters:
Returns: