SDK Reference · Method
loadContextualPhrases (Array)
Loads contextual phrases and their pronunciation mappings for speech recognition.
Declaration
public func loadContextualPhrases(
_ contextualPhrases: [String: String]
) -> STResultOverview
Contextual phrases can help the recognizer handle names, places, specialized vocabulary, and other terms that may otherwise be recognized less accurately. The dictionary value supplies the pronunciation/phonetic mapping used for the corresponding phrase.
The audio recorder must be initialized.
Example
let result = STMediaRunner.shared.loadContextualPhrases([
"Quvenzhané Wallis": "Kwuh-ven-zha-nay Wallis",
"Gstaad": "Shtahd",
"Saoirse": "Sur-sha"
])