Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|