From 706a76fb58936286836b4af410df260978fdebdd Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Sat, 29 Jul 2023 10:47:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0mathpix=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E4=B8=A4=E4=B8=AA=E5=B8=B8=E9=94=99=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/database_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index 1a2cda0e..02294ba6 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -976,7 +976,7 @@ def setCopy(string): # 写入剪切板内容 def RefineMathpix(raw_string): # 进一步修改mathpix得到的字符串 puctuationsfulltosemi = {" ": " ","。": ". ",".": ". ",",": ", ",":": ": ",";": "; ","(": "(",")": ")","?": "? ","“": "``","”": "''", "【": "[", "】": "]"} replacestrings = {r"\\overparen": r"\\overset\\frown", "eqslant": "eq", r"\\vec": r"\\overrightarrow ", r"\\bar": r"\\overline", r"\\lim": r"\\displaystyle\\lim", r"\\sum":r"\\displaystyle\\sum", r"\\prod":r"\\displaystyle\\prod", r"\\mid":"|", r"\^\{\\prime\}":"'",r"e\^":r"\\mathrm{e}^",r"/\s*/":r"\\parallel "} - wrongrecog = {"雉":"锥","[粗秿]圆":"椭圆","投郑":"投掷","抛郑":"抛掷","范目":"范围","揷":"插","末见":"未见","末成":"未成","针角":"钝角","幕函数":"幂函数","末知":"未知","阀值":"阈值","祖[桓晅]":"祖暅"} + wrongrecog = {"雉":"锥","[粗秿]圆":"椭圆","投郑":"投掷","抛郑":"抛掷","范目":"范围","揷":"插","末见":"未见","末成":"未成","针角":"钝角","幕函数":"幂函数","末知":"未知","阀值":"阈值","祖[桓晅]":"祖暅","图象":"图像","末使用":"未使用"} string = raw_string string = re.sub(r"\\left(?:\.?)|\\right(?:\.?)","",string) #删去括号前的\left与\right标记 for s in puctuationsfulltosemi: