| import re | |
| def preprocess_remove_line_break(raw_text, replacements=""): | |
| # 移除单独换行符 | |
| pattern = r"(?<!\n)\n(?!\n)" | |
| text_content = re.sub(pattern, replacements, raw_text) | |
| text_content = text_content.replace("“", "\"") | |
| text_content = text_content.replace("”", "\"") | |
| text_content = text_content.replace("‘", "'") | |
| text_content = text_content.replace("’", "'") | |
| return text_content |