-
Notifications
You must be signed in to change notification settings - Fork 0
/
combo_jyutping.schema.yaml
273 lines (238 loc) · 8.92 KB
/
combo_jyutping.schema.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
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
# Rime schema
# encoding: utf-8
schema:
schema_id: combo_jyutping
name: 宮保粵拼
version: "20200425"
author:
- 亶父 <[email protected]>
- 佛振 (輸入部分由其【宮保拼音】改編而來)
description: |-
並擊輸入粵拼
內部測試版
暫只支持eng-US鍵盤
tanxpyox/rime-combo-jyutping
dependencies:
- jyut6ping3 #支援正常粵拼反查
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- options: [ noop, trad_hk, trad_tw, simplification ]
states: [ 傳統漢字, 香港傳統漢字, 臺灣傳統漢字, 大陆简化汉字 ]
reset: 1
- name: ascii_punct
states: [ 。,, ., ]
- name: emoji_suggestion
reset: 1
states: [ "🈚️️\uFE0E", "🈶️️\uFE0F" ]
engine:
processors:
- ascii_composer
- recognizer
- chord_composer # 實現並擊按鍵處理
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- affix_segmentor@jyut6ping3
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- script_translator
- script_translator@jyut6ping3
filters:
- simplifier@trad_tw
- simplifier@trad_hk
- simplifier
- simplifier@emoji_suggestion
- uniquifier
- reverse_lookup_filter
editor:
bindings:
BackSpace: back_syllable
speller:
alphabet: zyxwvutsrqponmlkjihgfedcba
delimiter: " '"
algebra:
- derive/([123456])// # 忽略声调
- derive/^([aeiou])/q$1/ # 增加 q 表示喉塞
- xform/1/v/ # 陰平
- xform/4/vv/ # 陽平
- xform/2/x/ # 陰上
- xform/5/xx/ # 陽上
- xform/3/q/ # 陰去
- xform/6/qq/ # 陽去
- derive/^jy?([aeiou])/y$1/ # 容錯 je -> ye, jyu -> yu
- derive/^jyu/ju/ # 容錯 jyu -> ju
- derive/yu/y/ # 容錯 jyu -> jy
- derive/eoi$/oey/ # 容錯
- derive/eoi$/eoy/ # 容錯
- derive/eo/oe/ # 容錯 eo/oe 不分
- derive/oe(ng|k)$/eo$1/ # 容錯
- derive/aa$/a/ # 容錯
- abbrev/^([a-z]).+$/$1/ # 首字母簡拼
- abbrev/^([a-z]{2}).+$/$1/ # 首2字母簡拼
# 取消下兩行註釋,支援疑影不分
#- derive/^ng([aeiou])/$1/
#- derive/^([aeiou])/ng$1/
# 取消下行註釋,支援 n- 併入 l- ,如「你」讀若「理」
#- derive/^n/l/
# 取消下行註釋,支援 gw-、kw- 併入 g-、k- ,如「國」讀若「各」、「廓」讀若「確」
#- derive/^(g|k)w/$1/
# 取消下行註釋,支援獨立鼻音韻 ng 併入 m,如「吳」讀若「唔」
#- derive/^ng$/m/
# 取消下行註釋,支援聲母簡拼
#- abbrev/^(gw|kw|ng).+$/$1/
chord_composer:
# 字母表,包含用於並擊的按鍵
# 擊鍵雖有先後,形成並擊時,一律以字母表順序排列
alphabet: "aqzswxdecfrvgtbj; hnumkilop"
# 拼寫運算規則,將一組並擊編碼轉換爲拼音音節
algebra:
# 先將物理按鍵字符對應到宮保拼音鍵位中的拼音字母
- 'xlit|aqzswxdecfrvgtbj; hnumkilop|pbwsmfgkdznchtjiuAeOovNKMPI|'
# 以下根據宮保拼音的鍵位分別變換聲母、韻母部分
# 組合聲母
- xform/^gz/l/
- xform/^kn/ng/
- xform/^dc/t/
# 空格鍵單擊時產生空白
- 'xform/^A$/ /'
# 特例:以組合鍵[am]輸入拼音‹aa›
- xform/^Av$/aa/
# 韻母連擊
- xform/KP$/T/
- xform/NM$/X/
# i當聲母用 --> j-
- xform/^i$/ji/
- xform/^i([XK])/ji$1/
- xform/^i([AeovOINMPT])/j$1/
- xform/^iu$/jau/
- xform/^iu/ju/
- xform/^iI$/jaI/
#特別鍵碼輸入wu/u韻 (因爲單擊u會默認轉換成au)
- xform/^uv$/wU/
- xform/^uM$/wU/
- xform/^uv([^KX])/wU$1/
- xform/uv/U/
- xform/u([AeioO])v/$1U/
#u起首嘅字轉換成w
- xform/^u([AeioOINT])/w$1/
#gu或者ku跟韻母(u除外)自動轉換成gw,kw聲母;gk接u韻則保留
- xform/^ku([AiOMPT])/kw$1/
- xform/^gu([AiOMPT])/gw$1/
- xform/^([gk])iu([IXNMPTK])/$1wi$2/
#提供gw與kw嘅另一個指法(主要用於輸入gwan,gwai,gwang,kwai,kwan之類嘅音)
- xform/^sg/gw/
- xform/^mk/kw/
#保留uk,ung
- xform/^u([KX])/U$1/
#u+韻尾--> wu韻尾
- xform/^u([INMPT])/wu$1/
#單擊[u]變成[au]
- xform/^u$/au/
#/ui/韻特別鍵法
- xform/vI/UI/
#yu --> 自動變成jyu
- xform/^v/jv/
# 韻尾省略 ‹a›
- xform/([^AeiouvOaU])([IXNMPTK])$/$1a$2/
- xform/^([IXNMPTK])$/a$1/
- xform/([^AeiouvOa])u$/$1au/
# u次序轉換
- xform/u([AaeoO])/$1u/
#容錯
- xform/i([AaeoO])/$1i/
# eo/oe 轉換
- xform/O([INT])$/eo$1/
- xform/O/oe/
#代號轉換
- xform/A/aa/
- xform/X/ng/
- xform/I/i/
- xform/N/n/
- xform/M/m/
- xform/P/p/
- xform/T/t/
- xform/K/k/
- xform/U/u/
- xform/v/yu/
# 並擊完成後套用的式樣
output_format:
# 追加隔音符號
- xform/^(b|p|m|f|d|t|n|l|g|k|ng|h|gw|kw|w|z|c|s|j)$/$1'/" #縮寫
- xform/^(aa|aai|aau|aam|aan|aang|aap|aat|aak|ai|au|am|ang|ap|ak|e|ei|o|oi|ou|on|ong|ok|ung|uk|m|ng)$/$1$2'/"
- xform/(b)(aa|aai|aau|aan|aang|aat|aak|ai|au|am|an|ang|at|ak|e|ei|eng|ek|iu|in|ing|it|ik|o|ou|ong|ok|ui|un|ung|ut|uk)$/$1$2'/"
- xform/(p)(aa|aai|aau|aan|aang|aak|ai|au|an|ang|at|ei|eng|ek|iu|in|ing|it|ik|o|oi|ou|ong|ok|ui|un|ung|ut|uk)$/$1$2'/"
- xform/(m)(aa|aai|aau|aan|aang|aat|aak|ai|au|an|ang|at|ak|e|ei|eng|i|iu|in|ing|it|ik|o|ou|ong|ok|ui|un|ung|ut|uk)$/$1$2'/"
- xform/(f)(aa|aai|aan|aat|aak|ai|au|an|ang|at|e|ei|iu|o|ong|ok|u|ui|un|ung|ut|uk)$/$1$2'/"
- xform/(d)(aa|aai|aam|aan|aap|aat|aak|ai|au|am|an|ang|ap|at|ak|e|ei|eu|eng|ek|i|iu|im|in|ing|ip|it|ik|o|oi|ou|ong|ok|oe|oek|eoi|eon|eot|ung|uk|yun|yut)$/$1$2'/"
- xform/(t)(aa|aai|aam|aan|aap|aat|ai|au|am|an|ang|eng|ek|iu|im|in|ing|ip|it|ik|o|oi|ou|ong|ok|oe|eoi|eon|ung|uk|yun|yut)$/$1$2'/"
- xform/(n)(aa|aai|aau|aam|aan|aap|aat|ai|au|am|an|ang|ap|at|ak|e|ei|i|iu|im|in|ing|ip|ik|o|oi|ou|ong|ok|oeng|eoi|eot|ung|uk|yun)$/$1$2'/"
- xform/(l)(aa|aai|aau|aam|aan|aang|aap|aat|aak|ai|au|am|ang|ap|at|ak|e|ei|em|eng|ek|i|iu|im|in|ing|ip|it|ik|o|oi|ou|ong|ok|oeng|oek|eoi|eon|eot|ung|uk|yun|yut)$/$1$2'/"
- xform/(g)(aa|aai|aau|aam|aan|aang|aap|aat|aak|ai|au|am|an|ang|ap|at|e|ei|eng|ep|iu|im|in|ing|ip|it|ik|o|oi|ou|on|ong|ot|ok|oe|oeng|oek|eoi|u|ui|un|ung|uk|yun|yut)$/$1$2'/"
- xform/(k)(aa|aai|aau|aat|aak|ai|au|am|an|ang|ap|at|e|ei|ek|iu|im|in|ing|it|ik|o|oi|ong|ok|oe|oeng|oek|eoi|u|ui|ung|ut|uk|yun|yut)$/$1$2'/"
- xform/(ng)(aa|aai|aau|aam|aan|aang|aap|aat|aak|ai|au|am|an|ang|ap|at|ak|it|o|oi|ou|on|ong|ok|ung|uk)$/$1$2'/"
- xform/(h)(aa|aai|aau|aam|aan|aang|aap|aak|ai|au|am|an|ang|ap|at|ak|ei|eng|ek|iu|im|in|ing|ip|it|ik|o|oi|ou|on|ong|ot|ok|oe|oeng|eoi|ung|uk|yun|yut|m|ng)$/$1$2'/"
- xform/(gw)(aa|aai|aan|aang|aat|aak|ai|an|ang|at|ing|ik|o|ong|ok)$/$1$2'/"
- xform/(kw)(aa|aai|aang|ai|an|ik|ong|ok)$/$1$2'/"
- xform/(w)(aa|aai|aan|aang|aat|aak|ai|an|ang|at|ing|ik|o|ong|ok|u|ui|un|ut)$/$1$2'/"
- xform/(z)(aa|aai|aau|aam|aan|aang|aap|aat|aak|ai|au|am|an|ang|ap|at|ak|e|eng|ek|i|iu|im|in|ing|ip|it|ik|o|oi|ou|ong|ok|oeng|oek|eoi|eon|eot|ung|uk|yu|yun|yut)$/$1$2'/"
- xform/(c)(aa|aai|aau|aam|aan|aang|aap|aat|aak|ai|au|am|an|ang|ap|at|ak|e|eng|ek|i|iu|im|in|ing|ip|it|ik|o|oi|ou|ong|ok|oeng|oek|eoi|eon|eot|un|ung|uk|yu|yun|yut)$/$1$2'/"
- xform/(s)(aa|aai|aau|aam|aan|aang|aap|aat|aak|ai|au|am|an|ang|ap|at|ak|e|ei|eng|ek|i|iu|im|in|ing|ip|it|ik|o|oi|ou|ong|ok|oeng|oek|eoi|eon|eot|ung|uk|yu|yun|yut)$/$1$2'/"
- xform/(j)(aa|aai|aak|ai|au|am|an|ap|at|e|eng|i|iu|im|in|ing|ip|it|ik|o|ou|oeng|oek|eoi|eon|ung|uk|yu|yun|yut)$/$1$2'/"
# 消除不構成合法音節的並擊組合
- "erase/^([A-Za-z]+)$/"
# 並擊過程中套用的式樣
prompt_format:
# 加方括弧
- "xform/^(.*)$/[$1]/"
translator:
dictionary: jyut6ping3
prism: combo_jyutping
spelling_hints: 8
jyut6ping3:
tag: jyut6ping3
dictionary: jyut6ping3
prefix: "`"
suffix: ";"
tips: 〔粵拼(正常輸入)〕
preedit_format:
- xform/([aeioumngptk])vv/$1⁴/
- xform/([aeioumngptk])xx/$1⁵/
- xform/([aeioumngptk])qq/$1⁶/
- xform/([aeioumngptk])v/$1¹/
- xform/([aeioumngptk])x/$1²/
- xform/([aeioumngptk])q/$1³/
reverse_lookup:
tags: [ jyut6ping3 ]
overwrite_comment: false
dictionary: jyut6ping3
trad_tw:
option_name: trad_tw
opencc_config: t2tw.json
trad_hk:
option_name: trad_hk
opencc_config: t2hk.json
emoji_suggestion:
opencc_config: emoji.json
option_name: emoji_suggestion
tips: all
punctuator:
import_preset: default
key_binder:
import_preset: default
recognizer:
import_preset: default
patterns:
jyut6ping3: "`[a-z']*;?$"