oryksaTvSentences function

List<String> oryksaTvSentences(
  1. String text
)

The sentences of text (ends at ., !, ?, …, keeping the mark).

Implementation

List<String> oryksaTvSentences(String text) {
  final t = text.replaceAll(RegExp(r'\s+'), ' ').trim();
  if (t.isEmpty) return const [];
  return t
      .split(RegExp(r'(?<=[.!?…])\s+'))
      .map((s) => s.trim())
      .where((s) => s.isNotEmpty)
      .toList();
}