Skip to content

Support mishearing-to-correction mappings in custom vocabulary (closes #125)#269

Open
swimmer-303 wants to merge 2 commits into
zachlatta:mainfrom
swimmer-303:split/vocab-mappings
Open

Support mishearing-to-correction mappings in custom vocabulary (closes #125)#269
swimmer-303 wants to merge 2 commits into
zachlatta:mainfrom
swimmer-303:split/vocab-mappings

Conversation

@swimmer-303

@swimmer-303 swimmer-303 commented Jul 11, 2026

Copy link
Copy Markdown

Split out from #254.

Vocabulary entries can map heard forms to the intended term with an arrow — cloud code -> Claude Code — and multiple heard forms can share one correction: cloud code | clod code -> Claude Code. Pairs are passed to the post-processing model as an explicit corrections block (with a guard against over-applying); plain entries behave exactly as before. Parser verified against plain entries, single/multi-variant mappings, mixed comma-separated lines, =>, and malformed input. Settings hint text and README document the syntax.

Closes #125

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Custom vocabulary now supports correcting specific mishearings with arrow mappings, such as cloud code -> Claude Code.
    • Multiple heard variants can share one correction using |.
    • Corrections are applied when context indicates the intended term.
  • Documentation

    • Updated the settings guidance, README, and changelog with the new vocabulary syntax.

Vocabulary entries can now map heard forms to the intended term with
an arrow ("cloud code -> Claude Code"), with "|" separating multiple
heard forms. Pairs are passed to the post-processing model as an
explicit corrections block in both dictation and Edit Mode prompts;
plain entries behave exactly as before.

Closes zachlatta#125

(cherry picked from commit cc4659e)
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d5974a0-50e6-4706-9100-53ed4cd7e168

📥 Commits

Reviewing files that changed from the base of the PR and between 7427ca9 and dc42e65.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • README.md
  • Sources/PostProcessingService.swift
  • Sources/SettingsView.swift

📝 Walkthrough

Walkthrough

Custom vocabulary now supports explicit heard-to-corrected mappings, multiple heard variants, and malformed-entry fallback handling. The post-processing prompt, settings guidance, README, and changelog document and use the new syntax.

Changes

Custom vocabulary mappings

Layer / File(s) Summary
Mapping parsing and prompt integration
Sources/PostProcessingService.swift
Parses heard -> correct and heard => correct mappings, supports `
Input guidance and documentation
Sources/SettingsView.swift, README.md, CHANGELOG.md
Documents arrow-based corrections and multiple heard variants while retaining plain vocabulary entries.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SettingsView
  participant PostProcessingService
  participant LanguageModel
  SettingsView->>PostProcessingService: custom vocabulary entries
  PostProcessingService->>PostProcessingService: parse heard-to-corrected mappings
  PostProcessingService->>LanguageModel: prioritized terms and known mishearings prompt
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding mishearing-to-correction mappings in custom vocabulary.
Linked Issues check ✅ Passed The PR implements explicit heard-to-correct mappings, supports multiple heard variants, and keeps plain entries backward compatible as requested in #125.
Out of Scope Changes check ✅ Passed The docs and prompt wiring changes stay aligned with the mapping feature and documentation requirements; no unrelated scope is evident.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map misspellings → corrections, not just a single-term dictionary

1 participant