PhraseListGrammar class
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.
Methods
add |
Adds a single phrase to the current recognizer. |
add |
Adds multiple phrases to the current recognizer. |
clear() | Clears all phrases added to the current recognizer. |
from |
Creates a PhraseListGrammar from a given speech recognizer. Will accept any recognizer that derives from |
set |
Sets the phrase list grammar biasing weight. The allowed range is [0.0, 2.0]. The default weight is 1.0. Value zero disables the phrase list. |
Method Details
addPhrase(string)
Adds a single phrase to the current recognizer.
function addPhrase(phrase: string)
Parameters
- phrase
-
string
Phrase to add.
addPhrases(string[])
Adds multiple phrases to the current recognizer.
function addPhrases(phrases: string[])
Parameters
- phrases
-
string[]
Array of phrases to add.
clear()
Clears all phrases added to the current recognizer.
function clear()
fromRecognizer(Recognizer | ConversationTranscriber | MeetingTranscriber)
Creates a PhraseListGrammar from a given speech recognizer. Will accept any recognizer that derives from
static function fromRecognizer(recognizer: Recognizer | ConversationTranscriber | MeetingTranscriber): PhraseListGrammar
Parameters
- recognizer
The recognizer to add phrase lists to.
Returns
setWeight(number)
Sets the phrase list grammar biasing weight. The allowed range is [0.0, 2.0]. The default weight is 1.0. Value zero disables the phrase list.
function setWeight(weight: number)
Parameters
- weight
-
number
Phrase list grammar biasing weight.