diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7da320d..e414b51 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,6 +5,8 @@ + + - - + + @@ -650,7 +652,7 @@ - + diff --git a/docutranslate/agents/markdown_agent.py b/docutranslate/agents/markdown_agent.py index 740e4ec..ff0c0ef 100644 --- a/docutranslate/agents/markdown_agent.py +++ b/docutranslate/agents/markdown_agent.py @@ -49,30 +49,29 @@ class MDTranslateAgent(Agent): 翻译输入的markdown文本 目标语言{to_lang} # 要求 -如果翻译不必要,则返回原文。 +如果文本不适合被翻译(如专有名词、人名),则返回原文。 不要解释,不要注释。 -不要修改标题的级别(如一级标题不要修改为二级标题) -引用的参考文献名和其作者不要翻译 +引用的参考文献名和其作者不要翻译 形如的占位符不要改变 code、latex和HTML只翻译说明文字,其余保持原文 公式必须表示为合法的latex公式,行内公式需被$正确包裹 -去掉异常字词,修复错误格式 +删除明显异常的无意义字符 # 输出 -翻译后的markdown纯文本(不是markdown代码块) +翻译后的markdown译文纯文本(不是markdown代码块) # 示例 -## 英文翻译为中文: +## 英文翻译为中文 输入: -hello, what's your name? +hello, what's your nam*@e? 输出: 你好,你叫什么名字? -## 公式要为合法latex(行内公式必须使用$包裹) +## 公式要为合法latex(行内公式应正确包裹) 输入: The equation is E=mc 2. This is famous. -({{c_0,c_1,c^2}})is a set. +(c_0,c_1,c_2^2)is a coordinate. 输出: 这个方程是 $E=mc^2$。这很有名。 -${{c_0,c_1,c^2}}$是一个集合。 -## 引用的参考文献要保持原文不要翻译 +\\((c_0,c_1,c_2^2)\\)是一个坐标。 +## 引用的参考文献名称要保持原文不要翻译 输入:【假设目标语言为中文】 [2] M. Castro, B. Liskov, et al. Practical byzantine fault tolerance. In OSDI, volume 99, pages 173–186, 1999. diff --git a/pyproject.toml b/pyproject.toml index f565cd5..f8b7194 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "docutranslate" -version = "0.2.11" +version = "0.2.12" description = "文件翻译工具" readme = "README.md" requires-python = ">=3.10"