imewlconverter README

The project's README from github.com/studyzy/imewlconverter. As one markdown file: README.md.

深蓝词库转换

Stars Actions Check Integration Tests License Repo size Code Count

Join the chat Release Downloads

一款输入法词库转换软件,支持以下超过 20 种的输入法工具和词库

本程序支持批量转换(一次拖拽多个词库文件,或者按住 Ctrl 选择多个文件),支持命令行模式(在命令行下使用-h命令查看帮助),支持 Windows、Linux、MacOS。

快速安装(命令行工具)

前置要求

从源码安装

# 1. 克隆仓库
git clone https://github.com/studyzy/imewlconverter.git
cd imewlconverter

# 2. 构建命令行工具
dotnet build src/ImeWlConverterCmd

# 3. 验证安装(查看帮助)
dotnet src/ImeWlConverterCmd/bin/Debug/net10.0/ImeWlConverterCmd.dll --help

构建完成后,命令行工具位于 src/ImeWlConverterCmd/bin/Debug/net10.0/ImeWlConverterCmd.dll。

通过 dotnet <dll路径> 方式运行,也可以使用 dotnet run 简化调用:

# 方式一:直接运行 DLL
dotnet src/ImeWlConverterCmd/bin/Debug/net10.0/ImeWlConverterCmd.dll --help

# 方式二:使用 dotnet run(自动构建并运行,注意 -- 分隔符)
dotnet run --project src/ImeWlConverterCmd -- --help

使用 Makefile(推荐)

项目提供了 Makefile 简化构建流程:

git clone https://github.com/studyzy/imewlconverter.git
cd imewlconverter
make build-cmd                    # Debug 模式构建
# 或
DOTNET_CONFIG=Release make build-cmd  # Release 模式构建

支持列表

PC 端:

手机端:

该软件支持 6 种以上的输入法编码方法:

命令行使用

基本语法

# 使用 dotnet 运行(将 <dll路径> 替换为实际的 DLL 路径)
dotnet <dll路径> -i <输入格式> -o <输出格式> -O <输出文件> <输入文件>

# 如果设置了别名或使用 dotnet run
imewlconverter -i <输入格式> -o <输出格式> -O <输出文件> <输入文件>

格式代码速查表

格式代码 说明 文件扩展名 支持导入 支持导出
scel 搜狗拼音细胞词库 .scel ✅ ✅
sgpy 搜狗拼音文本格式 .txt ✅ ✅
sgpybin 搜狗拼音备份词库 .bin ✅ ✅
qqpy QQ 拼音文本格式 .txt ✅ ✅
qpyd QQ 拼音分类词库 .qpyd ✅ ❌
qcel QQ 拼音细胞词库 .qcel ✅ ❌
ggpy 谷歌拼音 .txt ✅ ✅
bdpy 百度拼音文本格式 .txt ✅ ✅
bdict 百度拼音二进制格式 .bdict ✅ ❌
rime Rime 输入法 .yaml ✅ ✅
zgpy 紫光拼音 .txt ✅ ✅
pyjj 拼音加加 .txt ✅ ✅
libpy libpinyin (Linux) .txt ✅ ✅
plist macOS 系统拼音 .plist ✅ ✅
fit FIT 输入法 (Mac) .txt ✅ ✅
self 自定义格式 .txt ✅ ✅

运行 --list-formats 可查看当前版本支持的完整格式列表。

常用示例

搜狗 scel 细胞词库转搜狗拼音 txt 格式:

dotnet ImeWlConverterCmd.dll -i scel -o sgpy -O output.txt input.scel

搜狗 scel 细胞词库转谷歌拼音格式:

dotnet ImeWlConverterCmd.dll -i scel -o ggpy -O output.txt input.scel

搜狗 scel 细胞词库转 Rime 格式:

dotnet ImeWlConverterCmd.dll -i scel -o rime -O output.yaml input.scel

多文件转换:

dotnet ImeWlConverterCmd.dll -i scel -o ggpy -O output.txt file1.scel file2.scel file3.scel

批量转换到目录(输出目录以 / 结尾):

dotnet ImeWlConverterCmd.dll -i scel -o ggpy -O ./output/ *.scel

使用过滤器:

dotnet ImeWlConverterCmd.dll -i scel -o ggpy -O output.txt -f "len:1-100|rm:eng|rm:num" input.scel

查看帮助和格式列表:

dotnet ImeWlConverterCmd.dll --help
dotnet ImeWlConverterCmd.dll --list-formats

完整使用示例(从安装到转换)

以下示例展示从克隆仓库到完成词库转换的完整流程:

# 1. 克隆并构建
git clone https://github.com/studyzy/imewlconverter.git
cd imewlconverter
dotnet build src/ImeWlConverterCmd

# 2. 将搜狗 scel 词库转为搜狗拼音 txt 格式
dotnet src/ImeWlConverterCmd/bin/Debug/net10.0/ImeWlConverterCmd.dll \
  -i scel -o sgpy -O 唐诗300首.txt \
  "src/ImeWlConverterCoreTest/Test/唐诗300首【官方推荐】.scel"

# 3. 将搜狗 scel 词库转为 Rime 格式
dotnet src/ImeWlConverterCmd/bin/Debug/net10.0/ImeWlConverterCmd.dll \
  -i scel -o rime -O 唐诗300首.yaml \
  "src/ImeWlConverterCoreTest/Test/唐诗300首【官方推荐】.scel"

也可以使用 dotnet run 方式运行(无需关心 DLL 路径):

cd imewlconverter
dotnet run --project src/ImeWlConverterCmd -- \
  -i scel -o sgpy -O 唐诗300首.txt \
  "src/ImeWlConverterCoreTest/Test/唐诗300首【官方推荐】.scel"

重要说明

从 v3.0.0 开始,命令行参数格式已更新为 GNU 风格。如果您使用的是旧格式(如 -i:scel),请参阅 MIGRATION.md 进行迁移。

集成测试

本项目包含完整的集成测试框架,确保各种输入法格式之间的转换正确性。

快速运行测试

# 1. 编译CLI工具
cd src/ImeWlConverterCmd
dotnet build -c Release

# 2. 运行集成测试
cd ../../tests/integration
./run-tests.sh --all

测试覆盖范围

当前已实现:

详细的测试矩阵与数据来源见 tests/integration/TEST-MATRIX.md。

更多信息

Star History

Star History Chart

imewlconverter (studyzy/imewlconverter)

Searching Database…

What is this?An open-source, free input method dictionary converter (深蓝词库转换). It moves your word dictionaries between 20+ Chinese input method tools — Sogou, QQ, Baidu, Rime, Microsoft Pinyin and more — and runs on Windows, Linux and macOS.
Is it a GUI app or a command-line tool?Both. The desktop GUI takes dictionary files by drag-and-drop (or Ctrl-select several at once), and there is a separate command-line mode with -h help for scripted use.
What do I need to get it running?The .NET SDK 10.0 or newer (check via dotnet --version), then build from source with the bundled Makefile; after that you can run the CLI with dotnet run or the built ImeWlConverterCmd.dll.
Can every format be written out as well as read?No — most formats convert both ways, but QQ .qpyd/.qcel and Baidu .bdict dictionaries are import-only. Run --list-formats to see the full import/export matrix of your version.
Why would I need this at all?Mainly for switching input methods without losing your accumulated personal word list: export the dictionary from the old IME (say Sogou) and convert it into the format of the new one (say Rime or Microsoft Pinyin).
Can it handle formats that are not on the list?Yes, through the self-defined custom format (code 'self', .txt) that supports both import and export — obscure or in-house dictionary formats can go through it as a bridge.
How trustworthy are the conversions?The repo ships an integration test framework covering imports, exports, filters, encodings and large-file performance, with a documented test matrix; the project has existed since 2012 and has over 10,000 GitHub stars.
Creator
studyzy
Size
64.6 MB
Stars
10.4K
Age
14y
Commits · 90 Days