uttrflow / uttrflow/uttrflow-swift
SpokenPunctuationPass keeps a dictated comma as a word when a determiner opens the noun phrase before it
- Dominant language
- Swift
- Stars
- 4
- Forks
- 17
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 277
Description
`SpokenPunctuationPass` refuses a spoken comma that ends a noun phrase opened by a determiner, so a comma the speaker plainly dictated stays a word.
`MentionGuard.isMentioned` is called with `reach: MentionGuard.phraseReach` (3), so a determiner up to three words back makes the mark name a mention. That reach exists for "the trial period" and "the 100 metre dash", where the name heads the noun phrase. It also fires when the name only follows a noun phrase:
```
if the tests pass comma we ship tonight -> comma kept as a word
the cafe by the station comma which opens early ... -> comma kept as a word
pack the charger comma the cable comma and the adapter -> both commas kept as words
```
Measured with `make bakeoff --baselines-only` on the branch for #237: all three fail on rules, Apple and shipping, both before and after that change. They are in the corpus as `spoken-comma-before-a-clause`, `spoken-commas-around-a-clause` and `spoken-commas-in-a-list`.
Why this is not a one-line fix: the same shape is a real mention for a name that heads its phrase, "the 100 metre dash was close", and the word after the name ("was", "we") is a function word in both. Shortening the reach for "comma" alone may be defensible, since "comma" rarely heads a modified noun phrase, but that needs its own corpus cases for the mention side first.
Found while measuring #237; left out of that fix because it moves a different guard.
Contributor guide
Research direction
Locate SpokenPunctuationPass and MentionGuard.isMentioned, then run `make bakeoff --baselines-only` for the three named corpus cases: spoken-comma-before-a-clause, spoken-commas-around-a-clause, and spoken-commas-in-a-list. Read the existing mention examples and add coverage for both rejected commas and valid noun-phrase mentions; done means the comma cases pass without regressing those mentions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- accessibility, desktop, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 56/100