jerrypan7 commited on
Commit
000d398
·
verified ·
1 Parent(s): df13cc5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -107,7 +107,7 @@ def split_text_with_punctuation(text):
107
  for i in range(0, len(split_text) - 1, 2):
108
  combined_segments.append(split_text[i] + split_text[i + 1])
109
  # If there's any remaining text after the last punctuation, append it as well
110
- if len(split_text) % 2 != 0:
111
  combined_segments.append(split_text[-1])
112
 
113
  return combined_segments
 
107
  for i in range(0, len(split_text) - 1, 2):
108
  combined_segments.append(split_text[i] + split_text[i + 1])
109
  # If there's any remaining text after the last punctuation, append it as well
110
+ if len(split_text) % 2 != 0 and split_text[-1]:
111
  combined_segments.append(split_text[-1])
112
 
113
  return combined_segments