uttrflow / uttrflow/uttrflow-swift

Removing a filler between commas also removes the comma the sentence needed: "Well, um, I think so." becomes "Well I think so."

Open
#723 0 comments 0 reactions 0 assignees View on GitHub
area:dictation bug needs-info P2
Dominant language
Swift
Stars
4
Forks
17
Avg merge
3h 32m
Merged PRs (30d)
277

Description

## What happens

When `FillersPass` removes a filler that carries a comma and the word before it also ends in a comma, it takes that earlier comma too (`Sources/UttrflowAI/Passes/FillersPass.swift:29-34`), and the filler's own comma goes with the filler (`Draft.carryMarks`, `Sources/UttrflowCore/Cleaning/Draft.swift:216-218`). `Docs/cleanup.md` (the "The mark on a word that goes" row) states the intent: the commas were the pause the filler stood in, so "we should, uh, ship it" becomes "we should ship it".

That is right when the commas belong only to the filler, and wrong when the comma before it also belongs to the sentence: after an interjection or sentence adverb that opens the sentence, or between two clauses. Measured through `CleaningPipeline.standard` in a throwaway test:

| Recogniser text | Expected | Actual |
|---|---|---|
| `The deadline is, um, Friday.` | `The deadline is Friday.` | `The deadline is Friday.` (right) |
| `Well, um, I think so.` | `Well, I think so.` | `Well I think so.` |
| `I think, uh, that's right, uh, yeah.` | `I think that's right, yeah.` | `I think that's right yeah.` |
| `Um, so, I think we should go.` | `So, I think we should go.` | `So, I think we should go.` (right, no word before) |

Also measured: `Yes, um, I agree.` → `Yes I agree.` and `Okay, uh, let's start.` → `Okay let's start.`

## Why it matters

Answers that open with "Yes", "No", "Well", "Okay" or "Thanks" followed by a hesitation are among the most common things people dictate into chat and email, and the result reads as a punctuation mistake the user did not make. The recogniser had placed the comma correctly.

## How to reproduce

Add the rows above to `Tests/UttrflowAITests/Passes/FillersPassTests.swift` (or `StandardPipelineTests.swift`).

## Acceptance criteria

- Keep the comma before a removed filler when the word before it is a sentence-opening interjection or discourse word (a small closed list such as yes, no, yeah, okay, ok, well, thanks, so, now, actually) or when that comma follows the first word of the sentence; keep today's behaviour for a filler inside a clause ("The deadline is, um, Friday.").
- Or, if that list is judged too loose, say so in `Docs/cleanup.md` with the examples above; this needs a product call on which side of the trade to take, hence `needs-info`.
- Tests pin the rows above, including the ones that are already right.

## Where to start

- `Sources/UttrflowAI/Passes/FillersPass.swift:20-38`, `Docs/cleanup.md` (Hesitation sounds, and The mark on a word that goes).

Contributor guide

Open the contributing guide

Research direction

Start with Sources/UttrflowAI/Passes/FillersPass.swift:20-38 and the mark behavior in Sources/UttrflowCore/Cleaning/Draft.swift:216-218; read the related guidance in Docs/cleanup.md. Add the listed cases to Tests/UttrflowAITests/Passes/FillersPassTests.swift or StandardPipelineTests.swift and measure them through CleaningPipeline.standard. Done means the expected punctuation is pinned, existing correct behavior remains, and the product choice is reflected in the implementation or Docs/cleanup.md.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.