Skip to content

Commit 81760f5

Browse files
committed
Add supported format of pinyin dictionary
1 parent 6ea996d commit 81760f5

File tree

2 files changed

+68
-8
lines changed

2 files changed

+68
-8
lines changed

docs/faq.en.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Some frequently asked questions.
44

55
## How to import table
66

7-
[fcitx5-android#175](https://github.com/fcitx5-android/fcitx5-android/pull/175) adds the support of importing table based input method, so after `0.0.3-43`, you can import table using following steps:
7+
[fcitx5-android#175](https://github.com/fcitx5-android/fcitx5-android/pull/175) adds the support of importing table based input method, so after `0.0.3-43`, you can import table with following steps:
88

99
1. Obtain the configuration file of the input method (the filename extension should be `.conf` or `.conf.in`) and table dictionary (the filename extension should be `.dict` or `.txt`) to be imported. Take "zhengma" as an example, you can download `zhengma.conf.in` and `zhengma.txt` at [fcitx/fcitx5-table-extra](https://github.com/fcitx/fcitx5-table-extra).
1010
2. Open the App, navigate to Addons → Table (click the gear button on the right) → Manage Table Input Methods, and click the plus button in the lower right corner. Select the second term, i.e. "From separate files", in the dialog that pops up.
1111
3. In the new dialog, click "Input method configuration file" and select `zhengma.conf.in` obtained in step 1; click "Table dictionary" and select `zhengma.txt` obtained in step 1; and click OK button.
12-
4. A notification of "Importing zheng,a.conf.in" should be created by the App. If the file are correct, the operation may take a few seconds. Then, you will see "Zhengma" in the list.
12+
4. A notification of "Importing zheng,a.conf.in" should be created by the App. If the files are correct, the operation may take a few seconds. Then, you will see "Zhengma" in the list.
1313

1414
## How to import table manually
1515

@@ -25,7 +25,7 @@ In order to import a table manually, you need to have a correct input method con
2525

2626
!!! warning
2727

28-
Above absolute paths may not apply if you configured [work profile](https://developer.android.com/work/versions/android-11#work).
28+
Absolute paths above may not apply if you configured [work profile](https://developer.android.com/work/versions/android-11#work).
2929
We recommend using the builtin file manager (via DocumentsUI) to manage the data of Fcitx5 for Android.
3030
You can access the files in `/sdcard/Android/data/org.fcitx.fcitx5.android/files/` by selecting "Fcitx 5 for Android" in the sidebar of DocumentsUI. No third-party file manager/adb/root permission are required.
3131

@@ -75,15 +75,44 @@ The input history and user dinctionary for Pinyin/Shuangpin are at `data/pinyin/
7575

7676
!!! warning
7777

78-
Above absolute paths may not apply if you configured [work profile](https://developer.android.com/work/versions/android-11#work).
78+
Absolute paths above may not apply if you configured [work profile](https://developer.android.com/work/versions/android-11#work).
7979
We recommend using the builtin file manager (via DocumentsUI) to manage the data of Fcitx5 for Android.
8080
You can access the files in `/sdcard/Android/data/org.fcitx.fcitx5.android/files/` by selecting "Fcitx 5 for Android" in the sidebar of DocumentsUI. No third-party file manager/adb/root permission are required.
8181

8282
## How to import Pinyin dictionary
8383

84-
Fcitx 5 supports custom dictionaries. They are stored in `data/pinyin/dictionaries`.
85-
Fcitx 5 for Android registers three supported file types: `.dict`, `.scel`, and `.txt`, so uou can import the the dictionary by opening the file with Fcitx5 for Android.
86-
You can also manage the dictionary using *Pinyin Dictionaries* in settings.
84+
Fcitx 5 supports custom pinyin dictionaries, which are stored in `data/pinyin/dictionaries`.
85+
Fcitx 5 for Android registers three supported file types: `.dict`, `.scel`, and `.txt`, so you can import the the dictionary by opening the file with Fcitx5 for Android.
86+
87+
!!! hint
88+
89+
You can also manage dictionaries using *Pinyin Dictionaries* in settings.
90+
91+
## What's the format of Pinyin dictionary
92+
93+
The pinyin dictionary to be imported has to be in one of the following three formats:
94+
95+
* [sougou scel dict](https://pinyin.sogou.com/dict/), a `.scel` file
96+
* libime text format, a `.txt` file where word, full pinyin, and weight form into three columns, e.g.
97+
```
98+
拼音 pin'yin 0
99+
```
100+
* libime binary format, a `.dict` file which can be converted from text format using command line tool `libime_pinyindict`
101+
102+
103+
We recommend using `.txt` format if you want to make your own dictionary.
104+
105+
!!! note
106+
107+
When importing `.scel` or `.txt` dictionary, it will be automatically converted into `.dict` format.
108+
109+
!!! hint
110+
111+
You may refer to the builtin [emoji dictionary](https://github.com/fcitx/fcitx5-chinese-addons/blob/5.0.16/im/pinyin/emoji.txt) as an example of libime text format.
112+
113+
!!! hint
114+
115+
Some third-party pinyin dictionaries may provide libime binary format ready to be imported, such as [fcitx5-pinyin-zhwiki](https://github.com/felixonmars/fcitx5-pinyin-zhwiki) and [mw2fcitx](https://github.com/outloudvi/mw2fcitx).
87116

88117
## How to input emoticon, emoji, or specific unicode symbol
89118

docs/faq.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,39 @@ Fcitx 5 的配置文件、输入历史及用户词库存储在设备外置存储
7575

7676
## 如何为拼音输入法导入第三方词库
7777

78-
Fcitx 5 支持使用第三方[词库](https://wiki.archlinux.org/title/Fcitx5_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#%E8%AF%8D%E5%BA%93)。第三方词库的 *.dict 文件也存储在与用户词库相同的目录下,路径是 `data/pinyin/dictionaries`。小企鹅输入法5注册了 `.dict``.scel`,以及 `.txt` 文件打开打开方式,因此您可以直接用应用打开词典文件来导入。您也可以在拼音输入法的设置界面中使用 `词库` 来管理添加的词库。
78+
Fcitx 5 支持使用第三方[词库](https://wiki.archlinux.org/title/Fcitx5_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#%E8%AF%8D%E5%BA%93)。第三方词库的 *.dict 文件也存储在与用户词库相同的目录下,路径是 `data/pinyin/dictionaries`。小企鹅输入法5注册了 `.dict``.scel`,以及 `.txt` 文件打开打开方式,因此您可以直接用应用打开词典文件来导入。
7979

80+
!!! hint
81+
82+
您也可以在拼音输入法的设置界面中使用 *词库 (Pinyin Dictionaries)* 来管理添加的词库。
83+
84+
## 拼音词库的格式是什么
85+
86+
要导入的拼音字典必须是以下三种格式之一:
87+
88+
* [搜狗细胞词库](https://pinyin.sogou.com/dict/),拓展名为 `.scel`
89+
* libime 文本格式,一个 `.txt` 文件,其中单词、全拼和权重按照
90+
```
91+
拼音 pin'yin 0
92+
词条 全拼 权重
93+
```
94+
排成三列
95+
* libime 二进制格式,一个 `.dict` 文件,可以用命令行工具 `libime_pinyindict` 从文本格式转换而来
96+
97+
98+
如果您想制作你自己的字典,我们建议使用 `.txt` 格式。
99+
100+
!!! note
101+
102+
当导入 `.scel` 或 `.txt` 字典时,它将被自动转换为 `.dict` 格式。
103+
104+
!!! hint
105+
106+
具体 libime 文本格式的例子您可以参考内置的 [emoji 词典](https://github.com/fcitx/fcitx5-chinese-addons/blob/5.0.16/im/pinyin/emoji.txt)。
107+
108+
!!! hint
109+
110+
一些第三方词库可能会提供 libime 二进制格式,比如 [fcitx5-pinyin-zhwiki](https://github.com/felixonmars/fcitx5-pinyin-zhwiki) 和 [mw2fcitx](https://github.com/outloudvi/mw2fcitx)。
80111
## 如何输入颜文字、emoji 符号与特定的 unicode 符号
81112
82113
按住键盘左下方的 `,` 键,然后将手指滑向上方出现的三个按钮之一

0 commit comments

Comments
 (0)