Skip to main content

Module parse

Module parse 

Source
Expand description

SRT / WebVTT / timing-JSON import. Cues carry no word timings, so words_from_cues spreads each cue’s words across its span by character count (flagged EndSource::Interpolated when put into a Transcript).

Structs§

ParsedCue

Enums§

ParseError

Functions§

parse_srt
Parse SubRip (CRLF/LF, BOM, optional numbering, , or . decimals).
parse_timing_json
Parse the shared timing JSON ({"segments":[..],"words":[..]}, seconds). Returns the word timings.
parse_vtt
Parse WebVTT (header, NOTE/STYLE blocks, cue ids/settings, MM:SS.mmm stamps).
words_from_cues
Spread each cue’s whitespace-separated words across [start, end) in proportion to character count. Words never overlap and tile the cue.