Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -231,11 +231,12 @@ def split_verbs_nouns(text):
|
|
231 |
|
232 |
return verbs_nouns_text, other_words_text
|
233 |
|
234 |
-
def split_srt_file(file_path):
|
235 |
# Open the SRT file and read its contents
|
236 |
-
with open(file_path, 'r') as f:
|
237 |
-
|
238 |
-
|
|
|
239 |
# Split the SRT file by timestamp
|
240 |
srt_sections = srt_contents.split('\n\n')
|
241 |
|
@@ -336,8 +337,10 @@ with gr.Blocks() as lliface:
|
|
336 |
with gr.Tab("Advanced - LingQ Addons ideas"):
|
337 |
gr.HTML("Extra functions needed - Persitent Sentence translation, UNWFWO, POS tagging and Word Count per user of words in their account. Macaronic Text is also another way to practice only the important information")
|
338 |
with gr.Tab("Merged Subtitles"):
|
339 |
-
gr.
|
340 |
-
gr.Interface(fn=
|
|
|
|
|
341 |
with gr.Row():
|
342 |
RomanFile = gr.File(label="Paste Roman")
|
343 |
W4WFile = gr.File(label="Paste Word 4 Word")
|
|
|
231 |
|
232 |
return verbs_nouns_text, other_words_text
|
233 |
|
234 |
+
def split_srt_file(text): #file_path):
|
235 |
# Open the SRT file and read its contents
|
236 |
+
#with open(file_path, 'r') as f:
|
237 |
+
# srt_contents = f.read()
|
238 |
+
srt_contents = text
|
239 |
+
|
240 |
# Split the SRT file by timestamp
|
241 |
srt_sections = srt_contents.split('\n\n')
|
242 |
|
|
|
337 |
with gr.Tab("Advanced - LingQ Addons ideas"):
|
338 |
gr.HTML("Extra functions needed - Persitent Sentence translation, UNWFWO, POS tagging and Word Count per user of words in their account. Macaronic Text is also another way to practice only the important information")
|
339 |
with gr.Tab("Merged Subtitles"):
|
340 |
+
gr.HTML("SRT Contents to W4W Split SRT for Google Translate")
|
341 |
+
gr.Interface(fn=split_srt_file, inputs="text", outputs="text")
|
342 |
+
gr.HTML("Text for w4w creation in G Translate")
|
343 |
+
gr.Interface(fn=splittext, inputs="text", outputs="text")
|
344 |
with gr.Row():
|
345 |
RomanFile = gr.File(label="Paste Roman")
|
346 |
W4WFile = gr.File(label="Paste Word 4 Word")
|