From 03a04a5d7b10eaa0a53560ffbd6cc3a60b5b144c Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Tue, 18 Jul 2023 21:43:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9mathpix=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=A4=84=E7=90=86=E7=9A=84=E4=B8=80=E4=B8=AA?= =?UTF-8?q?bug,=20=E5=B9=B6=E8=87=AA=E5=8A=A8=E5=B0=86"=E9=92=88=E8=A7=92"?= =?UTF-8?q?=E6=94=B9=E4=B8=BA"=E9=92=9D=E8=A7=92"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/database_tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index d1d0f706..5c2da76f 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -933,6 +933,7 @@ def GenerateLessonPreparation(notetitle, outputdir, adict, prodict, objdict, les def getCopy(): # 获取剪切板内容 wc.OpenClipboard() t = wc.GetClipboardData(win32con.CF_UNICODETEXT) + t = t.replace("\r\n","\n") wc.CloseClipboard() return t @@ -946,7 +947,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}^"} - wrongrecog = {"雉":"锥","[粗秿]圆":"椭圆","投郑":"投掷","抛郑":"抛掷","范目":"范围","揷":"插","末见":"未见","末成":"未成"} + wrongrecog = {"雉":"锥","[粗秿]圆":"椭圆","投郑":"投掷","抛郑":"抛掷","范目":"范围","揷":"插","末见":"未见","末成":"未成","针角":"钝角"} string = raw_string string = re.sub(r"\\left(?:\.?)|\\right(?:\.?)","",string) #删去括号前的\left与\right标记 for s in puctuationsfulltosemi: