Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Light cleanup, the default style, stops deleting acronyms and hyphenated words

Open Beginner friendly
#356 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
macos, swift
Domain
desktop

Research direction

The filler regex is on the filler rule at DictationCleanup.swift:51, and its case-insensitivity comes from the rule compilation around line 40. Read the light cleanup path (DictationCleanup.light, then CleanupEngine.clean) and the existing cases in CleanupChecks.swift. Run LocalVoice --check-core (main.swift:848) before and after editing. Done when the five unchanged-word examples and the new umm/uhh/hmmm/erm filler check pass, and the existing checks still pass.

Written by the indexing model from the issue text.

Description

bug

Outcome: Light cleanup, the default text style, removes spoken fillers and nothing else. 'ERM', 'HMM', 'UM', 'UH', 'Uh-huh' and 'Mm-hmm' come back exactly as dictated.

Evidence (train head 14d06bc)
  • Every Light rule compiles case-insensitive (DictationCleanup.swift:40). The filler rule at :51, \b(?:u+m+|u+h+|e+rm+|hmm+)\b[,\s]*, therefore also matches the acronyms ERM, HMM, UM and UH, and it stops at a hyphen.
  • Run through NSRegularExpression, the engine the app uses:
    • 'We need to review the ERM framework.' becomes 'We need to review the framework.'
    • 'Train an HMM on the data.' becomes 'Train an on the data.'
    • 'The UM campus' becomes 'The campus'.
    • 'Uh-huh, sounds good.' becomes '-huh, sounds good.'
    • 'Mm-hmm, that works.' becomes 'Mm-that works.'
  • Light is the default (VoicePreferences.swift:74). Every dictation passes through CleanupEngine.clean (AppModel.swift:652, then Cleanup.swift:22), and Natural starts from Light's output (Cleanup.swift:22-23).
  • Dictionary replacements run after cleanup (AppModel.swift:656), so a dictionary entry cannot bring a deleted word back.
  • With live words on, owned.finish(result) (AppModel.swift:689) replaces the live span with the cleaned result, so the deleted word also disappears from the field.
  • The contract calls Light conservative (docs/dictation-comparison.md:15) and says all-caps acronyms keep their dictated spelling (docs/live-voice.md:64).
  • CleanupChecks.swift:17-37 has no acronym or hyphenated case.
Change
  • Change only the filler rule at DictationCleanup.swift:51. An inline flag turns case-insensitivity off for this one pattern, and the rule refuses to match inside a word, a hyphenated word or an all-caps acronym:
    (?-i)(?<![\p{L}\p{N}-])(?:[Uu]u*m+|[Uu]u*h+|[Ee]e*rm+|[Hh]mm+)(?![\p{L}\p{N}-])[,\s]*
  • It still removes the drawn-out forms it removes today: umm, uhh, uum, hmmm and erm.
  • Add one comment above it: fillers match only their spoken forms, so acronyms and hyphenated words survive.
  • Leave the repeat rule (:53), the opening-Okay rule (:52) and rockmelon (:54) as they are. Narrowing the repeat rule would stop common 'the, the' stutters from merging, and whether a leading 'Okay,' is filler is a product call.
Acceptance

LocalVoice --check-core runs CleanupChecks.run() (main.swift:848). Add these checks:

  • DictationCleanup.light returns each of these unchanged; each fails on 14d06bc:
    • 'We need to review the ERM framework.'
    • 'Train an HMM on the data.'
    • 'The UM campus and UH staff met.'
    • 'Uh-huh, sounds good.'
    • 'Mm-hmm, that works.'
  • New filler check: 'Umm, I'll uh call you. Hmmm, erm, yes.' gives 'I'll call you. Yes.'
  • Existing checks still pass: 'Um, I, I think we should go. Uh, bring a coat.', CleanupStyle.light.example, and the full fixture with rockmelon.
Value before scope
  1. Outcome: the default style never deletes a word someone said. Evidence above.
  2. Simpler route: one regex. No new style or setting.
  3. Owner: DictationCleanup.light.
  4. Complexity: none added. An all-caps 'UM,' is no longer removed, and a recogniser that capitalises normally does not produce one.
  5. Verified by: --check-core.

Grammar: Quality.

Refs #7


Build-ready record from the 15 Oct round-three pass (delight and code-base value), verified against the release train head 14d06bc by an independent skeptic per item. Closes only after native acceptance.

Dominant language
Swift
Stars
0
Forks
1
Avg merge
8h 5m
Merged PRs (30d)
215

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Ship-Work/workbench

All issues in Ship-Work/workbench

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.