-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfull_bopomofo.schema.yaml
269 lines (253 loc) · 7.5 KB
/
full_bopomofo.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
# Rime schema
# encoding: utf-8
schema:
schema_id: full_bopomofo
name: "全碼注音"
version: '1.2.1'
author:
- imper0502 <[email protected]>
description: |
注音輸入法,採用「雙碼注音」鍵盤排列,輸出臺灣正體字形。雙碼注音的銜接方案。
dependencies:
- cangjie5
# 定義開關
switches:
- name: ascii_mode
reset: 0
states: [ "中", "En" ]
- name: full_shape
states: [ 半形, 全形 ]
- name: ascii_punct
states: [ "。,", ".," ]
- name: s2tw
reset: 1
# 啓用 opencc 字形轉換,但不在選單中顯示。
# states: [ "简化字", "教標字" ]
- name: t2tw
reset: 1
# 啓用 opencc 字形轉換,但不在選單中顯示。正 → 臺
# states: [ "傳承字", "教標字" ]
- name: tw2s
reset: 0
# 啓用 opencc 字形轉換。
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:
- echo_translator
- punct_translator
- table_translator@custom_phrase
- reverse_lookup_translator
- script_translator
filters:
- simplifier@s2tw # 簡繁轉換
- simplifier@t2tw # 正繁轉換
- simplifier@tw2s # 繁簡轉換
- uniquifier # 過濾重複的候選字,有可能來自簡正繁轉換
# 修改候選單標籤、修改候選單大小
menu:
alternative_select_labels: [ 6, 7, 8, 9, 0 ]
alternative_select_keys: 67890
page_size: 5
style: # 修改候選單標籤格式
label_format: ' %s '
speller: # 定義雙碼注音拼寫規則
alphabet: "abcdefghijklmnopqrstuvwxyz12345"
finals: "12345"
delimiter: " '"
algebra:
# 預處理
- erase/^xx$/ # 移除【xx】編碼
- xform/^m(\d)$/mu$1/ # ㄇ調 → ㄇㄨ調
- xform/^r5$/er5/ # 〜兒
- xform/v/ü/ # v → ü/
- xform/iu/iou/ # 補上漏音
- xform/ui/uei/ # 補上漏音
- xform/iong/üng/ # [jqx]iong → [jqx]üng
- xform/ong/ung/ # yong, -ong → yung, -ung
- xform/^yu/ü/ # yue, yuan, yun, yung → üe, üan, ün, üng
- xform/^yi?/i/ # yi, y- → i, i-
- xform/^wu?/u/ # wu, w- → u, u-
- xform/^([jqx])u/$1ü/ # 取消ㄐㄑㄒ的省略表示法
- xform/([iuü])n/$1en/ # in, ing, un, ung, ün, üng → ien, ieng, uen, ueng, üen, üeng
# 開始轉換輸入鍵
# 兩個「三合韻母」ㄤㄥ
- xform/ang/J/
- xform/eng/F/
# 六個「二合韻母」ㄞㄟㄠㄡㄢㄣ
- xform/ai/H/
- xform/ei/W/
- xform/ao/S/
- xform/ou/R/
- xform/an/K/
- xform/en/D/
# ㄦ及ㄝ
- xform/er/L/
- xform/eh/Q/
- xform/(?<=[iü])e/Q/
# 三個單韻母ㄚㄛㄜ
- xlit/aoe/AOE/
# 三個介音ㄧㄨㄩ
- xlit/iuy/IUY/
# 到此,介音、韻母全部大寫。
# 三個「二合聲母」ㄓㄔㄕ
- xform/^zh/a/
- xform/^ch/v/
- xform/^sh/o/
# 到此,【terra pinyin】→【bopomofo】
# 輸入鍵轉換
- xform/ü/y/ # `Y鍵`輸入ü
- xlit/IUYAOEQHWSRKDJFL/iuyaoeqhwsrkdjfl/ # 介音、韻母一律小寫
# 使用零聲母表示韻母獨立音節
- xform/^([iuyaoeqhwsrkdjfl]\d)/e$1/
# 到此,基本拼寫規則完成
# 進階的拼寫規則,使用更方便
- derive/^x([iy])/f$1/ # ㄈㄒ共用`F鍵`
- derive/^([avorzcs])i(\d)/$1$2/ # ㄓㄔㄕㄖㄗㄘㄙ的韻母可以省略
- derive/^z([a-z]*[1-5])/w$1/ # `W鍵`也可以輸入ㄗ
- derive/^e([iuy])(\d)/$1$2/ # 介音有聲調時,不需前綴零聲母
- derive/([eiy])q(?=\d)/$1e/ # ㄝㄜ共用`E鍵`
# 輸入聲調(不用數字鍵)
- derive/^(.+)1/$1m/
- derive/^(.+)2/$1n/
- derive/^(.+)3/$1c/
- derive/^(.+)4/$1v/
- derive/^(.+)5/$1b/
# 省略聲調
- derive/^(.+)\d/$1/
translator: # 定義主要翻譯器
enable_completion: true
initial_quality: 0.99
dictionary: terra_pinyin
prism: full_bopomofo
preedit_format:
# 聲調的預覽(不用數字鍵輸入時)
- xform/(^| )([a-z]{1, 3})m(| |$)/$1$2ˉ$3/
- xform/(^| )([a-z]{1, 3})n(| |$)/$1$2ˊ$3/
- xform/(^| )([a-z]{1, 3})c(| |$)/$1$2ˇ$3/
- xform/(^| )([a-z]{1, 3})v(| |$)/$1$2ˋ$3/
- xform/(^| )([a-z]{1, 3})b(| |$)/$1$2˙$3/
# 特殊聲母處理
- xform/(^| )f(?=[iy])/$1x/
- xform/(^| )w/$1z/
# 特殊韻母處理
- xform/([iy])e/$1q/
# 聲母的預覽
- xform/(^| )b/$1ㄅ/
- xform/(^| )p/$1ㄆ/
- xform/(^| )m/$1ㄇ/
- xform/(^| )f/$1ㄈ/
- xform/(^| )d/$1ㄉ/
- xform/(^| )t/$1ㄊ/
- xform/(^| )n/$1ㄋ/
- xform/(^| )l/$1ㄌ/
- xform/(^| )g/$1ㄍ/
- xform/(^| )k/$1ㄎ/
- xform/(^| )h/$1ㄏ/
- xform/(^| )j/$1ㄐ/
- xform/(^| )q/$1ㄑ/
- xform/(^| )x/$1ㄒ/
- xform/(^| )a/$1ㄓ/
- xform/(^| )v/$1ㄔ/
- xform/(^| )o/$1ㄕ/
- xform/(^| )r/$1ㄖ/
- xform/(^| )z/$1ㄗ/
- xform/(^| )c/$1ㄘ/
- xform/(^| )s/$1ㄙ/
- xform/(^| )i/$1ㄧ/
- xform/(^| )u/$1ㄨ/
- xform/(^| )y/$1ㄩ/
- xform/(^| )e/$1◌/
# 省略的韻母只提示一次
- xform/(^| )(ㄓ|ㄔ|ㄕ|ㄖ|ㄗ|ㄘ|ㄙ)i$/$1$2😬/
- xform/(^| )(ㄓ|ㄔ|ㄕ|ㄖ|ㄗ|ㄘ|ㄙ)i/$1$2/
# 韻母的預覽、聲調的預覽(使用數字鍵)
- xlit/iuyaoeqhwsrkdjfl 12345/ㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦ ˉˊˇˋ˙/
custom_phrase: # 定義使用者詞庫
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 1
reverse_lookup: # 定義用倉頡查詢注音
dictionary: cangjie5
enable_completion: true
prefix: "`"
suffix: "'"
tips: 〔倉頡〕
preedit_format:
- "xlit|abcdefghijklmnopqrstuvwxyz|日月金木水火土竹戈十大中一弓人心手口尸廿山女田難卜符|"
comment_format:
- xform/e?r5$/er5/
- xform/iu/iou/
- xform/ui/uei/
- xform/ong/ung/
- xform/^yi?/i/
- xform/^wu?/u/
- xform/iu/v/
- xform/^([jqx])u/$1v/
- xform/([iuv])n/$1en/
- xform/zh/Z/
- xform/ch/C/
- xform/sh/S/
- xform/ai/A/
- xform/ei/I/
- xform/ao/O/
- xform/ou/U/
- xform/ang/K/
- xform/eng/G/
- xform/an/M/
- xform/en/N/
- xform/er/R/
- xform/eh/E/
- xform/([iv])e/$1E/
- xform/1//
- 'xlit|bpmfdtnlgkhjqxZCSrzcsiuvaoeEAIOUMNKGR2345|ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦˊˇˋ˙|'
# 設定OpenCC字體轉換
s2tw: # 簡繁轉換
option_name: s2tw
opencc_config: s2tw.json
tips: none
t2tw: # 正繁轉換
option_name: t2tw
opencc_config: t2tw.json
tips: char
tw2s: # 繁簡轉換
option_name: tw2s
opencc_config: tw2s.json
tips: all
punctuator:
import_preset: symbols
full_shape:
"<" : [ "<", "《", "〈", "«", "‹" ]
">" : [ ">", "》", "〉", "»", "›" ]
"$" : [ "NT$", "$", "€", "£", "¥", "¢", "¤" ]
half_shape:
"<" : [ "<", "《", "〈", "«", "‹" ]
">" : [ ">", "》", "〉", "»", "›" ]
"$" : [ "NT$", "$", "€", "£", "¥", "¢", "¤" ]
key_binder:
import_preset: default
recognizer:
import_preset: default
patterns:
email: "^[a-z][-_.0-9a-z]*@.*$"
punct: "^/([0-9]0?|[A-Za-z]+)$"
reverse_lookup: "`[a-z]*'?$"
uppercase: "^[A-Z][-_+.'0-9A-Za-z]*$"
url: "^(www[.]|https?:|ftp:|mailto:).*$"