From 31935e655beb3ae7d3b069f10cd6b6b2907499a4 Mon Sep 17 00:00:00 2001 From: Rikki Date: Sun, 30 Mar 2025 07:09:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E5=8F=8D=E6=96=9C=E6=9D=A0=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/chat/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/chat/utils.py b/src/plugins/chat/utils.py index 6c8a681b5..ecd67816a 100644 --- a/src/plugins/chat/utils.py +++ b/src/plugins/chat/utils.py @@ -205,7 +205,7 @@ def split_into_sentences_w_remove_punctuation(text: str) -> List[str]: else: # 用"|seg|"作为分割符分开 text = re.sub(r"([.!?]) +", r"\1\|seg\|", text) - text = text.replace("\n", "\|seg\|") + text = text.replace("\n", "|seg|") text, mapping = protect_kaomoji(text) # print(f"处理前的文本: {text}") @@ -246,7 +246,7 @@ def split_into_sentences_w_remove_punctuation(text: str) -> List[str]: current_sentence += " " + part else: # 处理分割符 - space_parts = current_sentence.split("\|seg\|") + space_parts = current_sentence.split("|seg|") current_sentence = space_parts[0] for part in space_parts[1:]: new_sentences.append(current_sentence.strip())