Added in v0.18.0
Custom dictionary, corrections and post-processing
Speech models stumble on product names, colleagues' names and project jargon. Vocalinux gives you three tools for that: custom terms that steer Whisper-family engines toward your vocabulary, transcript corrections that fix known mishearings on every engine, and a script hook that can rewrite each result before it is typed.
Custom terms
A plain text list, one term per line, passed to the engine as context so it is more likely to spell those words your way.
Transcript corrections
Heard-as and replace-with pairs applied to every finished transcript, whatever the engine.
Post-processing script
Any executable that reads text on stdin and writes the replacement on stdout.
Set it up
- 1
Open the Custom Dictionary page
Open Settings from the tray menu and choose Custom Dictionary in the sidebar.
- 2
Add custom terms
Switch on Use custom terms, type a name or term into the Add a term field and click Add term. Or point Terms file at an existing UTF-8 file.
- 3
Add transcript corrections
Under Transcript corrections, enter what the engine writes (for example super base) and what you want instead (for example Supabase), then click Add correction.
- 4
Optionally set a post-processing script
Open the Post-Processing page, enter the path to an executable script in Script Path or click Browse…, and leave the field empty to turn it off.
- 5
Dictate
Both dictionary files are re-read before each completed segment, so changes apply to your next dictation without a restart.
Order of operations
- The engine transcribes your speech, biased by custom terms on Whisper, whisper.cpp and Faster Whisper.
- Transcript corrections replace known mishearings. This works with every engine.
- Voice commands are interpreted, if Voice Commands is on.
- The post-processing script, if set, rewrites the final text.
- The result is typed into the focused app, or appended to the Dictation Pad.
Because corrections come before voice commands, a correction can stop a mishearing from triggering a destructive command. The flip side: avoid replacements that are themselves command phrases. The command list is on the voice commands page.
Custom terms file
Terms live in ~/.config/vocalinux/dictionary.txt by default: UTF-8, one term per line. Blank lines and lines starting with # are skipped, and duplicates are ignored regardless of case. The plain line format is deliberate, so accessibility tools and scripts can maintain the same file.
# ~/.config/vocalinux/dictionary.txt
Supabase
Kubernetes
PipeWire
OkonkwoLimits and engine support
- Bias applies to Whisper, whisper.cpp and Faster Whisper. On whisper.cpp the terms are appended after anything in Advanced → Initial Prompt, so your own prompt is kept.
- Up to 200 terms are used by default (
dictionary.max_wordsin config.json), and the combined prompt stops at 2,000 characters. - The editor rejects a single term longer than 200 characters. A file larger than 1 MiB is read only up to its last complete line inside that limit.
Session-only terms file
To try a different list without touching saved settings, start Vocalinux with:
user@linux:~$ vocalinux --dictionary-file /path/to/dictionary.txtThe custom terms controls are disabled for that session. Transcript corrections still apply.
Transcript corrections file
Corrections are stored separately in ~/.config/vocalinux/custom-dictionary-corrections.json, always in the config directory, whatever terms file you use. The format is versioned:
{
"version": 1,
"corrections": [
{ "heard": "super base", "replacement": "Supabase" },
{ "heard": "pipe wire", "replacement": "PipeWire" }
]
}heardmatches case-insensitively, only as a whole word or phrase.replacementis inserted with exactly the spelling you typed.- Longer phrases win over shorter ones. For a repeated heard phrase, the first wins.
- Up to 500 corrections, each side up to 500 characters.
- Settings refuses to edit a hand-written file with extra fields or entries it would have to change. Fix the JSON, or edit it only by hand.
The post-processing script hook
The path is saved as post_processing.script_path (empty means off). For each completed segment, Vocalinux runs the file like this:
| Invocation | The path is executed directly, with no arguments and no shell. Use an absolute path to an executable file; ~ is not expanded. |
|---|---|
| stdin | The text of one segment, after corrections and voice commands. |
| stdout | The replacement text, used verbatim. One trailing newline is dropped if the input had none, so echo and print are safe; other newlines are kept. |
| Environment | Inherits Vocalinux's environment. When Vocalinux runs from the AppImage, the bundle's library paths are removed first. |
| Timeout | 10 seconds. |
| Failure | A non-zero exit, a timeout or a script that cannot start means the original text is used. Standard error is logged on a non-zero exit. |
| Empty output | Nothing is typed for that segment. |
| Ordering | Scripts run one at a time on a dedicated worker, in order, so a slow script does not interrupt dictation. A waiting segment is dropped if you switch to another app before it is typed, unless it is going to the Dictation Pad. |
Example: uppercase everything
The example from the Vocalinux user guide. Make it executable with chmod +x before setting the path.
#!/bin/bash
tr '[:lower:]' '[:upper:]'Example: typographic apostrophes in Python
Reads everything from stdin and writes it back without adding a newline. Any exception exits non-zero, so Vocalinux falls back to the original text.
#!/usr/bin/env python3
import sys
text = sys.stdin.read()
sys.stdout.write(text.replace("'", "\u2019"))Before pointing Vocalinux at a script, pipe a sample sentence into it from a terminal and check that it prints the text back. Output is not written to the log, but anything your script does with the text (files, network calls) is up to the script.
FAQ
Which engines use custom terms?
Vocabulary bias works with Whisper, whisper.cpp and Faster Whisper. Transcript corrections work with every engine, including VOSK, Parakeet and the Remote API.
Are corrections added to the vocabulary bias automatically?
No. Corrections and terms are separate. If you want the engine to lean toward a spelling as well as fix it afterwards, add it as a term too.
My correction triggered a voice command. Why?
Corrections run before voice commands. If a replacement is itself a command phrase, it will act as one. Choose replacement text that is not a voice command unless that is what you want.
My post-processing script runs but nothing changes. What should I check?
Vocalinux falls back to the original text when the script exits non-zero, cannot be started, or runs longer than 10 seconds. Make sure the file is executable, the path is absolute, and the script writes to standard output. The Vocalinux log records the exit code and standard error.
Why did a segment disappear after I added a script?
If the script exits successfully but prints nothing, Vocalinux types nothing for that segment. Make sure every code path writes the text back out.
Make dictation speak your language
Custom terms help most with a Whisper-family engine; the engine comparison and advanced settings pages cover the rest of the tuning. Developers may also like dictation for code.