Eason Lu commited on
Commit
25b7b0c
1 Parent(s): bc31908

Former-commit-id: 9cd594573bdcfb57af52e59fadff94984ddc9a41

Files changed (1) hide show
  1. SRT.py +2 -2
SRT.py CHANGED
@@ -105,7 +105,7 @@ class SRT_script():
105
  merge_list = [] # a list of indices that should be merged e.g. [[0], [1, 2, 3, 4], [5, 6], [7]]
106
  sentence = []
107
  for i, seg in enumerate(self.segments):
108
- if seg.source_text[-1] in ['.', '!', '?'] and len(seg.source_text) > 10:
109
  sentence.append(i)
110
  merge_list.append(sentence)
111
  sentence = []
@@ -116,7 +116,7 @@ class SRT_script():
116
  for idx_list in merge_list:
117
  segments.append(self.merge_segs(idx_list))
118
 
119
- self.segments = segments # need memory release?
120
 
121
  def remove_trans_punctuation(self):
122
  # Post-process: remove all punc after translation and split
 
105
  merge_list = [] # a list of indices that should be merged e.g. [[0], [1, 2, 3, 4], [5, 6], [7]]
106
  sentence = []
107
  for i, seg in enumerate(self.segments):
108
+ if seg.source_text[-1] in ['.', '!', '?'] and len(seg.source_text) > 10 and 'vs.' not in seg.source_text:
109
  sentence.append(i)
110
  merge_list.append(sentence)
111
  sentence = []
 
116
  for idx_list in merge_list:
117
  segments.append(self.merge_segs(idx_list))
118
 
119
+ self.segments = segments
120
 
121
  def remove_trans_punctuation(self):
122
  # Post-process: remove all punc after translation and split