# 命令行词典辅助工具 mydict 2024.01.07

**URL:** <https://forum.freemdict.com/t/topic/25931>\
**Category:** 软件经验交流展望\
**Tags:** mdx\
**Created:** [2024 年1 月 7 日 08:31 UTC](https://forum.freemdict.com/t/topic/25931 "2024-01-07T08:31:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

作者： ![demo](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/e47774/32.png) [@demo](https://forum.freemdict.com/u/demo)\
发布日期： [2024 年1 月 7 日 08:31 UTC](https://forum.freemdict.com/t/topic/25931/1 "2024-01-07T08:31:41Z")

</div>

分享一个命令行版词典辅助工具，主要功能：查看词典文件的元数据、词头列表、查询词头内容、解包词典文件

主要参数说明：  
-f 词典文件，支持 mdx mdd  
-o 内容输出的文件或文夹路径  
-e 工具入口，支持的选项： meta 元数据 keys 词头列表 query 查询词头内容 unpack 解包词典文件  
-w 要查询的词头  
–encoding 查询 mdx 文件时输出的内容编码，默认为 UTF-8

命令实例：  
查询test.mdx文件中hello词头内容：  
mydict -f test.mdx -e query -w hello

提取test.mdd文件中hello.jpg图片内容：  
mydict -f test.mdd -e query -w hello.jpg -o hello.jpg

查看test.mdx文件中的词典列表：  
mydict -f test.mdx -e keys

解包test.mdx文件为源文件  
mydict -f test.mdx -e unpack -o test.txt

解包test.mdd文件所有资源到 tmp 文件夹  
mydict -f test.mdd -e unpack -o tmp

工具下载地址：

> **[mydict.7z](https://cloud.freemdict.com/index.php/s/oqTj9tXr9WLsWQx)**
>
> FreeMdict Cloud - A FreeMdict Storage

说明：  
1、此工具为命令行工具，没有好看的图形界面  
2、仅支持 Windows 系统，当前只在 windows 10 x64 上测试过

---

<div class="post-metadata">

作者： ![hkreporter](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/41988e/32.png) [@hkreporter](https://forum.freemdict.com/u/hkreporter)\
发布日期： [2024 年10 月 16 日 10:47 UTC](https://forum.freemdict.com/t/topic/25931/2 "2024-10-16T10:47:11Z")

</div>

请问下mydict用的是哪些库？体积很小很轻便

---

<div class="post-metadata">

作者： ![demo](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/e47774/32.png) [@demo](https://forum.freemdict.com/u/demo)\
发布日期： [2024 年10 月 17 日 01:03 UTC](https://forum.freemdict.com/t/topic/25931/3 "2024-10-17T01:03:06Z")

</div>

所有用到第三方库：  
1、[GitHub - dictlab/mdict-cpp: \*.mdx/\*.mdd file interpreter cpp implementation](https://github.com/dictlab/mdict-cpp.git)  
2、iconv  
3、minilzo  
4、miniz  
5、cxxopts

---

<div class="post-metadata">

作者： ![hkreporter](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/41988e/32.png) [@hkreporter](https://forum.freemdict.com/u/hkreporter)\
发布日期： [2024 年10 月 17 日 02:13 UTC](https://forum.freemdict.com/t/topic/25931/4 "2024-10-17T02:13:34Z")

</div>

能请教一下这个工具是怎么制作的吗？我一般用mdict-utils，不过得有python才能用，你的工具更方便。

---

<div class="post-metadata">

作者： ![demo](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/e47774/32.png) [@demo](https://forum.freemdict.com/u/demo)\
发布日期： [2024 年10 月 17 日 05:16 UTC](https://forum.freemdict.com/t/topic/25931/5 "2024-10-17T05:16:51Z")

</div>

基于第一个链接那仓库改出来的，有兴趣可以看看那代码。
