Skip to content

fix(cli): preserve readable subtitle boundaries - #3583

Merged
LauraGPT merged 1 commit into
mainfrom
codex/fix-subtitle-word-boundaries-3539
Aug 30, 2026
Merged

fix(cli): preserve readable subtitle boundaries#3583
LauraGPT merged 1 commit into
mainfrom
codex/fix-subtitle-word-boundaries-3539

Conversation

@LauraGPT

Copy link
Copy Markdown
Collaborator

Summary

  • replace greedy long-cue splitting with a minimum-cue dynamic program that balances cue length and duration
  • prefer Jieba word boundaries, terminal punctuation, script transitions, and real timestamp gaps
  • down-weight single-character lexical boundaries so phrases such as 扭了一下 are not split mechanically
  • preserve the existing 8 second / 42 character limits and fail-closed behavior for invalid timestamps

Root cause

The previous splitter treated each CJK character as an equally good cut point and filled each cue greedily to the hard limit. On the reporter sample this produced cross-word boundaries such as 成 / 为 and 扭 / 了一下, plus a short tail cue.

Validation

  • red/green regression coverage for the reporter sentence and repeated single-character phrase boundaries
  • 29 focused CLI and subtitle tests passed on exact head
  • exact reporter audio SHA-256: 3bd5bae68cbd6c4611be1902aefd369faa5b46a305c38085bc7d7c250686752b
  • frozen raw inference JSON SHA-256: 8943a3883483ccfc8d9f112c200a67e91b1beb57f6fb59bd9bc8d141d4e84588
  • real sample: 84 source segments -> 133 cues; max 7,860 ms; max 42 chars; 0 duration or character-limit violations
  • SSH signed commit and DCO sign-off verified

Tracks #3539. Keep the issue open until the reporter retests the actual subtitle readability.

Signed-off-by: LauraGPT <18321252+LauraGPT@users.noreply.github.com>
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