def split_sentences(s: str): parts = re.split(r"[\.!\?]+", s) # 1. split on ., !, or ? (one or more in a row) return [p.strip() for p in parts if p.strip()] # 2. trim spaces and drop empty parts