Skip to main content

segments

Function segments 

Source
pub fn segments(document: &Document) -> Vec<Segment>
Expand description

Splits document into deterministic, order-stable translation segments.

Walks Document::blocks in order; each block that carries translatable text becomes one Segment whose SegmentId is the content hash of that text. Blocks with no text after normalization (e.g. a captionless figure) are skipped. Called twice on the same document it returns identical ids in identical order.