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`; see
7//! [`ACCEPTED_SCHEMAS`]), strict and lenient JSON reads, `constrain_duration`.
8//! - [`words`]: [`TimedWord`] normalisation and source -> output time mapping.
9//! - [`segment`]: deterministic cue segmentation with named profiles, plus the
10//! lightweight [`group_words`] grouper for already-clean engine words.
11//! - [`export`]: SRT, WebVTT, plain text, and the shared timing JSON.
12//! - [`parse`]: SRT/WebVTT/timing-JSON import (cues -> interpolated words).
13//! - [`align`]: cue-edge vs word-boundary check used by qualifiers.
14//!
15//! All times are integer milliseconds. No audio, no models, no I/O here:
16//! engines hand in `(text, start, end)` and apps write the strings out.
17
18pub mod align;
19pub mod contract;
20pub mod export;
21pub mod parse;
22pub mod segment;
23pub mod words;
24
25pub use align::{check_alignment, AlignmentIssue, ALIGNMENT_TOLERANCE_MS};
26pub use contract::{
27 EndSource, ModelRef, Span, Transcript, TranscriptError, Word, ACCEPTED_SCHEMAS, LEGACY_SCHEMA,
28 SCHEMA,
29};
30pub use export::{to_plain_text, to_srt, to_timing_json, to_vtt, Newline};
31pub use parse::{parse_srt, parse_timing_json, parse_vtt, words_from_cues, ParseError, ParsedCue};
32pub use segment::{
33 build_cues, cues_from_spans, group_words, normalize_words, CaptionConfig, Cue, GroupRules,
34 Profile,
35};
36pub use words::{words_from_seconds, words_from_transcript, TimedWord, MAP_DURATION_TOLERANCE_MS};