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

addPhrase(string)

Adds a single phrase to the current recognizer.

addPhrases(string[])

Adds multiple phrases to the current recognizer.

clear()

Clears all phrases added to the current recognizer.

fromRecognizer(Recognizer)

Creates a PhraseListGrammar from a given speech recognizer. Will accept any recognizer that derives from @class Recognizer.

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)

Creates a PhraseListGrammar from a given speech recognizer. Will accept any recognizer that derives from @class Recognizer.

static function fromRecognizer(recognizer: Recognizer)

Parameters

recognizer
Recognizer

The recognizer to add phrase lists to.

Returns