Unique name for this graph. Must not contain the - (hyphen) character.
Array of phrase arrays, one per context.
contextsPhrases[0] is context 0, contextsPhrases[1] is context 1, etc.
Optionaloptions: {Optional configuration (same as createDecodingGraphFromPhrases).
true if the graph was created successfully.
await createContextualDecodingGraphFromPhrases('reading', [
['Alice was beginning to get very tired'], // page 0
['And what is the use of a book'], // page 1
['When suddenly a White Rabbit appeared'], // page 2
]);
// Switch to page 1
await prepareForListeningWithContextualDecodingGraph('reading', 1);
Create a contextual decoding graph from multiple phrase groups.
A contextual decoding graph contains multiple "contexts" (phrase sets) that can be switched at runtime without rebuilding the graph. This is useful for multi-page reading, multi-step workflows, or any scenario where the expected vocabulary changes dynamically.
After creation, activate a specific context using prepareForListeningWithContextualDecodingGraph.