ZiyuG commited on
Commit
798ca11
β€’
1 Parent(s): f470955

Update audio.py

Browse files
Files changed (1) hide show
  1. audio.py +12 -3
audio.py CHANGED
@@ -112,9 +112,18 @@ def merge_subtitles(subtitles):
112
  duration = current_end - current_start
113
  break
114
 
115
- current_content = '這裑請注意' + '、'.join(list(set(current_content.replace("η΄°η―€", "").split('、'))))
116
- current_content = current_content.replace("左手、右手", "雙手").replace("右手、左手", "雙手")
117
- current_content = current_content.replace("左臂、右臂", "雙臂").replace("右臂、左臂", "雙臂")
 
 
 
 
 
 
 
 
 
118
  merged_subtitles.append([[current_start, current_end], current_content])
119
 
120
  return merged_subtitles
 
112
  duration = current_end - current_start
113
  break
114
 
115
+ all_elem = list(set(current_content.replace("η΄°η―€", "").split('、')))
116
+ if "左手" in all_elem and "右手" in all_elem:
117
+ all_elem.remove("左手")
118
+ all_elem.remove("右手")
119
+ all_elem.append("雙手")
120
+ if "左臂" in all_elem and "右臂" in all_elem:
121
+ all_elem.remove("左臂")
122
+ all_elem.remove("右臂")
123
+ all_elem.append("雙臂")
124
+ current_content = '這裑請注意' + '、'.join(all_elem)
125
+ # current_content = current_content.replace("左手、右手", "雙手").replace("右手、左手", "雙手")
126
+ # current_content = current_content.replace("左臂、右臂", "雙臂").replace("右臂、左臂", "雙臂")
127
  merged_subtitles.append([[current_start, current_end], current_content])
128
 
129
  return merged_subtitles