Skip to main content

sentences

Function sentences 

Source
pub fn sentences<'a>(text: &'a str, locale: Option<&str>) -> Vec<Sentence<'a>>
Expand description

Every sentence of text, in order, with the same boundary rules sentence_bounds applies — trailing whitespace trimmed, whitespace-only segments dropped.

This is the batch form of sentence_bounds, for callers measuring a whole text rather than locating one caret. Asking sentence_bounds at every offset instead would re-run the boundary pass per character.

Empty when text holds no sentence (empty, or whitespace only).