Follow along with the runnable example. This guide walks through the Text replacements example in
corti-examples — bootstrap your build from it or use it as reference."BID" → "twice daily". They are supplied in the dictation configuration as a list of { find, replace } rules and applied server-side as the last step before a transcript message is returned.
This guide shows how to configure replacements through the Dictation Web Component and manage a reusable rule set.
For how replacements behave — case-insensitive matching, ordering relative to command detection, the per-connection limit, and worked examples — see the Replacement Rules reference. This page focuses on wiring them into your app.
Configure replacements
Add areplacements array to your dictationConfig. Each rule is a { find, replace } pair.
Because replacements are applied to the final text only, they never appear in interim results, and no special client-side handling is needed to receive them — the substituted text arrives inside the normal transcript message’s data.text.
Manage a rule set
In real apps the rules are rarely hard-coded — they come from a catalog plus user-defined entries. Model each rule with a stableid so it can be edited, removed, or protected, then derive the config array from the active set.
JavaScript
Export and share a rule set
To move a rule set between environments or check it into source control, serialize it in the config shape so it round-trips cleanly:corti-replacements.json
Next steps
Replacement Rules
Matching semantics, limits, and worked examples for the replacements feature.
Keyterms
Boost recognition of domain vocabulary before it reaches the transcript.
Example code
The complete, runnable Text replacements example in
corti-examples.Please contact us for help or questions.