From d6c22440df05bd3cf013098f9df79f5770a234e0 Mon Sep 17 00:00:00 2001 From: ThearchyHelios Date: Mon, 19 Oct 2026 17:50:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E5=AD=97=E9=87=8C=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E6=B6=82=E7=99=BD=EF=BC=88=5Fname=5Fmasks=EF=BC=89?= =?UTF-8?q?=E5=85=88=E6=8C=89=E6=95=B0=E5=AD=97=E4=B8=B2=E6=8C=A1=E4=B8=80?= =?UTF-8?q?=E9=81=93=EF=BC=9A=E5=90=8D=E5=AD=97=E4=B8=80=E5=AD=97=E4=B8=8D?= =?UTF-8?q?=E5=B7=AE=E5=87=BA=E7=8E=B0=E3=80=81=E5=89=8D=E5=90=8E=E4=B8=8D?= =?UTF-8?q?=E7=B4=A7=E6=8C=A8=E7=9D=80=E6=95=B0=E5=AD=97=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E9=87=8C=E7=9A=84=E6=AF=8F=E4=B8=80=E4=B8=B2?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E5=9C=A8=E6=AD=A3=E6=96=87=E9=87=8C=E9=83=BD?= =?UTF-8?q?=E6=98=AF=E5=AE=8C=E6=95=B4=E7=9A=84=E4=B8=80=E4=B8=B2=EF=BC=8C?= =?UTF-8?q?=E6=AD=A3=E6=96=87=E9=87=8C=E6=B2=A1=E6=9C=89=E8=BF=99=E4=B8=B2?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E7=9A=84=E5=90=8D=E5=AD=97=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E9=80=90=E4=B8=AA=E6=9F=A5=E6=89=BE=EF=BC=8C=E5=BF=AB=E7=85=A7?= =?UTF-8?q?=E8=A1=8C=E5=A4=9A=E6=97=B6=E4=B8=8D=E6=8B=96=E6=85=A2=E7=BB=84?= =?UTF-8?q?=E8=A3=85=E5=92=8C=E5=A4=8D=E6=A0=B8=EF=BC=9B=E6=94=BE=E8=BF=87?= =?UTF-8?q?=E7=9A=84=E8=8C=83=E5=9B=B4=E4=B8=8D=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/engine/evidence.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/app/engine/evidence.py b/backend/app/engine/evidence.py index ab6d9595..66dcea28 100644 --- a/backend/app/engine/evidence.py +++ b/backend/app/engine/evidence.py @@ -3068,7 +3068,11 @@ def _name_masks(markdown: str, catalog: dict[str, Any], snaps: _Snapshots) -> li 写名字,不该因为名字里有个 5 被打回重写。只认快照里真有的值、整段一字不差,前后紧挨着数字的不算(「冲压15线」不是 「冲压5线」);同一个数单独写出来照样要出处。组装和复核用同一份目录,放过的范围一致。""" out: list[tuple[int, int]] = [] - for name in _text_names(catalog, snaps) if any(c.isdigit() for c in markdown) else (): + runs = set(re.findall(r"\d+", markdown)) + for name in _text_names(catalog, snaps) if runs else (): + # 名字一字不差地出现、前后不紧挨着数字,名字里的每一串数字在正文里就是完整的一串:先按它挡掉大多数名字 + if not all(r in runs for r in re.findall(r"\d+", name)): + continue at = markdown.find(name) while at >= 0: end = at + len(name)