https://github.com/cgcel/rime_to_gboard
将 Rime userdb.txt 转换为 Gboard PersonalDictionary.zip 格式, 便于将词库导入 Gboard.
https://github.com/cgcel/rime_to_gboard
gboard gboard-dictionary google-pinyin rime rime-weasel
Last synced: 3 months ago
JSON representation
将 Rime userdb.txt 转换为 Gboard PersonalDictionary.zip 格式, 便于将词库导入 Gboard.
- Host: GitHub
- URL: https://github.com/cgcel/rime_to_gboard
- Owner: velviagris
- License: mit
- Created: 2022-12-30T03:17:46.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-26T15:04:55.000Z (9 months ago)
- Last Synced: 2025-02-06T10:03:45.758Z (4 months ago)
- Topics: gboard, gboard-dictionary, google-pinyin, rime, rime-weasel
- Language: Python
- Homepage:
- Size: 39.1 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License.txt
Awesome Lists containing this project
- awesome-rime - cgcel/rime_to_gboard - 将 Rime userdb.txt 转换为 Gboard PersonalDictionary.zip 格式, 便于将词库导入 Gboard (其他)
README
# rime_to_gboard



[](https://github.com/cgcel/rime_to_gboard/actions/workflows/codeql.yml)## 简介
借助 Rime 输入法的 `userdb.txt` 用户词库, 让 Gboard 的输入体验媲美旧时的 Google Pinyin.
本脚本可将 Rime `xxx.userdb.txt` (测试于 [Weasel](https://github.com/rime/weasel)) 转换为 Gboard `PersonalDictionary.zip` 格式, 便于将词库导入 Gboard.
## 适用输入方案
- 全拼
- 五笔 (测试)## 脚本依赖
- Python 3.8-3.10
- OpenCC 1.1.7
- tqdm 4.66.1## 使用方法
### 命令行启动
1. 安装 python 以及依赖:
```shell
pip install -r requirements.txt
```
2. 运行脚本, 按照提示将你的待转换的 `userdb.txt` 拖拽入命令行, 或输入文件路径.> userdb.txt 路径相关疑问见 [Q&A](#qa)
3. 根据指引, 确认输入方案, 输入文件文本繁简类型.
4. 回车, 等待数秒, `.zip` 压缩文件将自动生成.
5. 将 `.zip` 压缩文件导入手机存储中, 在 Gboard 设置 - 字典 - 个人字典 - 中文 (简体) - 点击右上角 *导入* - 选择 `.zip` 压缩文件.

### 使用应用程序
1. [下载](https://github.com/cgcel/rime_to_gboard/releases) 应用程序, 保存至本地.
2. 打开 rime2gboard.exe, 按照提示将待转换的 `*.userdb.txt` 拖入窗口, 或直接输入文件路径.
3. 按照后续提示确认输入方案, 输入繁简类型后回车.
4. 与 [上述](#命令行) 第5步操作一致.## Q&A
### userdb.txt 所在路径
以小狼毫为例, 在 Rime 用户目录, 打开 `installation.yaml`:

```yaml
distribution_code_name: Weasel
distribution_name: "小狼毫"
distribution_version: 0.15.0.0
install_time: "Thu Sep 7 09:37:03 2023"
installation_id: "rime-weasel-cgc"
rime_version: 1.9.0
sync_dir: "D:\\NutBackup\\RimeSync"
update_time: "Mon Dec 18 09:12:35 2023"
```记下 `sync_dir` 的路径, 然后右键右下角 Rime 菜单栏图标, 点击 `用户资料同步`, 进入 `sync_dir` 的路径, 找到对应的 `*.userdb.txt`.

## License
**rime_to_gboard** is licensed under the MIT license. Refer to [LICENSE](https://github.com/cgcel/rime_to_gboard/blob/master/License.txt) for more information.