This commit is contained in:
yumoqing 2025-05-25 14:09:01 +08:00
parent c5ba06f4d7
commit 6494f67568

View File

@ -15,12 +15,6 @@ def split_english_sentences(text):
sentences = [s.replace('<DOT>', '.') for s in sentences if s.strip()]
return sentences
def split_engish1_sentences(text):
# 匹配以 '. ', '? ', '! ' 结尾的英文句子,保留分隔符
sentence_endings = re.compile(r'(?<=[.!?]) +')
sentences = sentence_endings.split(text.strip())
return [s.strip() for s in sentences if s.strip()]
def split_text_with_dialog_preserved(text):
# 正则匹配中英文引号对话
text = ' '.join(text.split('\n'))