rightkit_transcript/lib.rs
1//! `rightkit-transcript`: the shared word-timed transcript contract.
2//!
3//! Pipeline: producer (ASR, TTS manifest, SRT/VTT file) -> [`Transcript`] ->
4//! [`build_cues`] ([`CaptionConfig`]) -> [`to_srt`] / [`to_vtt`] / timing JSON.
5//!
6//! - [`contract`]: `rightkit.transcript.v1` (reads `cutright.transcript.v1`).
7//! - [`words`]: [`TimedWord`] normalisation and source -> output time mapping.
8//! - [`segment`]: deterministic cue segmentation with named profiles.
9//! - [`export`]: SRT, WebVTT, plain text, and the shared timing JSON.
10//! - [`parse`]: SRT/WebVTT/timing-JSON import (cues -> interpolated words).
11//! - [`align`]: cue-edge vs word-boundary check used by qualifiers.
12//!
13//! All times are integer milliseconds. No audio, no models, no I/O here:
14//! engines hand in `(text, start, end)` and apps write the strings out.
15
16pub mod align;
17pub mod contract;
18pub mod export;
19pub mod parse;
20pub mod segment;
21pub mod words;
22
23pub use align::{check_alignment, AlignmentIssue, ALIGNMENT_TOLERANCE_MS};
24pub use contract::{
25 EndSource, ModelRef, Span, Transcript, TranscriptError, Word, LEGACY_SCHEMA, SCHEMA,
26};
27pub use export::{to_plain_text, to_srt, to_timing_json, to_vtt, Newline};
28pub use parse::{parse_srt, parse_timing_json, parse_vtt, words_from_cues, ParseError, ParsedCue};
29pub use segment::{build_cues, normalize_words, CaptionConfig, Cue, Profile};
30pub use words::{words_from_seconds, words_from_transcript, TimedWord, MAP_DURATION_TOLERANCE_MS};