-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathluna_pinyin.custom.yaml
191 lines (177 loc) · 8.35 KB
/
luna_pinyin.custom.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# luna_pinyin.custom.yaml
#
# 将朙月拼音的词库修改为朙月拼音扩充词库
#
# https://github.com/ASC8384/myRime
# mailto:ASC_8384@foxmail.com
# 有参考
#
# 部署位置:
# ~/.config/ibus/rime (Linux)
# ~/Library/Rime (Mac OS)
# %APPDATA%\Rime (Windows)
#
# 重新部署即可
#
patch:
# 翻页
#"key_binder/bindings":
# - { when: paging, accept: bracketleft, send: Page_Up }
# - { when: has_menu, accept: bracketright, send: Page_Down }
"switches/@0/reset": 1 #表示将 switcher 列表中的第一个元素(即 ascii_mode 开关)的初始值重设为状态1(即“英文”)。
#表情'/'输入
punctuator/import_preset: mysymbols #表情
recognizer/patterns/punct: "^\\\\([a-z]+|[0-9])$" #输入‘/’
# "^/([a-z]+|[0-9])$"
# end
# 自定义符号
#punctuator/full_shape:
#"/" : "/", "÷", "、"
#punctuator/half_shape:
#"/" : "/", "/", "÷", "、"
# end
# 活用标点创建自定义词组
#recognizer/patterns/reverse_lookup: #作用是关闭 ` 键的反查功能
#punctuator/half_shape:
# '`': [ '`', 'ASC_8384', 'ASC_8384@foxmail.com']
# end
# 扩充词库
translator/dictionary: luna_pinyin.extended
# 改寫拼寫運算,使得含西文的詞彙(位於 luna_pinyin.cn_en.dict.yaml 中)不影響簡拼功能
"speller/algebra/@before 0": xform/^([b-df-np-z])$/$1_/
# end
# 加載 easy_en 依賴,英文聯想輸入
"schema/dependencies/@next": easy_en
# 載入翻譯英文的碼表翻譯器,取名爲 english
"engine/translators/@next": table_translator@english
# english 翻譯器的設定項
english:
dictionary: easy_en
spelling_hints: 9
enable_completion: true
enable_sentence: false
initial_quality: -1
# end
#模糊音
#'speller/algebra':
#- derive/^([zcs])h/$1/ # zh, ch, sh => z, c, s
#- derive/^([zcs])([^h])/$1h$2/ # z, c, s => zh, ch, sh
#- derive/^n/l/ # n => l
#- derive/^l/n/ # l => n
#- derive/^r/l/ # r => l
#- derive/^ren/yin/ # ren => yin, reng => ying
#- derive/^shen/sehn/
#- derive/^r/y/ # r => y
#- derive/^hu$/fu/ # hu => fu
#- derive/^hong$/feng/ # hong => feng
#- derive/^hu([in])$/fe$1/ # hui => fei, hun => fen
#- derive/^hu([ao])/f$1/ # hua => fa, ...
#- derive/^fu$/hu/ # fu => hu
#- derive/^feng$/hong/ # feng => hong
#- derive/^fe([in])$/hu$1/ # fei => hui, fen => hun
#- derive/^f([ao])/hu$1/ # fa => hua, ...
#- derive/^([bpmf])eng$/$1ong/ # meng = mong, ...
#- derive/([ei])n$/$1ng/ # en => eng, in => ing
#- derive/([ei])ng$/$1n/ # eng => en, ing => in
#- derive/au$/ua/ # hau => hua, ...
#- derive/([aeiou])ng$/$1gn/ # dagn => dang
#- derive/([dtngkhrzcs])o(u|ng)$/$1o/ # zho => zhong|zhou
#- derive/ong$/on/ # zhonguo => zhong guo
#- derive/ao$/oa/ # hoa => hao
#- derive/([iu])a(o|ng?)$/a$1$2/ # tain => tian
#突然发现定制指南里有
peller/algebra':
- erase/^xx$/ # 第一行保留
# 模糊音定义
# 需要哪组就删去行首的 # 号,单双向任选
#- derive/^([zcs])h/$1/ # zh, ch, sh => z, c, s
#- derive/^([zcs])([^h])/$1h$2/ # z, c, s => zh, ch, sh
#- derive/^n/l/ # n => l
#- derive/^l/n/ # l => n
# 这两组一般是单向的
#- derive/^r/l/ # r => l
#- derive/^ren/yin/ # ren => yin, reng => ying
#- derive/^r/y/ # r => y
# 下面 hu <=> f 这组写法复杂一些,分情况讨论
#- derive/^hu$/fu/ # hu => fu
#- derive/^hong$/feng/ # hong => feng
#- derive/^hu([in])$/fe$1/ # hui => fei, hun => fen
#- derive/^hu([ao])/f$1/ # hua => fa, ...
#- derive/^fu$/hu/ # fu => hu
#- derive/^feng$/hong/ # feng => hong
#- derive/^fe([in])$/hu$1/ # fei => hui, fen => hun
#- derive/^f([ao])/hu$1/ # fa => hua, ...
# 韵母部份
#- derive/^([bpmf])eng$/$1ong/ # meng = mong, ...
#- derive/([ei])n$/$1ng/ # en => eng, in => ing
#- derive/([ei])ng$/$1n/ # eng => en, ing => in
# 样例足够了,其他请自己总结……
# 反模糊音?
# 谁说方言没有普通话精确、有模糊音,就能有反模糊音。
# 示例为分尖团的中原官话:
#- derive/^ji$/zii/ # 在设计者安排下鸠占鹊巢,尖音i只好双写了
#- derive/^qi$/cii/
#- derive/^xi$/sii/
#- derive/^ji/zi/
#- derive/^qi/ci/
#- derive/^xi/si/
#- derive/^ju/zv/
#- derive/^qu/cv/
#- derive/^xu/sv/
# 韵母部份,只能从大面上覆盖
#- derive/^([bpm])o$/$1eh/ # bo => beh, ...
#- derive/(^|[dtnlgkhzcs]h?)e$/$1eh/ # ge => geh, se => sheh, ...
#- derive/^([gkh])uo$/$1ue/ # guo => gue, ...
#- derive/^([gkh])e$/$1uo/ # he => huo, ...
#- derive/([uv])e$/$1o/ # jue => juo, lve => lvo, ...
#- derive/^fei$/fi/ # fei => fi
#- derive/^wei$/vi/ # wei => vi
#- derive/^([nl])ei$/$1ui/ # nei => nui, lei => lui
#- derive/^([nlzcs])un$/$1vn/ # lun => lvn, zun => zvn, ...
#- derive/^([nlzcs])ong$/$1iong/ # long => liong, song => siong, ...
# 这个办法虽从拼写上做出了区分,然而受词典制约,候选字仍是混的。
# 只有真正的方音输入方案才能做到!但“反模糊音”这个玩法快速而有效!
# 模糊音定义先于简拼定义,方可令简拼支持以上模糊音
- abbrev/^([a-z]).+$/$1/ # 简拼(首字母)
- abbrev/^([zcs]h).+$/$1/ # 简拼(zh, ch, sh)
# 以下是一组容错拼写,《汉语拼音》方案以前者为正
- derive/^([nl])ve$/$1ue/ # nve = nue, lve = lue
- derive/^([jqxy])u/$1v/ # ju = jv,
- derive/un$/uen/ # gun = guen,
- derive/ui$/uei/ # gui = guei,
- derive/iu$/iou/ # jiu = jiou,
# 自动纠正一些常见的按键错误
- derive/([aeiou])ng$/$1gn/ # dagn => dang
- derive/([dtngkhrzcs])o(u|ng)$/$1o/ # zho => zhong|zhou
- derive/ong$/on/ # zhonguo => zhong guo
- derive/ao$/oa/ # hoa => hao
- derive/([iu])a(o|ng?)$/a$1$2/ # tain => tian
# 分尖团后 v => ü 的改写条件也要相应地扩充:
#'translator/preedit_format':
# - "xform/([nljqxyzcs])v/$1ü/"#模糊音
#'speller/algebra':
#- derive/^([zcs])h/$1/ # zh, ch, sh => z, c, s
#- derive/^([zcs])([^h])/$1h$2/ # z, c, s => zh, ch, sh
#- derive/^n/l/ # n => l
#- derive/^l/n/ # l => n
#- derive/^r/l/ # r => l
#- derive/^ren/yin/ # ren => yin, reng => ying
#- derive/^shen/sehn/
#- derive/^r/y/ # r => y
#- derive/^hu$/fu/ # hu => fu
#- derive/^hong$/feng/ # hong => feng
#- derive/^hu([in])$/fe$1/ # hui => fei, hun => fen
#- derive/^hu([ao])/f$1/ # hua => fa, ...
#- derive/^fu$/hu/ # fu => hu
#- derive/^feng$/hong/ # feng => hong
#- derive/^fe([in])$/hu$1/ # fei => hui, fen => hun
#- derive/^f([ao])/hu$1/ # fa => hua, ...
#- derive/^([bpmf])eng$/$1ong/ # meng = mong, ...
#- derive/([ei])n$/$1ng/ # en => eng, in => ing
#- derive/([ei])ng$/$1n/ # eng => en, ing => in
#- derive/au$/ua/ # hau => hua, ...
#- derive/([aeiou])ng$/$1gn/ # dagn => dang
#- derive/([dtngkhrzcs])o(u|ng)$/$1o/ # zho => zhong|zhou
#- derive/ong$/on/ # zhonguo => zhong guo
#- derive/ao$/oa/ # hoa => hao
#- derive/([iu])a(o|ng?)$/a$1$2/ # tain => tian