非 Amazon 商店购买书籍开启 Word Wise 功能
0. 开始之前
-
在进行任何操作前都应先验证下载的书籍是否格式正常、是否能在 Kindle 上成功打开,以便后续的 troubleshooting。
-
本文中提到的所有方法都需要 Calibre 支持。安装 Calibre 后需要手动将
ebook-convert在/usr/local/bin处生成同步链接:$ sudo ln -s /Applications/calibre.app/Contents/MacOS/ebook-convert /usr/local/bin
1. 直接抓取现成的 Word Wise 文件:WordDumb
Pros
- 全平台通用
- 抓取的 Word Wise 文件直接下载自 Kindle 电子书商店,经过 Amazon 的校验,释义会更加准确
- 有图形界面,操作简单
Cons
- 许多书籍并不支持 Word Wise,则无法抓取到对应的文件
1.1 环境配置
-
安装 Calibre 6
$ brew install calibre -
安装 64bit Python and pip
$ brew install python -
安装 WordDumb(在 Calibre 插件中搜索并安装)
1.2 使用 WordDumb 抓取 Word Wise 和 X-Ray 文件
- 把需要生成的书籍转换为
mobi或azw3格式。注意:语言应选择英文,编码应选择UTF-8。 - 使用 USB 连接 Kindle 到电脑。
- 点击工具栏中的 WordDumb 图标,生成所需文件。文件生成后会和书籍一并打包传送到 Kindle。
- 断开 Kindle 与电脑的连接,返回主页,等 Kindle 读出传送的文档即可。
2. 自己生成 Word Wise 文件:WiseCreator
Pros
- 全平台通用
- 可以为商店内未开启 Word Wise 功能的书籍生成对应文件
- 生成的提示词可以对应 Kindle 系统语言调整
Cons
- 略微年久失修
- 仅支持
azw3和mobi格式- 不支持修改取词难度
2.1 环境配置
-
安装 Calibre 6
$ brew install calibre -
安装 64bit Python and pip
$ brew install python -
下载 WiseCreator 源码,找到
wisecreator-third_party-KindleUnpack,将KindleUnpack内的所有内容替换为最新版 KindleUnpack 的源码。
2.2 使用 WiseCreator 生成 Word Wise 文件
-
把需要生成的书籍转换为
mobi或azw3格式。注意:语言应选择英文,编码应选择UTF-8。 -
从 WiseCreator 目录下运行:
python3 -m pip install wheel python3 -m pip install . -
对于更新到 Python 3.10 的用户,由于 Python 3.10 对
collectionsmodule 的一些变动:Deprecated since version 3.3, will be removed in version 3.10: Moved Collections Abstract Base Classes to the
collections.abcmodule. For backwards compatibility, they continue to be visible in this module through Python 3.9.此处会连续生成大量报错信息。按照报错提示,某些文件中的
collectionsimports 如果属于 Collections Abstract Base Classes ,则将collections更改为collections.abc。例:对于
Iterable应该改为from collections.abc,但对于defaultdict就应当保持from collections。另,如果原文中写在同一行,如:
from collections.abc import Mapping, defaultdict则应该拆分改为:
from collections import defaultdict from collections.abc import Mapping -
成功后继续从 WiseCreator 目录下运行:
python3 -m wisecreator.main <PATH_TO_YOUR_BOOK>其中
<PATH_TO_YOUR_BOOK>是需要转换的书籍路径。 -
处理完成后将生成的文件夹一并通过 USB 传送到 Kindle 对应的文件目录下,断开 Kindle 与电脑的连接,返回主页,等 Kindle 读出传送的文档即可。
3. 为任何格式生成 Word Wise 文件:wordwisecreator
Pros
- 支持全部格式的电子书
- 支持生成含有 Word Wise 提示词的
- 支持修改取词难度(5 档)
Cons
- 仅支持生成英文的 Word Wise 提示词
3.1 环境配置
-
安装 Calibre 6
$ brew install calibre -
安装 PHP
$ brew install php -
下载 wordwisecreator 源码。请注意,Linux / macOS 用户需要根据此处的说明将
wordwisecreator.php中两处:shell_exec('ebook-convert "'.$bookfile.'" .\book_dump.htmlz'); shell_exec('ebook-convert .\book_dump.htmlz .\book_dump_html');替换为
shell_exec('ebook-convert "'.$bookfile.'" ./book_dump.htmlz'); shell_exec('ebook-convert ./book_dump.htmlz ./book_dump_html');以及
shell_exec('ebook-convert .\book_dump_html\index1.html "'.$bookpath.'/'.$bookfilename.'-wordwised.epub"'); shell_exec('ebook-convert .\book_dump_html\index1.html "'.$bookpath.'/'.$bookfilename.'-wordwised.azw3"'); shell_exec('ebook-convert .\book_dump_html\index1.html "'.$bookpath.'/'.$bookfilename.'-wordwised.pdf"');替换为
shell_exec('ebook-convert ./book_dump_html/index1.html "'.$bookpath.'/'.$bookfilename.'-wordwised.epub"'); shell_exec('ebook-convert ./book_dump_html/index1.html "'.$bookpath.'/'.$bookfilename.'-wordwised.azw3"'); shell_exec('ebook-convert ./book_dump_html/index1.html "'.$bookpath.'/'.$bookfilename.'-wordwised.pdf"');即可正常使用。
3.2 使用 wordwisecreator 生成 Word Wise 文件
-
wordwisecreator 支持所有种类的电子书,因此无需特别进行格式转换。
-
从 wordwisecreator 目录运行:
php wordwisecreator.php <input_file> <hint_level>其中
input_file指的是需要转换的文件路径,hint_level从1到5依次为由难(尽量显示最少的提示词)到易(显示所有列表上的提示词)。 -
处理完成后将生成的文件通过 USB 传送到 Kindle 对应的文件目录下,断开 Kindle 与电脑的连接,返回主页,等 Kindle 读出传送的文档即可。