pub fn segment_transcript(
text: &str,
policy: &SegmentationPolicy,
) -> Result<SegmentationOutcome, MemoryError>Expand description
Segment text under policy — see the module docs for the full
pipeline. Pure: no I/O, no clock, no randomness; the same text +
policy always produce byte-identical output.
§Errors
MemoryError::ContextOverLimit when text exceeds
MAX_TRANSCRIPT_BYTES, when SegmentFormat::Jsonl is forced but a
line does not parse as a {role, content} object, when an unsplittable
fence exceeds MAX_FRAGMENT_BYTES, or when the segment count after
merging still exceeds MAX_FRAGMENTS.