-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdetenele.schema.yaml
More file actions
286 lines (252 loc) · 6.53 KB
/
Copy pathdetenele.schema.yaml
File metadata and controls
286 lines (252 loc) · 6.53 KB
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# 動態能力注音 Rime 輸入方案
schema:
schema_id: detenele
name: 動態能力注音
version: "0.5"
author:
- 居戎氏
description: |
動態切換聲母、韻母層級的注音鍵盤。
小寫:聲母;大寫(Shift):韻母及聲調。
聲調使用字母鍵:V (1) B (2) N (3) M (4) P (5)。
零聲母:q (例:<an> = qs),或以大寫的韻母鍵起首;
非零聲母音節自動識別聲母、韻母、聲調,無須切換 Shift。
簡拼:省略聲調、僅輸入聲母、輸入聲母+聲調。
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
abbrev: [ 中, A ]
- name: full_shape
states: [ 半角, 全角 ]
- options:
- zh_hant
- zh_hans
- zh_hant_hk
- zh_hant_tw
states:
- 傳統漢字
- 简化字
- 香港字形
- 臺灣字形
abbrev: [ 漢, 简, 港, 臺 ]
- name: ascii_punct
states: [ 。,, ., ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- script_translator
filters:
- simplifier@zh_hans
- simplifier@zh_hant_hk
- simplifier@zh_hant_tw
- uniquifier
speller:
# 字母表
alphabet: "zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA"
delimiter: " '"
initials: 'qwertyuiopasdfghjklzxcvbnmWERTYUIOSDFGHJKL'
# 符號鍵作為強制終止符
# 這保證了輸入這些符號時,音節立即切分
finals: "VBNMP"
algebra:
# ============================================================
# 1. 拼音預處理
# ============================================================
# 聲調轉碼 -> 符號
- xform|1$|V|
- xform|2$|B|
- xform|3$|N|
- xform|4$|M|
- xform|5$|P|
# 零聲母與拼音還原
# 注意:r (er) 也是零聲母的一種
- xform/^r([VBNMP])$/er$1/
# 零聲母處理:在 a, o, e 開頭的音節前插入 Q
- derive/^([aoe])/Q$1/
- xform/([jqx])u/$1v/
- xform/^yu/v/
- xform/^yi?/i/
- xform/^wu?/u/
# 韻母/介音還原
- xform/iu/iou/
- xform/ui/uei/
- xform/un/uen/
- xform/iong/vng/
- xform/ong/ung/
# 翹舌音轉臨時碼
- xform/^zhi?/Z/
- xform/^chi?/C/
- xform/^shi?/S/
- xform/^([zcsr])i([VBNMP])/$1$2/
# ============================================================
# 2. 嚴格映射
# ============================================================
- xform/ang/F/
- xform/ing/JG/
- xform/ung/KG/
- xform/vng/LG/
- xform/eng/G/
- xform/an/A/
- xform/in/JD/
- xform/vn/LD/
- xform/en/D/
- xform/er/H/
- xform/ai/Y/
- xform/ei/U/
- xform/ao/I/
- xform/ou/O/
- xform/a/W/
- xform/o/E/
- xform/ie/JT/
- xform/ve/LT/
- xform/eh/T/
- xform/e/R/
- xform/i/J/
- xform/u/K/
- xform/v/L/
# ============================================================
# 3. 聲母映射
# ============================================================
- xform/^b/w/
- xform/^p/e/
- xform/^r/v/
- xform/^m/r/
- xform/^t/u/
- xform/^f/t/
- xform/^d/y/
- xform/^n/i/
- xform/^l/o/
- xform/^g/a/
- xform/^s/m/
- xform/^k/s/
- xform/^h/d/
- xform/^j/f/
- xform/^q/g/
- xform/^x/h/
- xform/^z/b/
- xform/^c/n/
- xform/^Z/z/
- xform/^C/x/
- xform/^S/c/
- xform/^Q/q/
- xform/A/S/
# ============================================================
# 4. 連鎖動態衍生
# ============================================================
- derive/^J/j/
- derive/^K/k/
- derive/^L/l/
# 支持小寫輸入韻母、聲調
- derive/^(.)([WERTYUIOSDFGHJKL]+)([VBNMP]?)$/$1\L$2\E$3/
- derive/^(.*)([VBNMP])$/$1\L$2\E/
# ============================================================
# 5. 簡拼與聲調
# ============================================================
- abbrev/^([qwertyuioasdfghzxcvbnm]).+$/$1/
# 省略韻母,保留聲調
- abbrev/^([qwertyuioasdfghzxcvbnm]).*([VBNMP])$/$1$2/
- abbrev/^([qwertyuioasdfghzxcvbnm]).*([VBNMP])$/$1\L$2\E/
# 省略聲調
- derive/^(.+)[VBNMP]$/$1/
translator:
dictionary: terra_pinyin
prism: detenele
preedit_format:
# 顯示優化:符號 -> 注音聲調
- "xform/V([ ']|$)/ˉ$1/"
- "xform/B([ ']|$)/ˊ$1/"
- "xform/N([ ']|$)/ˇ$1/"
- "xform/M([ ']|$)/ˋ$1/"
- "xform/[Pp]([ ']|$)/˙$1/"
- "xform/([A-Za-z])v([ ']|$)/$1ˉ$2/"
- "xform/([A-Za-z])b([ ']|$)/$1ˊ$2/"
- "xform/([A-Za-z])n([ ']|$)/$1ˇ$2/"
- "xform/([A-Za-z])m([ ']|$)/$1ˋ$2/"
# 零聲母 Q 顯示
- xform/q/〇/
# 聲母
- "xform/(^|[ '])w/$1ㄅ/"
- "xform/(^|[ '])e/$1ㄆ/"
- "xform/(^|[ '])r/$1ㄇ/"
- "xform/(^|[ '])t/$1ㄈ/"
- "xform/(^|[ '])y/$1ㄉ/"
- "xform/(^|[ '])u/$1ㄊ/"
- "xform/(^|[ '])i/$1ㄋ/"
- "xform/(^|[ '])o/$1ㄌ/"
- xform/a/ㄍ/
- "xform/(^|[ '])s/$1ㄎ/"
- "xform/(^|[ '])d/$1ㄏ/"
- "xform/(^|[ '])f/$1ㄐ/"
- "xform/(^|[ '])g/$1ㄑ/"
- "xform/(^|[ '])h/$1ㄒ/"
- "xform/(^|[ '])z/$1ㄓ/"
- "xform/(^|[ '])x/$1ㄔ/"
- "xform/(^|[ '])c/$1ㄕ/"
- "xform/(^|[ '])v/$1ㄖ/"
- "xform/(^|[ '])b/$1ㄗ/"
- xform/n/ㄘ/
- xform/m/ㄙ/
# 介音
- xform/J|j/ㄧ/
- xform/K|k/ㄨ/
- xform/L|l/ㄩ/
# 韻母
- xform/W|w/ㄚ/
- xform/E|e/ㄛ/
- xform/R|r/ㄜ/
- xform/T|t/ㄝ/
- xform/Y|y/ㄞ/
- xform/U|u/ㄟ/
- xform/I|i/ㄠ/
- xform/O|o/ㄡ/
- xform/S|s/ㄢ/
- xform/D|d/ㄣ/
- xform/F|f/ㄤ/
- xform/G|g/ㄥ/
- xform/H|h/ㄦ/
punctuator:
import_preset: default
key_binder:
import_preset: default
bindings:
# 字形轉換
- { when: always, accept: Control+Shift+4, toggle: zh_hans }
- { when: always, accept: Control+Shift+dollar, toggle: zh_hans }
recognizer:
import_preset: default
zh_hans:
option_name: zh_hans
opencc_config: t2s.json
tips: all
excluded_types: [ reverse_lookup ]
zh_hant_hk:
option_name: zh_hant_hk
opencc_config: t2hk.json
tips: none
excluded_types: [ reverse_lookup ]
zh_hant_tw:
option_name: zh_hant_tw
opencc_config: t2tw.json
tips: none
excluded_types: [ reverse_lookup ]
__patch:
# 使用八股文語言模型
- grammar:/hant?
# 用家自選配置
- detenele.custom:/patch?