Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,11 +20,11 @@ def format_time(seconds):
|
|
20 |
secs = seconds % 60
|
21 |
return f"{hrs:02}:{mins:02}:{secs:02},{millis:03}"
|
22 |
|
23 |
-
# Function to split text based on punctuation,
|
24 |
def split_text_into_segments(text):
|
25 |
-
# Split based on punctuation marks (.!?)
|
26 |
segments = []
|
27 |
-
raw_segments = re.split(r'([
|
28 |
temp_sentence = ""
|
29 |
|
30 |
for i in range(0, len(raw_segments) - 1, 2):
|
|
|
20 |
secs = seconds % 60
|
21 |
return f"{hrs:02}:{mins:02}:{secs:02},{millis:03}"
|
22 |
|
23 |
+
# Function to split text based on punctuation, handling segments over 8 words
|
24 |
def split_text_into_segments(text):
|
25 |
+
# Split based on punctuation marks (.!? and ,)
|
26 |
segments = []
|
27 |
+
raw_segments = re.split(r'([.!?,])', text)
|
28 |
temp_sentence = ""
|
29 |
|
30 |
for i in range(0, len(raw_segments) - 1, 2):
|