forked from rimeinn/rime-moran
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoran.yaml
245 lines (236 loc) · 7.5 KB
/
moran.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# 拼寫運算
algebra:
# 任何編碼都會經過演算式的運算轉變爲用戶直接輸入的編碼。
# 優先級順序爲:
# user_force_top
# -> user_sentence_top
# -> generate_code
# -> user_sentence_bottom
# -> user_force_bottom
# 用戶自定義演算式,這部分演算式會注入到所有方案的開頭和結尾,包括字詞模式和英語詞庫
# 用例:手機上的模糊鍵盤映射
user_force_top:
user_force_bottom:
# __append:
# __patch:
# - moran_defs:/keyboard19
# 用戶自定義演算式,這部分演算式會注入到類整句方案的開頭和結尾,不包括字詞模式
# 用例:實現模糊音、將自然碼雙拼映射爲別的雙拼方案等
user_sentence_top:
__append:
__patch:
- moran_defs:/fly/qx_qo # ZRM-SPECIFIC
- moran_defs:/fly/xq_xo # ZRM-SPECIFIC
# 模糊音設置
# - moran_defs:/bufen/z_zh
# - moran_defs:/bufen/c_ch
# - moran_defs:/bufen/s_sh
# - moran_defs:/bufen/en_eng
user_sentence_bottom:
# 用於生成用戶輸入碼的核心演算式
generate_code:
__append:
- derive|^(.+);(\w)(\w)$|$1$2$3o| # 全碼 YYXXo
- derive|^(.+);(\w)(\w)$|$1$2$3/| # 全碼 YYXX/
- abbrev/^(.+);(\w)(\w)$/$1$2$3/ # 降低 YYXX 優先級
- derive/^(.+);(\w)(\w)$/$1$2/ # 構詞可以用 YYX
- derive/^(.+);(\w)(\w)$/$1/ # 構詞可以用 YY
# ZRM-SPECIFIC: 特殊優化:部分音節字極少,幾乎不參與構詞,則提升對應四碼字的優先級
# ZRM-SPECIFIC: (僅對自然碼雙拼有效,其他雙拼方案需作對應修改)
- derive/^(.+);(bd|dw|df|yl|rw|fs|iw|pd|sw|cz|dn|zy|nw)$/$1$2/ # ZRM-SPECIFIC
- erase/^pp$/ # ZRM-SPECIFIC
- erase/^(.+);(.+)$/ # 刪除原始編碼以加速檢索
key_bindings:
# 分號用於次選
moran_semicolon_for_2:
__append:
- { when: has_menu, accept: semicolon, send: "2" }
# 使用 tab 在不同音節間跳轉
moran_tab:
__append:
- { when: has_menu, accept: "Tab", send: "Control+Right" }
- { when: composing, accept: "Tab", send: "Control+Right" }
# 一些功能的開關鍵
moran_switches:
__append:
- { when: has_menu, accept: "Control+s", toggle: traditionalization }
- { when: has_menu, accept: "Control+u", toggle: unicode_comment }
- { when: has_menu, accept: "Control+q", toggle: emoji }
- { when: composing, accept: "Control+x", toggle: extended_charset }
- { when: has_menu, accept: "Control+Shift+0", toggle: std_opencc }
- { when: has_menu, accept: "Control+i", toggle: chaifen }
- { when: has_menu, accept: "Control+period", toggle: pinyinhint }
# 使用大寫字母追加輸入到上一個音節末尾
moran_capital_for_last_syllable:
__append:
- {
when: has_menu,
accept: Shift+A,
send_sequence: "{Control+Left}a{Control+Right}",
}
- {
when: has_menu,
accept: Shift+B,
send_sequence: "{Control+Left}b{Control+Right}",
}
- {
when: has_menu,
accept: Shift+C,
send_sequence: "{Control+Left}c{Control+Right}",
}
- {
when: has_menu,
accept: Shift+D,
send_sequence: "{Control+Left}d{Control+Right}",
}
- {
when: has_menu,
accept: Shift+E,
send_sequence: "{Control+Left}e{Control+Right}",
}
- {
when: has_menu,
accept: Shift+F,
send_sequence: "{Control+Left}f{Control+Right}",
}
- {
when: has_menu,
accept: Shift+G,
send_sequence: "{Control+Left}g{Control+Right}",
}
- {
when: has_menu,
accept: Shift+H,
send_sequence: "{Control+Left}h{Control+Right}",
}
- {
when: has_menu,
accept: Shift+I,
send_sequence: "{Control+Left}i{Control+Right}",
}
- {
when: has_menu,
accept: Shift+J,
send_sequence: "{Control+Left}j{Control+Right}",
}
- {
when: has_menu,
accept: Shift+K,
send_sequence: "{Control+Left}k{Control+Right}",
}
- {
when: has_menu,
accept: Shift+L,
send_sequence: "{Control+Left}l{Control+Right}",
}
- {
when: has_menu,
accept: Shift+M,
send_sequence: "{Control+Left}m{Control+Right}",
}
- {
when: has_menu,
accept: Shift+N,
send_sequence: "{Control+Left}n{Control+Right}",
}
- {
when: has_menu,
accept: Shift+O,
send_sequence: "{Control+Left}o{Control+Right}",
}
- {
when: has_menu,
accept: Shift+P,
send_sequence: "{Control+Left}p{Control+Right}",
}
- {
when: has_menu,
accept: Shift+Q,
send_sequence: "{Control+Left}q{Control+Right}",
}
- {
when: has_menu,
accept: Shift+R,
send_sequence: "{Control+Left}r{Control+Right}",
}
- {
when: has_menu,
accept: Shift+S,
send_sequence: "{Control+Left}s{Control+Right}",
}
- {
when: has_menu,
accept: Shift+T,
send_sequence: "{Control+Left}t{Control+Right}",
}
- {
when: has_menu,
accept: Shift+U,
send_sequence: "{Control+Left}u{Control+Right}",
}
- {
when: has_menu,
accept: Shift+V,
send_sequence: "{Control+Left}v{Control+Right}",
}
- {
when: has_menu,
accept: Shift+W,
send_sequence: "{Control+Left}w{Control+Right}",
}
- {
when: has_menu,
accept: Shift+X,
send_sequence: "{Control+Left}x{Control+Right}",
}
- {
when: has_menu,
accept: Shift+Y,
send_sequence: "{Control+Left}y{Control+Right}",
}
- {
when: has_menu,
accept: Shift+Z,
send_sequence: "{Control+Left}z{Control+Right}",
}
- {
when: has_menu,
accept: Shift+BackSpace,
send_sequence: "{Control+Left}{BackSpace}{Control+Right}",
}
# 支持小鍵盤數字鍵和回車鍵
moran_keypad:
__append:
- { when: composing, accept: KP_Enter, send: Return }
- { when: composing, accept: KP_0, send: "0" }
- { when: composing, accept: KP_1, send: "1" }
- { when: composing, accept: KP_2, send: "2" }
- { when: composing, accept: KP_3, send: "3" }
- { when: composing, accept: KP_4, send: "4" }
- { when: composing, accept: KP_5, send: "5" }
- { when: composing, accept: KP_6, send: "6" }
- { when: composing, accept: KP_7, send: "7" }
- { when: composing, accept: KP_8, send: "8" }
- { when: composing, accept: KP_9, send: "9" }
octagram:
disable:
__patch:
grammar: {}
enable_for_sentence:
__patch:
grammar:
language: zh-hans-t-essay-bgw
collocation_max_length: 4
collocation_min_length: 3
enable_for_fixed:
__patch:
grammar:
language: zh-hans-t-essay-bgc
collocation_max_length: 4
collocation_min_length: 2
fixed/+:
contextual_suggestions: true
max_homographs: 7
translator/+:
contextual_suggestions: true
max_homographs: 7