Spaces:
Sleeping
Sleeping
fix fn
Browse files
app.py
CHANGED
|
@@ -1,13 +1,14 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def split_into_sentences(text):
|
| 4 |
-
# Split the text by
|
| 5 |
-
sentences = text.split('
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
# Join the sentences with newline characters
|
| 11 |
return '\n'.join(sentences)
|
| 12 |
|
| 13 |
def main():
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def split_into_sentences(text):
|
| 4 |
+
# Split the text into sentences based on periods followed by spaces
|
| 5 |
+
sentences = text.split('. ')
|
| 6 |
|
| 7 |
+
# Add a period back to each sentence except the last one if it doesn't end with a period
|
| 8 |
+
for i in range(len(sentences) - 1):
|
| 9 |
+
sentences[i] += '.'
|
| 10 |
|
| 11 |
+
# Join the sentences with newline characters
|
| 12 |
return '\n'.join(sentences)
|
| 13 |
|
| 14 |
def main():
|