fix: 跨轮语义去重+checkbox清理

Task #1548: 跨轮语义去重增强
- 三层策略: Jaccard≥0.75 → 核心词重叠≥0.80 → 子集检测≥0.90
- 新增 _extract_content_keywords 提取CJK bigram关键词
- 修复登录插件去哪儿下载等变体查询未被拦截问题

Task #1549: Markdown小尾巴清理
- _clean_markdown 新增 checkbox 标记移除
- 支持 [√] [✗] [X] [x] [V] [v] [ ] [⚠] [!] 格式
- 修复 bot回复末尾残留 [√] GitHub(稳定版) 问题
This commit is contained in:
youpaishidifu
2026-08-17 21:23:31 +08:00
parent ace66863f1
commit 4005369492
2 changed files with 65 additions and 2 deletions
+6
View File
@@ -622,6 +622,12 @@ class AutoReply:
# 移除列表语法:- item → item
text = re.sub(r'^[\-\*]\s+', '', text, flags=re.MULTILINE)
# ⭐ Task #1549: 移除 checkbox 标记:[√] GitHub(稳定版) → GitHub(稳定版)
# KB 中的下载选项列表使用 checkbox 格式,如 "- [ √ ] GitHub(稳定版)"
# 清理后应返回 "GitHub(稳定版)" 而非 "[ √ ] GitHub(稳定版)"
# 支持: [√] [✗] [X] [x] [V] [v] [ ] [⚠] [!]
text = re.sub(r'\[\s*[√✗XxVv⚠! ]?\s*\]\s*', '', text)
# 移除加粗语法:**text** → text
text = re.sub(r'\*\*(.+?)\*\*', r'\1', text)