fix: merge curly-apostrophe contractions; add Claude/ChatGPT/Codex/bloat compound merges - #7
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
CONTRACTIONonly 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.