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['错误分类'],