|
@@ -20,11 +20,13 @@ def sentence_time_ratio(text,maxLen):
|
|
sentences[t] = text[t*sen_len:t*sen_len+sen_len]
|
|
sentences[t] = text[t*sen_len:t*sen_len+sen_len]
|
|
time_ratio[t] = len(sentences[t])/total_len
|
|
time_ratio[t] = len(sentences[t])/total_len
|
|
else:
|
|
else:
|
|
-
|
|
|
|
time_ratio = [1]
|
|
time_ratio = [1]
|
|
sentences = [text]
|
|
sentences = [text]
|
|
|
|
|
|
return time_ratio, sentences
|
|
return time_ratio, sentences
|
|
|
|
+#1 sentence in, spliited array out
|
|
|
|
+
|
|
|
|
+
|
|
def parse_script(file_path,gt_list):
|
|
def parse_script(file_path,gt_list):
|
|
with open(file_path, 'r',encoding="utf-8") as f:
|
|
with open(file_path, 'r',encoding="utf-8") as f:
|
|
raw_lines = [line.strip() for line in f]
|
|
raw_lines = [line.strip() for line in f]
|