计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
ref-style-converter【效率与协作】参考文献格式转换工具,可在APA、MLA、IEEE、Harvard四种主流学术格式间相互转换,支持批量处理和格式错误检查。当用户需要转换参考文献格式、检查引用是否正确,或提到citation、bibliography、APA/MLA/IEEE/Harvard格式、批量格式化引用等关键词时触发。
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
参考文献格式转换工具,支持 APA (7th)、MLA (9th)、IEEE、Harvard 四种主流学术引用格式之间的相互转换,同时提供格式错误检查和批量处理能力。
| 格式 | 说明 | 示例 |
|---|---|---|
| APA | American Psychological Association 第7版 | Smith, J. A. (2023). Title. *Journal*, *1*(2), 10-20. |
| MLA | Modern Language Association 第9版 | Smith, John A. "Title." *Journal*, vol. 1, no. 2, 2023, pp. 10-20. |
| IEEE | Institute of Electrical and Electronics Engineers | [1] J. A. Smith, "Title," *Journal*, vol. 1, no. 2, pp. 10-20, 2023. |
| Harvard | Harvard Referencing Style | Smith, J.A. (2023) 'Title', *Journal*, 1(2), pp. 10-20. |
将 APA 格式引用转为 IEEE 格式:
python3 scripts/citation_formatter.py convert --to ieee "Smith, J. A. (2023). Machine learning approaches. Nature, 12(3), 45-67."
echo '{"authors":["Smith, John A.","Jones, Mary B."],"year":"2023","title":"Machine learning approaches","journal":"Nature","volume":"12","issue":"3","pages":"45-67","entry_type":"article"}' | python3 scripts/citation_formatter.py format --style ieee
python3 scripts/citation_formatter.py check --style apa "Smith J (2023) Machine learning. Nature 12(3) 45-67"
# 从文件批量转换(每行一条引用)
python3 scripts/citation_formatter.py convert --to mla --input refs.txt
# 批量检查
python3 scripts/citation_formatter.py check --style apa --input refs.txt
python3 scripts/citation_formatter.py detect "Smith, J. A. (2023). Title. Nature, 12(3), 45-67."
format — 结构化数据格式化将 JSON 格式的结构化引用数据转为指定格式的引用文本。这是最可靠的方式,因为不需要解析文本。
# 通过 stdin 传入 JSON
echo '{"authors":["Zhang, Wei"],"year":"2024","title":"Deep Learning","publisher":"Springer","entry_type":"book"}' | python3 scripts/citation_formatter.py format --style harvard
# 通过 --data 参数传入
python3 scripts/citation_formatter.py format --style apa --data '{"authors":["Li, Ming"],"year":"2024","title":"AI Methods","journal":"Science","volume":"5","pages":"1-10","entry_type":"article"}'
# 批量:传入 JSON 数组文件
python3 scripts/citation_formatter.py format --style mla --input citations.json
JSON 字段说明:
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
authors | string[] | ✓ | 作者列表,格式 "姓, 名" |
year | string | ✓ | 出版年份 |
title | string | ✓ | 标题 |
journal | string | 期刊文章必填 | 期刊名称 |
volume | string | 卷号 | |
issue | string | 期号 | |
pages | string | 页码,如 "45-67" | |
publisher | string | 书籍必填 | 出版社 |
doi | string | DOI | |
url | string | URL | |
entry_type | string | article / book / chapter / webpage | |
edition | string | 版次 | |
city | string | 出版城市 |
parse — 文本解析为结构化数据python3 scripts/citation_formatter.py parse "Smith, J. A. (2023). Title. Nature, 12(3), 45-67."
# 输出 JSON 结构化数据
convert — 格式互转# 自动检测源格式,转为目标格式
python3 scripts/citation_formatter.py convert --to harvard "Smith, J. A. (2023). Title. Nature, 12(3), 45-67."
# 指定源格式
python3 scripts/citation_formatter.py convert --from apa --to ieee "Smith, J. A. (2023). Title. Nature, 12(3), 45-67."
# JSON 输出
python3 scripts/citation_formatter.py convert --to mla --json "Smith, J. A. (2023). Title. Nature, 12(3), 45-67."
check — 格式错误检查# 检查 APA 格式是否正确
python3 scripts/citation_formatter.py check --style apa "Smith, J. A. (2023). Title. Nature, 12(3), 45-67."
# JSON 输出(方便程序处理)
python3 scripts/citation_formatter.py check --style apa --json "Smith, J. A. (2023). Title. Nature, 12(3), 45-67."
检查项目包括:
detect — 自动检测格式python3 scripts/citation_formatter.py detect "[1] J. Smith, \"Title,\" Nature, vol. 1, 2023."
# 输出: ieee
format 子命令格式化convert 子命令--input 参数check 子命令验证结果