File size: 283 Bytes
00ff675
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import re

def split_into_candidates(text: str):
    # Strong sentence boundaries only
    sentences = re.split(r'[.!?]', text)

    candidates = []
    for s in sentences:
        s = s.strip()
        if len(s.split()) >= 3:
            candidates.append(s)

    return candidates