From d793d1c9923b865e1797eaca3ff177e06bb60f06 Mon Sep 17 00:00:00 2001 From: youpaishidifu Date: Sat, 8 Aug 2026 22:49:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=BC=BA=E5=99=AA=E5=A3=B0?= =?UTF-8?q?=E5=8E=8B=E5=88=B6=20-=20=E6=A3=80=E6=B5=8B=E6=B7=B7=E5=90=88?= =?UTF-8?q?=E6=96=87=E5=AD=97=E4=B9=B1=E7=A0=81(Latin+CJK=E4=BA=A4?= =?UTF-8?q?=E9=94=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在_is_noise_text中新增混合文字乱码检测 - 检测Latin大写字母被CJK分割成多个不连续块的模式 - 如'HHWH尸端自哪内柙登录槟J!'这类OCR垃圾现在会被过滤 - 修复unicode_radicals.md末尾格式错误(缺少补充字符列) - 从git追踪中移除easyocr_worker_state.json(运行时状态文件) --- monitor.py | 10 ++++++++++ unicode_radicals.md | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/monitor.py b/monitor.py index 003e659..2e6010c 100644 --- a/monitor.py +++ b/monitor.py @@ -4937,6 +4937,16 @@ class MessageMonitor: if _match_count >= 2: logger.debug(f"[ocr] 过滤器2结果: 检测到多个协议特征词({_match_count}个),返回True: {text[:60]!r}") return True + # ⭐ 混合文字乱码检测:OCR将不同行/区域的文字混在一起 + # 如"HHWH尸端自哪内柙登录槟J!" — Latin大写字母散落在CJK字符中间 + # 正常聊天中Latin缩写是连续块(如"登录PHP服务器"、"GTA5玩家") + # 乱码特征:Latin大写被CJK分割成多个不连续块(≥2组) + if re.search(r'[A-Z]', text) and re.search(r'[\u4e00-\u9fff]', text): + _upper_groups = len(re.findall(r'[A-Z]+', text)) + if _upper_groups >= 2: + logger.debug(f"[ocr] 过滤器2结果: 检测到混合文字乱码({_upper_groups}组大写字母分散)," + f"返回True: {text[:60]!r}") + return True # ⭐ Task #1457: 360安全弹窗内容过滤(防误触发查库+回复) # 360安全卫士/杀毒弹窗常被OCR识别为用户消息,如"这是敲诈病毒,会勒索您的钱财" # 以下关键词覆盖360常见报毒/安全警告弹窗 diff --git a/unicode_radicals.md b/unicode_radicals.md index 32e8edc..21769de 100644 --- a/unicode_radicals.md +++ b/unicode_radicals.md @@ -218,8 +218,8 @@ | 丿 | U+4E3F | 撇 | 儿→丿 | 儿 | | 丨 | U+4E28 | 竖 | 中→丨 | 中 | | 虱 | U+8671 | 虱 | 虱→搁 | 虱 | -| 凵 | U+51F5 | 凵 | 凵→儿| 凵 -| 乍 | U+4E4D | 作 | 乍→作 | 乍 +| 凵 | U+51F5 | 凵 | 凵→儿 | 凵 | +| 乍 | U+4E4D | 作 | 乍→作 | 乍 | ## 使用说明