main
HuangHai 3 weeks ago
parent 5eb4705145
commit 8605e0e102

@ -7,8 +7,8 @@ MYSQL_DB_NAME = "base_db"
# Elasticsearch配置
ES_CONFIG = {
"hosts": "https://10.10.14.206:9200",
#"hosts": "https://127.0.0.1:9200",
#"hosts": "https://10.10.14.206:9200",
"hosts": "https://127.0.0.1:9200",
"basic_auth": ("elastic", "jv9h8uwRrRxmDi1dq6u8"),
"verify_certs": False,
"ssl_show_warn": False,

@ -3,7 +3,7 @@ from Util.DocxUtil import *
if __name__ == '__main__':
# docx文件路径
#docx_file = '/static/Txt/Backup/化学方程式_CHEMISTRY_1.docx'
docx_file = '../static/Backup/化学方程式_CHEMISTRY_1.docx'
docx_file = '../static/Txt/化学方程式_CHEMISTRY_1.docx'
# 整合最终的拼接完的文本
content = get_docx_content_by_pandoc(docx_file)

@ -34,8 +34,8 @@ def get_docx_content_by_pandoc(docx_file):
# 调用pandoc将docx文件转换成markdown
subprocess.run(['pandoc', docx_file, '-f', 'docx', '-t', 'markdown', '-o', temp_markdown])
# 打印 temp_markdown 文件
with open(temp_markdown, 'r', encoding='utf-8') as f:
print(f.read())
# with open(temp_markdown, 'r', encoding='utf-8') as f:
# print(f.read())
# 读取然后修改内容,输出到新的文件
wmf_idx = 0 # wmf索引
img_idx = 0 # 图片索引

@ -5,7 +5,6 @@ import (
"github.com/urfave/cli"
"github.com/zhexiao/mtef-go/docx"
"github.com/zhexiao/mtef-go/eqn"
"log"
"os"
"time"
)
@ -78,6 +77,19 @@ func main() {
err := app.Run(os.Args)
if err != nil {
log.Panic(err)
/**
Error: CreateFile \tmp\1751286455911963600\word\embeddings: The system cannot find the file specified.
2025/06/30 20:27:35 CreateFile \tmp\1751286455911963600\word\embeddings: The system cannot find the file specified.
panic: CreateFile \tmp\1751286455911963600\word\embeddings: The system cannot find the file specified.
goroutine 1 [running]:
log.Panic({0xc0000e3df8?, 0xc000076068?, 0xc0000e3dc8?})
C:/Program Files/Go/src/log/log.go:432 +0x5a
main.main()
D:/dsWork/dsProject/dsRag/mtef-go-3/main.go:96 +0x4b2
*/
// 如果出现这面这样的错误可以认为是需要解析的文件并不包含ole对象提示即可不用抛出错误
// 包含这样的内容就输出没有找到The system cannot find the file specified.
fmt.Println("No embedded objects found.")
}
}

Binary file not shown.

@ -6,3 +6,7 @@ go build -o mtef-go.exe
# 处理.docx文件并保存结果
./mtef-go.exe -w "D:/dsWork/dsProject/dsRag/static/Txt/化学方程式_CHEMISTRY_1.docx" -o "d:/output.txt"
./mtef-go.exe -w "D:/dsWork/dsProject/dsRag/static/Txt/高中文言文_CHINESE_1.docx" -o "d:/output.txt"

@ -220,6 +220,7 @@
帮我写一下 “如何理解点、线、面、体、角”的教学设计
</div>
<div class="example-item" onclick="fillExample('文言虚词')">请解释一下“文言虚词”</div>
<div class="example-item" onclick="fillExample('氢气与氧气燃烧的方程式')">氢气与氧气燃烧的方程式</div>
</div>
</div>
@ -244,11 +245,16 @@
<input type="checkbox" name="tags" value="CHINESE_1">
高中文言文
</label>
<label>
<input type="checkbox" name="tags" value="CHEMISTRY_1">
高中化学
</label>
</div>
</div>
<div><h3>知识库文稿下载</h3>
<a href="/Backup/小学数学教学中的若干问题_MATH_1.docx" class="doc-link">小学数学</a>
<a href="/Txt/小学数学教学中的若干问题_MATH_1.docx" class="doc-link">小学数学</a>
<a href="/static/Txt/高中文言文_CHINESE_1.docx" class="doc-link">高中文言文</a>
<a href="/static/Txt/化学方程式_CHEMISTRY_1.docx" class="doc-link">高中化学</a>
</div>
<br>

Loading…
Cancel
Save