fix: 关闭新闻放宽凑数并剥离放宽窗口文案

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-14 10:42:00 +08:00
parent dcd0608b5d
commit 4a128b0fa6
5 changed files with 712 additions and 92 deletions

18
daily/news/sanitize.py Normal file
View File

@@ -0,0 +1,18 @@
"""新闻文案清洗:剥离「放宽窗口」类凑数前缀。"""
from __future__ import annotations
import re
_RELAX_PREFIX = re.compile(
r"^(?:放宽窗口|放宽至[^:]*)\s*[:]\s*",
re.UNICODE,
)
def strip_relax_window_prefix(text: str) -> str:
"""去掉开头的「放宽窗口:」/「放宽至…:」前缀。"""
raw = (text or "").strip()
if not raw:
return ""
return _RELAX_PREFIX.sub("", raw, count=1).strip()