akki2825 commited on
Commit
34028e2
·
verified ·
1 Parent(s): 8c82d13
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -9,7 +9,7 @@ def split_into_sentences(text):
9
  Simple sentence tokenizer using regular expressions.
10
  Splits text into sentences based on punctuation.
11
  """
12
- sentences = text.split()
13
  sentences = [s.strip() for s in sentences if s.strip()]
14
  return sentences
15
 
 
9
  Simple sentence tokenizer using regular expressions.
10
  Splits text into sentences based on punctuation.
11
  """
12
+ sentences = re.split(r'(?<=[.!?])\s*', text)
13
  sentences = [s.strip() for s in sentences if s.strip()]
14
  return sentences
15