From bbfda6e849ece2a63bbe47204229b8b3f6fa361b Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Sun, 16 Jul 2023 23:07:39 +0800 Subject: [PATCH] =?UTF-8?q?mathpix=E9=A2=84=E5=A4=84=E7=90=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=B0=86=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E6=9C=AB=E7=9A=84=E5=B0=8F=E6=8B=AC=E5=8F=B7=E7=A7=BB=E8=87=B3?= =?UTF-8?q?=E5=85=AC=E5=BC=8F=E5=A4=96=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/database_tools.py | 1 + 1 file changed, 1 insertion(+) diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index 8f149a0e..8cffc20a 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -982,6 +982,7 @@ def RefineMathpix(raw_string): # 进一步修改mathpix得到的字符串 string = re.sub(r"([\u4e00-\u9fa5\$])(?:\\bracket\{20\})*[\.]*[\s]*\n\\fourch",lambda matchobj: matchobj.group(1)+"\\bracket{20}.\n\\fourch",string) #给中文或公式结尾的题目最后一行加上选择题的括号. string = re.sub(r"(%[^\n]*)\\blank\{50\}\.",lambda matchobj:matchobj.group(1),string) #注释行不加\blank{50} string = re.sub(r"[\\\\]*\n(\(\d{1,2}\))(?:(?!\n)\s)*",lambda matchobj: "\\\\\n"+matchobj.group(1)+" ",string) #新一行的小题号回车前加上换行符 + string = re.sub(r"\(([^\(\)]*(?:\\in |=|\\ge|\\le|>|<)[^\(\)]*)\)\$",lambda matchobj: "$($" + matchobj.group(1) + "$)",string) #公式最后的范围陈述的括号放到公式环境外 string = RefineChineseComma(string) #改顿号 return string