PhraseListGrammar Class
- java.
lang. Object - com.
microsoft. cognitiveservices. speech. Grammar - com.
microsoft. cognitiveservices. speech. PhraseListGrammar
- com.
- com.
Implements
public final class PhraseListGrammar
extends Grammar
implements java.lang.AutoCloseable
Allows additions of new phrases to improve speech recognition. Phrases added to the recognizer are effective at the start of the next recognition, or the next time the SpeechSDK must reconnect to the speech service. Note: close() must be called in order to release underlying resources held by the object. Added in version 1.5.0
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
addPhrase(String phrase)
Adds a single phrase to the current recognizer. |
void |
clear()
Clears all phrases added to the current recognizer. |
void |
close()
Dispose of associated resources. |
static
Phrase |
fromRecognizer(Recognizer recognizer)
Creates a Phrase |
Methods inherited from Grammar
Methods inherited from java.lang.Object
Method Details
addPhrase
public void addPhrase(String phrase)
Adds a single phrase to the current recognizer.
Parameters:
clear
public void clear()
Clears all phrases added to the current recognizer.
close
public void close()
Dispose of associated resources.
Overrides:
PhraseListGrammar.close()fromRecognizer
public static PhraseListGrammar fromRecognizer(Recognizer recognizer)
Creates a PhraseListGrammar from a given speech recognizer. Will accept any recognizer that derives from Recognizer.
Parameters:
Returns: