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())