Spaces:
Sleeping
Sleeping
DWizard
commited on
Commit
·
f01af1f
1
Parent(s):
eb01d5d
preprocess fix
Browse filesFormer-commit-id: 96c4ba864c6c6285dd36704b3f87644022db5228
- src/task.py +6 -2
src/task.py
CHANGED
@@ -107,12 +107,16 @@ class Task:
|
|
107 |
# Module 2: SRT preprocess: perform preprocess steps
|
108 |
def preprocess(self):
|
109 |
self.status = TaskStatus.PRE_PROCESSING
|
|
|
110 |
self.SRT_Script.form_whole_sentence()
|
|
|
111 |
self.SRT_Script.correct_with_force_term()
|
112 |
self.SRT_Script.write_srt_file_src(str(Path(self.task_local_dir).with_suffix(""))+"_processed.srt")
|
113 |
|
114 |
-
if
|
115 |
-
|
|
|
|
|
116 |
self.script_input = self.SRT_Script.get_source_only()
|
117 |
pass
|
118 |
|
|
|
107 |
# Module 2: SRT preprocess: perform preprocess steps
|
108 |
def preprocess(self):
|
109 |
self.status = TaskStatus.PRE_PROCESSING
|
110 |
+
logging.info("--------------------Start Preprocessing SRT class--------------------")
|
111 |
self.SRT_Script.form_whole_sentence()
|
112 |
+
# self.SRT_Script.spell_check_term()
|
113 |
self.SRT_Script.correct_with_force_term()
|
114 |
self.SRT_Script.write_srt_file_src(str(Path(self.task_local_dir).with_suffix(""))+"_processed.srt")
|
115 |
|
116 |
+
if self.launch_info["output_type"] == "ass":
|
117 |
+
logging.info("write English .srt file to .ass")
|
118 |
+
assSub_en = srt2ass(str(Path(self.task_local_dir).with_suffix(""))+"_processed.srt", "default", "No", "Modest")
|
119 |
+
logging.info('ASS subtitle saved as: ' + assSub_en)
|
120 |
self.script_input = self.SRT_Script.get_source_only()
|
121 |
pass
|
122 |
|