contextualStrings
Words or phrases, grouped by tag, that should be recognized even if they are not in the system vocabulary.
Declaration
final var contextualStrings: [AnalysisContext.ContextualStringsTag : [String]] { get set }Discussion
With the DictationTranscriber module, you can use this property to specify short custom phrases that are unique to your app. You might include phrases with the names of characters, products, or places that are specific to your app. Assigning custom phrases to this property improves the likelihood of those phrases being recognized.
Keep phrases relatively brief, limiting them to one or two words whenever possible. Lengthy phrases are less likely to be recognized. In addition, try to limit each phrase to something the user can say without pausing. Limit the total number of phrases across all tags to no more than 100.
You might also include domain-specific terminology or unusual or made-up words, but the system may not estimate their pronounciation correctly. You can provide a custom language model with correct pronounciations to DictationTranscriber by initializing it with a customizedLanguage(modelConfiguration:) content hint.
Use the tag to easily swap out some of the strings while leaving others in place. The framework provides a predefined general tag.