Skip to content

feat: Dictionary — custom replacements & spoken snippets - #105

Merged
karansinghgit merged 2 commits into
mainfrom
feat/dictionary
Jul 10, 2026
Merged

feat: Dictionary — custom replacements & spoken snippets#105
karansinghgit merged 2 commits into
mainfrom
feat/dictionary

Conversation

@karansinghgit

Copy link
Copy Markdown
Owner

What

A Dictionary feature (inspired by Wispr Flow), reworked for a fully-local app. Map a spoken phrase to any output text:

  • Say "my email" → inserts your address (text expansion / snippets)
  • Fix a name/term the model keeps mishearing (spelling correction)

Rules run offline as a post-processing pass on the final transcript.

How it works

  • DictionaryServiceCodable entries persisted as JSON in UserDefaults (mirrors HistoryService). Thread-safe static apply(to:). One-time migration imports the old freeform customReplacementRules string into structured entries, so existing rules are preserved.
  • Applied in TranscriptionManager.transcribe so it covers both engines (Whisper and Parakeet). The old customReplacementRules only ran on the Whisper path — Parakeet silently skipped it. Removed that duplicated code from WhisperService; filler-word removal stays behind the Auto Edit toggle.
  • New Dictionary sidebar screen: add/edit/delete, per-rule enable + whole-word toggles. Settings "Transcript Cleanup" now points here.

Notes

Test plan

  • Dictionary tab → Add Rule ("my email" → an address); dictate → address is inserted.
  • Existing customReplacementRules migrate into entries on first launch.
  • Leaving the replacement empty deletes the phrase.

Adds a Dictionary sidebar screen where you map a spoken phrase to any text —
say "my email" and get your address inserted, or fix a term the model keeps
mishearing. Rules run fully offline as a post-processing pass.

- DictionaryService: Codable entries persisted as JSON in UserDefaults
  (mirrors HistoryService); thread-safe static apply(to:); one-time migration
  of the old freeform `customReplacementRules` string into structured entries.
- Applied in TranscriptionManager.transcribe so it covers BOTH engines
  (Whisper + Parakeet). Previously custom replacements were Whisper-only.
- Removed the now-duplicated replacement code from WhisperService; filler-word
  removal stays behind the Auto Edit toggle.
- New Dictionary sidebar item + screen with add/edit/delete and per-rule
  enable + whole-word toggles. Settings now points here instead of the old
  freeform text box.
@karansinghgit
karansinghgit merged commit 91d02d2 into main Jul 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant