Sentence Utilities¶
- split_sentences(text: str) → list[str][source]¶
Split text into sentences, protecting scientific abbreviations.
Strategy: temporarily replace abbreviation dots with a placeholder, split on
[.!?]followed by whitespace + uppercase/bracket, then restore the placeholder.- Parameters:
text – Plain text to split.
- Returns:
Non-empty sentence strings.
- Return type:
list[str]
Examples
>>> split_sentences("As shown in Fig. 3, the yield is high. See also Fig. 4.") ['As shown in Fig. 3, the yield is high.', 'See also Fig. 4.']