This article was transcoded by SimpRead 简悦, original address dvel.me
Writing Dictionaries
Due to Rime’s design, non-pinyin codes are not applicable in pinyin dictionaries:
hello hello
世界 s j
蒙奇·D·路飞 meng qi d lu fei
非拼音编码 asdasdasd
When deploying, Rime generates a mapping table based on all syllables and spelling rules in the dictionary. If shorthand (jianpin) is enabled, too many English words will cause extreme lag while typing. The single codes above also cause s, j, and d endings to not respond to super shorthand.
It is recommended to place English in the English schema, and unconventional phonetics are suggested to be placed in custom phrases custom_phrase.txt.
The default columns of the dictionary are:
---
name: dictionary_name
version: "version_number"
sort: by_weight (sort by weight) | original (sort by code table order)
columns:
- text
- code
- weight
- stem
...
你好 ni hao 123
For dictionary files without phonetic annotations but with the need to set weights, just modify the columns:
---
name: xxx
version: "1"
sort: by_weight
columns:
- text
- weight
...
你好 123
Mounting Your Own Dictionary
Dictionary files end with .dict.yaml.
Dictionaries are specified by the specific schema:
translator:
dictionary: rime_ice
You can pile all entries in this single file, or use this file as an entry point to mount multiple dictionaries via import_tables:
---
name: rime_ice
version: "1"
import_tables:
- mydict
- cn_dicts/mydict2
...
---
name: mydict
version: "1"
sort: by_weight
...
你好 ni hao 1
世界 shi jie 1
The dictionary name xxx.dict.yaml and the name attribute in the dictionary name: xxx can be different, but it is recommended to keep them consistent.
Other types of dictionaries can be converted to Rime format through some scripts or Deep Blue dictionary conversion.