From 8ee4ab7dd39b99720042a7308850b7cfb8f49fd1 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 15 Dec 2023 19:41:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=9D=E8=AF=95=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mycode/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mycode/main.py b/mycode/main.py index bce6d2a..e952a33 100644 --- a/mycode/main.py +++ b/mycode/main.py @@ -361,6 +361,11 @@ def ana_wechat(): return output_data +def find_title(text): + match = re.search(r'#\s*.*', text, re.MULTILINE) + if match: + return match.group(0).strip() # 去除两边的空白字符 + return "/" def ana_web(): output_data = [] @@ -392,7 +397,7 @@ def ana_web(): output_row = [ index, row2['name'], - "/", + find_title(row2['text']), row['错误表述'], row['建议修改词语'], row['错误分类'],