Skip to main content

paragraphize

Function paragraphize 

Source
pub fn paragraphize(text: &str) -> String
Expand description

Group a long monologue into readable paragraphs (the High level). Existing blank lines (a spoken “new paragraph”) are preserved as hard breaks; within each run, a new paragraph starts at a sentence that opens with a discourse marker once the current paragraph already holds MIN_SENTENCES_PER_PARA sentences, or unconditionally once it reaches MAX_SENTENCES_PER_PARA — so breaks fall at thought shifts, never after every sentence, and no paragraph runs on forever.