Expand description
Cue segmentation: phrase grouping, splitting, merging, line breaking.
Donor: CutRight cutright-captions (itself ported from video-media’s
caption model). Deterministic: identical words + config give identical cues.
Structs§
- Caption
Config - Per-profile segmentation limits.
- Cue
- One caption cue on the output timeline. Cues never overlap.
- Group
Rules - Rules for
group_words, the lightweight cue grouper for engines whose words are already clean (no line breaking, no reading-speed limits). Usebuild_cuesfor caption-grade segmentation.
Enums§
- Profile
- Named segmentation profile (replaces CutRight’s timeline
Preset).
Functions§
- build_
cues - Builds non-overlapping cues from output-time words.
- cues_
from_ spans - One single-line cue per span, in order (
first_word == last_word ==the span’s index), widened tomin_cue_ms. For callers that already hold cues asTimedWordspans (text = cue text) and only need export. - group_
words - Groups words (in order, not re-normalised) into single-line cues by
GroupRules.first_word/last_wordindex the input slice. A cue closes on sentence-final punctuation (aftersentence_min_wordswords), atmax_words, atmax_span_ms, or on a gap overmax_gap_ms. - normalize_
words - Trims, drops empty/zero-length words, collapses inner whitespace and clamps overlaps so each word ends no later than the next starts.