diff --git a/dsRag/.idea/vcs.xml b/dsRag/.idea/vcs.xml index 2e3f6920..61aaccdb 100644 --- a/dsRag/.idea/vcs.xml +++ b/dsRag/.idea/vcs.xml @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/dsRag/Test/TestReadDocx.py b/dsRag/Test/TestReadDocx.py new file mode 100644 index 00000000..f80a1fe1 --- /dev/null +++ b/dsRag/Test/TestReadDocx.py @@ -0,0 +1,34 @@ +import os +import subprocess + +# 输出文件路径 +output_file = r"d:\output.txt" # 可修改为您需要的路径 + +# 构建命令 +command = r"D:\dsWork\dsProject\dsRag\mtef-go-3\mtef-go.exe -d D:\dsWork\dsProject\dsRag\static\Txt\化学方程式_CHEMISTRY_1.docx -o " + output_file + +try: + # 执行命令并捕获输出,指定编码为utf-8 + result = subprocess.run(command, shell=True, check=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + encoding='utf-8', + errors='ignore') + + # 将输出写入文件,处理None值情况 + with open(output_file, "a", encoding='utf-8') as f: + if result.stdout: + f.write(result.stdout) + if result.stderr: + f.write(result.stderr) + + print(f"命令执行成功,输出已保存到 {output_file}") + +except subprocess.CalledProcessError as e: + print(f"命令执行失败: {e}") + with open(output_file, "a", encoding='utf-8') as f: + f.write(f"命令执行失败: {e}\n") + if e.stderr: + f.write(f"错误输出: {e.stderr}") + diff --git a/dsRag/Test/convert_math_type_to_word_formula.py b/dsRag/Test/convert_math_type_to_word_formula.py deleted file mode 100644 index b51b4537..00000000 --- a/dsRag/Test/convert_math_type_to_word_formula.py +++ /dev/null @@ -1,37 +0,0 @@ -import win32com.client -import re - -def convert_to_latex(formula_xml): - # 简单转换规则 - 实际应用中可能需要更复杂的处理 - latex = formula_xml - latex = re.sub(r'<[^>]+>', '', latex) # 移除XML标签 - latex = latex.replace('<', '<').replace('>', '>') - return f"${latex}$" - -def convert_math_type_to_word_formula(doc_path): - word = win32com.client.Dispatch("Word.Application") - doc = word.Documents.Open(doc_path) - - formula_count = 0 - latex_formulas = [] - - for omath in doc.OMaths: - formula_count += 1 - try: - formula_xml = omath.Range.WordOpenXML - if formula_xml: - latex = convert_to_latex(formula_xml) - latex_formulas.append(latex) - print(f"公式{formula_count} LaTeX: {latex[:100]}...") - except Exception as e: - print(f"公式{formula_count}转换错误: {str(e)}") - - print(f"\n最终LaTeX输出:") - for i, latex in enumerate(latex_formulas, 1): - print(f"公式{i}: {latex}") - - doc.Close(False) - word.Quit() - -if __name__ == '__main__': - convert_math_type_to_word_formula(r'D:\dsWork\dsProject\dsRag\Test\化学方程式_CHEMISTRY_1.docx') \ No newline at end of file diff --git a/dsRag/Test/input.md b/dsRag/Test/input.md deleted file mode 100644 index 481ffa9f..00000000 --- a/dsRag/Test/input.md +++ /dev/null @@ -1,169 +0,0 @@ -# 小学数学中有哪些模型? - -## 什么是模型? - -在《义务教育数学课程标准》中提到的模型思想,强调的是用数学的语言讲述现实世界中的故事。模型不仅仅是数学算式或应用题,它是解决一类具有实际背景问题的数学方法。 - ---- - -## 常见的小学数学模型 - -### 总量模型(加法模型) - -总量模型讨论的是**总量与部分量之间的关系**,其基本形式为: - -``` - -总量 = 部分量 + 部分量 - -``` - -这种模型适用于解决涉及“总和”的问题,例如: - -- 图书室各类图书的总数 - -- 多件商品的总花费 - -也可以通过变换得到: - -``` - -部分量 = 总量 - 部分量 - -``` - ---- - -### 路程模型(乘法模型) - -路程模型描述的是**距离、速度与时间的关系**,其基本形式为: - -``` - -距离 = 速度 × 时间 - -``` - -这个模型不仅适用于路程问题,还可以推广到: - -- 总价 = 单价 × 数量 - -- 总数 = 行数 × 列数 - -也可以通过逆运算得到: - -``` - -速度 = 距离 ÷ 时间 - -时间 = 距离 ÷ 速度 - -``` - -#### 教学片段:通过速度理解路程模型 - -教师可通过情境引导学生思考如何比较两个人的速度快慢,从而引入速度概念: - -> 情境:小丽和小强上学所花时间不同,谁走得更快? - -引导学生理解: - -- 速度不仅与时间有关,还与距离有关 - -- 速度 = 距离 ÷ 时间 - -并通过单位换算帮助学生掌握速度单位(如千米/时、米/秒)。 - -![图片描述](./Images/MATH_1_13.jpeg) - -接着通过实际例子让学生计算速度: - -![图片描述](./Images/MATH_1_14.png) - -并进一步让学生讲述与速度有关的故事,结合生活经验理解模型。 - ---- - -### 植树模型 - -植树模型是在**直线或平面上按规律植树的问题**,主要探讨: - -- 洞的数量与植树数量之间的关系 - -- 间隔与棵树的关系 - -适用于现实生活中的资源分布问题,如: - -- 在一条道路上设立加油站 - -- 在一个区域设置商业点 - -小学阶段主要研究**直线上的植树问题**。 - ---- - -### 工程模型(归一问题) - -工程模型用于解决**多个团队合作完成任务的时间问题**,其核心是将整个工程看作“1”,然后根据各自效率进行分配。 - -例如: - -- 甲单独完成需要A天,则每天完成1/A - -- 乙单独完成需要B天,则每天完成1/B - -- 合作完成所需时间为:1 ÷ (1/A + 1/B) - -也可扩展为: - -- 注水与放水问题 - -- 多个工程队合作的情况 - ---- - -## 模型的变化与组合使用 - -模型不是孤立使用的,可以通过组合来解决更复杂的问题: - -例如: - -- 总量模型与路程模型结合使用 - -- 引入方程作为工具求解复杂关系 - -![图片描述](./Images/MATH_1_16.png) - -![图片描述](./Images/MATH_1_17.png) - -教师可以提出问题让学生解释这些算式的意义,并通过小组讨论讲述与模型相关的故事。 - ---- - -## 教学设计分析 - -对于小学生来说,理解抽象的数学模型有一定难度。因此教学应注重: - -- **创设真实情境** - -- **利用缺失信息引发思考** - -- **通过变化帮助学生感悟模型的一般性** - -比如,从“速度”入手理解路程模型,有助于学生真正掌握三者之间的关系,而不是仅仅记忆公式。 - ---- - -## 结语 - -小学数学中的模型包括但不限于: - -- 总量模型 - -- 路程模型 - -- 植树模型 - -- 工程模型 - -这些模型不仅是解决问题的工具,更是培养学生**发现问题、提出问题、分析问题、解决问题能力**的重要途径。通过“综合与实践”类的教学活动,可以帮助学生积累数学活动经验,形成初步的模型思想。 \ No newline at end of file diff --git a/dsRag/Test/output.docx b/dsRag/Test/output.docx deleted file mode 100644 index d3f102da..00000000 Binary files a/dsRag/Test/output.docx and /dev/null differ diff --git a/dsRag/Test/化学方程式_CHEMISTRY_1.docx b/dsRag/Test/化学方程式_CHEMISTRY_1.docx deleted file mode 100644 index 55df07f7..00000000 Binary files a/dsRag/Test/化学方程式_CHEMISTRY_1.docx and /dev/null differ diff --git a/dsRag/Test/测试.bat b/dsRag/Test/测试.bat deleted file mode 100644 index 71309fb9..00000000 --- a/dsRag/Test/测试.bat +++ /dev/null @@ -1 +0,0 @@ -pandoc input.md -o output.docx --resource-path=static --from=markdown+hard_line_breaks --to=docx --standalone --verbose \ No newline at end of file diff --git a/dsRag/Util/mtef-go.exe b/dsRag/Util/mtef-go.exe deleted file mode 100644 index dee20a66..00000000 Binary files a/dsRag/Util/mtef-go.exe and /dev/null differ diff --git a/dsRag/static/Txt/化学方程式_CHEMISTRY_1.docx b/dsRag/static/Txt/化学方程式_CHEMISTRY_1.docx index 60e5146d..4852a2a3 100644 Binary files a/dsRag/static/Txt/化学方程式_CHEMISTRY_1.docx and b/dsRag/static/Txt/化学方程式_CHEMISTRY_1.docx differ