Skip to content

fix: merge curly-apostrophe contractions; add Claude/ChatGPT/Codex/bloat compound merges - #7

Merged
zeke merged 4 commits into
mainfrom
fix/apostrophe-and-compound-words
Jul 29, 2026
Merged

fix: merge curly-apostrophe contractions; add Claude/ChatGPT/Codex/bloat compound merges#7
zeke merged 4 commits into
mainfrom
fix/apostrophe-and-compound-words

Conversation

@zeke

@zeke zeke commented Jul 29, 2026

Copy link
Copy Markdown
Owner

This PR fixes two caption bugs found while captioning the pi-school-intro video.

whisper.cpp emits curly apostrophes (U+2019) in contractions like isn't, didn't, it's, but CONTRACTION only matched the straight ASCII apostrophe, so these words never merged and rendered with a stray space ("It 's"). The regex now accepts both.

Also adds compound-word merges for tokenizer splits observed in the wild: Claude -> Cla+ude, ChatGPT -> Chat+G+P+T, Codex -> Code+x, bloat -> blo+at.

zeke added 4 commits July 28, 2026 18:58
…oat compound merges

whisper.cpp emits curly apostrophes (U+2019) in contractions like isn't,
didn't, it's, but CONTRACTION only matched the straight ASCII apostrophe,
so these words never merged and rendered with a stray space ("It 's").

Also add compound-word merges for tokenizer splits observed in the wild:
Claude -> Cla+ude, ChatGPT -> Chat+G+P+T, Codex -> Code+x, bloat -> blo+at.
- unadulterated was split by whisper into un+ad+ul+ter+ated, now merges back
- FONT_SIZE 72 -> 56 (and proportional PAD_X/PAD_Y/CORNER_R) — captions were
  oversized on portrait/smaller-resolution videos
whisper.cpp sometimes splits Claude as Cla+ude and other times as Claud+e
depending on surrounding audio/context. Add the second split pattern too.
Chunks whose text exceeded the caption box width were overflowing past
the frame edges instead of wrapping. Shrinks default font size, wraps
words greedily to fit MAX_CAPTION_WIDTH_RATIO of the frame, and grows
the box height/position per-anchor to fit multi-line chunks.
@zeke
zeke merged commit 027f149 into main Jul 29, 2026
1 check 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