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