diff --git a/dsLightRag/ShiTi/T3_DocxToMd.py b/dsLightRag/ShiTi/T3_DocxToMd.py index 8c3cb6ef..437fd955 100644 --- a/dsLightRag/ShiTi/T3_DocxToMd.py +++ b/dsLightRag/ShiTi/T3_DocxToMd.py @@ -80,13 +80,15 @@ async def main(): 修正一下MinerU生成的Latex中,如果是数字加圆圈的样式 \textcircled{1},无法在Typora或者PyCharm中显示的问题,改成兼容性更强的 \enclose{circle}{1} """ # \textcircled - finalName = r'D:\\dsWork\\dsProject\\dsRagAnything\\output\\《动能定理》巩固练习\\auto\\《动能定理》巩固练习.md' + path = r'D:\\dsWork\\dsProject\\dsRagAnything\\output\\《动能定理》巩固练习\\auto\\' + finalName = r'《动能定理》巩固练习.md' with open(finalName, 'r', encoding='utf-8') as f: content = f.read() # 使用正则表达式匹配可能包含空格的命令格式 import re content = re.sub(r'\\textcircled\s*\{([0-9]+)\}', r'\\enclose{circle}{\1}', content) - with open(finalName, 'w', encoding='utf-8') as f: + # 保存为与finalName 同目录的文件,名称为 结果.md + with open(os.path.join(path, '结果.md'), 'w', encoding='utf-8') as f: f.write(content)