MDX Batch Dictionary Importer / MDX 批量释义

AnkiWeb addon 2048855508

Batch-fills selected Anki notes with definitions from local MDX dictionaries offline, offering full, filtered, or structured output modes.
AI-generated summary; may contain mistakes.

card-creationnote-managementdictionary

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
0 (👍 0 · 👎 0)
Updated
2026-08-03
Anki versions
25.09.4~
Description language
zh

Maintenance

active

  • Last update or commit was 59 days before the snapshot (2026-08-03).

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
25.09.4+2026-08-03
History across monthly snapshots

Loading…

Similar addons

Word Query

Queries words in mdx/stardict and web dictionaries, then fills Anki note fields to make language-learning cards immediately.

card-creationdictionary

Rating 211 👍 178 · 👎 33 ⭐ 305 Updated 2017-12-31
CompreDef

Generates Japanese definitions tailored to known kanji and vocabulary using a user-ordered ladder of local Yomitan dictionaries, with Tab-to-Generate filling empty fields via local SQLite lookups.

card-creationsync-integrationdictionary

Rating 0 👍 0 · 👎 0 Anki 26.08~ Updated 2026-09-16

README

MDX Batch Dictionary Importer for Anki

简体中文 · English

Batch-fill Anki note fields with definitions from a local MDX dictionary. The add-on works entirely offline and does not upload note content or dictionary data.

Current interface language: Simplified Chinese. English localization is planned.

简体中文

功能

MDX Batch Dictionary Importer 可以在 Anki 浏览窗口中,根据本地 MDX 词典为选中的笔记批量添加释义。

  • 可选择三种互斥输出模式:完整释义、筛选后整体释义、结构化拆分。
  • 支持跳过非空字段、覆盖和追加三种写入方式。
  • 自动移除 Anki [sound:...] 标签、HTML 和零宽字符。
  • 默认移除释义开头与卡片正面重复的词头,同时保留音标、词性和正文。
  • 拆分模式可自动识别常见 MDX HTML 中的音标、词性、核心释义、等级和考试/词频信息,并分别写入不同字段;该模式不会再写入一份完整释义,因此不会产生重复。同时兼容 ECDICT 格式。
  • 筛选后整体释义直接在原始词典内容中移除勾选的音标、等级或考试/词频信息,其余词性、释义、时态和排版保持原顺序并写入同一字段。
  • 支持自定义正则表达式清洗查询词。
  • 精确匹配失败后可以忽略大小写重新查询。
  • 保留 MDX 释义中的 HTML,并展开 MDict StyleSheet 样式编号。
  • 后台处理大量笔记,整个批次形成一个 Anki 撤销步骤。
  • 完全离线运行,无网络请求。

安装

从 AnkiWeb 安装

在 Anki 中打开“工具 → 插件 → 获取插件”,输入本插件的 AnkiWeb 代码,然后重新启动 Anki。

发布后,请在这里补充 AnkiWeb 代码。

从 GitHub Release 安装

  1. 从 Releases 下载最新的 .ankiaddon 文件。
  2. 在 Anki 中打开“工具 → 插件 → 从文件安装”。
  3. 选择下载的文件并重新启动 Anki。

使用方法

  1. 打开 Anki 的“浏览”窗口。
  2. 选择需要处理的笔记;建议一次只选择同一种笔记类型。
  3. 选择“笔记 → 从 MDX 批量添加释义…”。
  4. 选择本地 .mdx 文件。
  5. 选择存放单词的“词头字段”。
  6. 选择输出模式:完整释义、筛选后整体释义,或者将识别出的各部分拆分到多个字段。
  7. 选择写入方式并确认。

例如,当词头字段包含:

advance [sound:example.mp3]

插件会自动使用 advance 查询词典,不需要额外填写正则表达式。

写入方式

  • 目标字段非空时跳过:推荐用于首次批量补全,不会覆盖已有释义。
  • 覆盖目标字段:重新生成释义并替换已有内容。
  • 追加到目标字段:保留原内容,并在末尾加入词典释义。

MDX 兼容性

测试状态

  • 已实际测试:ECDICT.mdx。 当前开发和回归测试主要基于 ECDICT。
  • 其他 MDX:实验性兼容,尚未系统测试。 完整释义模式可能可以读取,但结构化拆分和筛选效果取决于词典自身的 HTML、压缩方式及加密方式。
  • 如果其他词典出现无法打开、查不到词或筛选错误,请提交脱敏后的单条 HTML 示例和完整错误信息;请勿上传受版权保护的词典文件。

内置读取器的设计范围:

  • MDict 1.x/2.x。
  • 无压缩或 zlib 压缩的 MDX。
  • 常见的 MDict 词头索引混淆。
  • MDX 内置 StyleSheet 样式展开。

暂不支持:

  • LZO 压缩。
  • 需要注册码或密码的记录加密。
  • MDict 3.x。
  • MDD 图片、音频和 CSS 资源导入。
  • 模糊匹配、词形还原和短语拆分。

隐私

所有词典查询和笔记处理都在本地完成。插件不访问网络,不收集遥测数据,也不会上传 Anki 笔记或 MDX 内容。

词典与版权说明

本项目不包含、提供或分发任何 MDX/MDD 词典文件。用户需要自行取得并确保有权使用相应词典。请勿将商业词典文件提交到本仓库、GitHub Releases 或 AnkiWeb 安装包中。

本项目与 Anki、AnkiWeb、MDict 及任何词典出版商均无隶属或授权关系。Anki 是 Ankitects Pty Ltd 的商标。

问题反馈

提交 Issue 时请附上:

  • Anki 版本和操作系统。
  • MDX 引擎版本;不要上传受版权保护的词典文件。
  • 插件显示的完整错误信息。
  • 词头字段的脱敏示例及批处理统计。

English

Features

  • Choose among mutually exclusive full-definition, filtered-definition, and structured-split output modes.
  • Editable field selectors for the source headword and destination definition.
  • Skip, overwrite, and append modes.
  • Automatic removal of Anki sound tags, HTML, and zero-width characters.
  • Optional removal of a duplicated headword at the start of the definition.
  • Best-effort structured field mapping for pronunciation, part of speech, core meaning, level, and exam/frequency metadata, with ECDICT compatibility. Split mode does not also write a duplicate full definition.
  • Filtered mode removes selected pronunciation, level, or exam/frequency metadata directly from the original entry while preserving the remaining order, inflections, definitions, and HTML in one field.
  • Optional regular-expression cleanup and case-insensitive fallback.
  • Preserves definition HTML and expands MDict StyleSheet markers.
  • Runs in the background and records each batch as one Anki undo step.
  • Fully offline: no network requests, telemetry, or data uploads.

Installation

Download the latest .ankiaddon from GitHub Releases, then choose Tools → Add-ons → Install from file in Anki and restart the application.

After the AnkiWeb release is available, the add-on can also be installed with its AnkiWeb code through Tools → Add-ons → Get Add-ons.

Usage

  1. Open Anki's Browse window and select the notes to process.
  2. Choose Notes → 从 MDX 批量添加释义….
  3. Select a local MDX file.
  4. Select the source headword field and either full-definition or structured-split output.
  5. Choose a write mode and run the batch.

Compatibility and limitations

Test status: ECDICT.mdx is the only dictionary currently covered by regular functional and regression testing. Other MDX dictionaries are experimental and have not been systematically verified. Full-definition lookup may work, while filtering and structured extraction depend on each dictionary's private HTML layout.

The bundled reader is designed for MDict 1.x/2.x files using no compression or zlib compression, common key-index obfuscation, and embedded StyleSheet expansion.

LZO compression, password/registration-code record encryption, MDict 3.x, MDD resources, fuzzy matching, and lemmatization are not currently supported.

Dictionary and trademark notice

No dictionary files are included or distributed with this project. Users are responsible for obtaining dictionaries legally and complying with their licenses. Do not upload commercial dictionary files to this repository, GitHub Releases, or AnkiWeb.

This project is not affiliated with or endorsed by Anki, AnkiWeb, MDict, or any dictionary publisher. Anki is a trademark of Ankitects Pty Ltd.

Development

The add-on is a standard Anki Python module. For local development, copy the mdx_batch_meaning directory into Anki's addons21 directory and restart Anki.

To build an .ankiaddon, create a ZIP whose root directly contains __init__.py, manifest.json, and the other add-on files, then rename the archive extension to .ankiaddon. Do not include the parent directory, __pycache__, test data, or dictionary files.

License

The add-on source code is released under the MIT License.

Acknowledgements

The MDX format is not officially documented. The reader implementation was informed by publicly available MDict format research, including mdict-utils and writemdict.