Skip to content

Commit 81a6bbe

Browse files
committed
update: README.
1 parent ba4170e commit 81a6bbe

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

README.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,59 @@
1-
# RimeToGboardDictionary
1+
# RGDictConverter
22

33
## 简介
44

5-
本脚本可将 Rime `xxx.userdb.txt` (测试于 [Weasel](https://github.com/rime/weasel)) 转换为 Gboard `PersonalDictionary.zip` 格式, 便于将词库导入 gboard.
5+
本脚本可将 Rime `xxx.userdb.txt` (测试于 [Weasel](https://github.com/rime/weasel)) 转换为 Gboard `PersonalDictionary.zip` 格式, 便于将词库导入 Gboard.
66

77
## 脚本依赖
88

99
- Python 3.10.9
10-
- OpenCC 1.1.1
11-
- tqdm 4.64.1
10+
- OpenCC 1.1.1
11+
- tqdm 4.64.1
1212

1313
## 使用方法
1414

15+
### 命令行
16+
1517
1. 安装 python 以及依赖:
1618

1719
```shell
18-
pip3 install -r requirements.txt
20+
pip install -r requirements.txt
1921
```
2022

21-
2. 运行脚本, 按照提示将你的待转换的 `userdb.txt` 拖拽入命令行.
23+
2. (可选) userdb.txt 文件内容是 rime 默认为繁体中文, 如果是简体中文的 userdb.txt, 则需注释一行代码 `userdb_data = trans_to_simp(userdb_data)`:
24+
25+
```python
26+
def main():
27+
# 获取 rime userdb.txt 用户词典
28+
userdb_data = read_file()
29+
30+
# (可选)将繁体字的userdb.txt内容转成简体字
31+
userdb_data = trans_to_simp(userdb_data)
32+
33+
# 匹配自定义短语
34+
words_list = find_words(userdb_data)
35+
36+
# 新建列表存储短语
37+
new_words_list = generate_gboard_format_data(words_list)
2238
23-
3. 按照提示, 输入 `userdb.txt``PersonalDictionary.zip` 的文字简繁类型.
39+
# 生成 gboard 个人词典
40+
generate_gboardDic(words_list=new_words_list)
41+
```
42+
43+
3. 运行脚本, 按照提示将你的待转换的 `userdb.txt` 拖拽入命令行.
2444

2545
4. 回车, 等待数秒, `.zip` 压缩文件将自动生成.
2646

2747
5. 将 `.zip` 压缩文件导入手机存储中, 在 gboard 设置 - 字典 - 个人字典 - 中文 (简体) - 点击右上角 *导入* - 选择 `.zip` 压缩文件.
2848

49+
### 应用程序
50+
51+
1. [下载](https://github.com/cgcel/RGDictConverter/releases) 应用程序, 保存至本地
52+
2. 打开 RGDictConverter.exe, 按照提示将待转换的 `*.userdb.txt` 拖入窗口, 或直接输入文件地址
53+
3. 按照后续提示输入繁简类型后回车
54+
4. 与 [上述](#命令行) 第5步操作一致
55+
56+
2957
## License
3058

3159
Copyright 2023 GC Chen

0 commit comments

Comments
 (0)