daihui.zhang commited on
Commit
b9ad81c
·
1 Parent(s): 4d9049a

fix bug of punctuation

Browse files
Files changed (1) hide show
  1. transcribe/strategy.py +3 -3
transcribe/strategy.py CHANGED
@@ -39,15 +39,15 @@ class TranscriptToken:
39
 
40
  def is_punctuation(self):
41
  """检查文本是否包含标点符号"""
42
- return REGEX_MARKERS.search(self.text) is not None
43
 
44
  def is_end(self):
45
  """检查文本是否为句子结束标记"""
46
- return SENTENCE_END_PATTERN.search(self.text) is not None
47
 
48
  def is_pause(self):
49
  """检查文本是否为暂停标记"""
50
- return PAUSEE_END_PATTERN.search(self.text) is not None
51
 
52
  def buffer_index(self) -> int:
53
  return max(int(self.t1 / 100 * SAMPLE_RATE) - 300, 0)
 
39
 
40
  def is_punctuation(self):
41
  """检查文本是否包含标点符号"""
42
+ return REGEX_MARKERS.search(self.text.strip()) is not None
43
 
44
  def is_end(self):
45
  """检查文本是否为句子结束标记"""
46
+ return SENTENCE_END_PATTERN.search(self.text.strip()) is not None
47
 
48
  def is_pause(self):
49
  """检查文本是否为暂停标记"""
50
+ return PAUSEE_END_PATTERN.search(self.text.strip()) is not None
51
 
52
  def buffer_index(self) -> int:
53
  return max(int(self.t1 / 100 * SAMPLE_RATE) - 300, 0)