19 lines
469 B
Python
19 lines
469 B
Python
"""新闻文案清洗:剥离「放宽窗口」类凑数前缀。"""
|
||
|
||
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()
|