-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbopomo_onion.schema.yaml
323 lines (317 loc) · 18 KB
/
bopomo_onion.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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# Rime schema settings
# encoding: utf-8
# 《洋蔥純注音版 設定頁》
schema:
schema_id: bopomo_onion
name: "☆注音(洋蔥純注音版)☆"
version: "202112"
author:
- 『洋蔥』
description: |
注音符號輸入,採用「大千式」鍵盤排列。
dependencies:
- cangjie5
switches:
- name: ascii_mode
reset: 0
states: ["中文", "英文"]
- name: full_shape
reset: 0
states: ["半形", "全形"]
- name: ascii_punct
reset: 0
states: ["。,", ".,"]
- name: simplification
reset: 0
states: ["原體", "简体"]
# - options: [ utf8, big5, gbk ]
# # reset: 0
# states:
# - UTF-8
# - BIG5
# - GBK
engine:
filters:
# - charset_filter@big5
# - charset_filter@gbk
- simplifier
- reverse_lookup_filter@bpm_reverse_lookup
- uniquifier
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
# - fluency_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- affix_segmentor@reverse2_lookup
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- table_translator@bopomo_onion_phrase
- script_translator@reverse2_lookup
- script_translator
menu:
alternative_select_keys: "123456789"
page_size: 6
############################### 濾鏡 ##################################
simplifier:
tips: all
# big5:
# tags: [ abc ]
# gbk:
# tags: [ abc ]
############################## 拼寫正則 #####################################
speller:
alphabet: "1qaz2wsxedcrfv5tgbyhnujm8ik,9ol.0p;/-3467 "
initials: "1qaz2wsxedcrfv5tgbyhnujm8ik,9ol.0p;/-"
finals: " 6347"
delimiter: "\\"
use_space: true
algebra:
##### 非正確注音(補空碼或慣用發音)轉寫 #####
- xform/[)(]//
########################################
- 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/zhi?/Z/
- xform/chi?/C/
- xform/shi?/S/
- xform/([zcsr])i/$1/
- 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/
##############字母簡化############
- abbrev/^([bpmfdtnlgkhjqxZCSrzcsiuvaoeEAIOUMNKGR]).+$/$1/
- abbrev/^([bpmfdtnlgkhjqxZCSrzcsiuv])([iuvaoeEAIOUMNKGR])\d$/$1$2/
- abbrev/^([bpmfdtnlgkhjqxZCSrzcs])([iuv])([aoeEAIOUMNKGR])\d$/$1$2$3/
# - abbrev/^([bpmfdtnlgkhjqxZCSrzcsiuv]).+(\d)$/$1$2/ #使得ㄎˇㄈˇ(可否)可以打的出來 #新增iuv,使得ㄧˊㄉˊ(贏得)可以打出
# - abbrev/^([bpmfdtnlgkhjqxZCSrzcs]).+(\d)$/$1$2/ #同上,但少了ㄧㄨㄩ
- abbrev/^([bpmfdtnlgkhjqx]).+(\d)$/$1$2/ #同上,但再少了ㄓㄔㄕㄖㄗㄘㄙ
##########注音聲韻母亂序##########
- derive/^([bpmfdtnlgkhjqxZCSrzcs])([iuv])/$2$1/
- derive/^([iuv])([aoeEAIOUMNKGR])/$2$1/
- derive/^([bpmfdtnlgkhjqxZCSrzcs])([aoeEAIOUMNKGR])/$2$1/
- derive/^([bpmfdtnlgkhjqxZCSrzcs])([iuv])([aoeEAIOUMNKGR])/$3$2$1/
- derive/^([bpmfdtnlgkhjqxZCSrzcs])([iuv])([aoeEAIOUMNKGR])/$3$1$2/
- derive/^([bpmfdtnlgkhjqxZCSrzcs])([iuv])([aoeEAIOUMNKGR])/$2$3$1/
- derive/^([bpmfdtnlgkhjqxZCSrzcs])([iuv])([aoeEAIOUMNKGR])/$1$3$2/
- 'xlit|bpmfdtnlgkhjqxZCSrzcsiuvaoeEAIOUMNKGR12345|1qaz2wsxedcrfv5tgbyhnujm8ik,9ol.0p;/- 6347|'
################################### 主翻譯器 ###################################
translator:
dictionary: bopomo_onion.extended
prism: bopomo_onion
initial_quality: "0"
preedit_format:
- "xlit|1qaz2wsxedcrfv5tgbyhnujm8ik,9ol.0p;/- 6347|ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦˉˊˇˋ˙|"
- 'xform/\\/ /' #全形空格 #半形空格 #| #⁞ #⁝ #⋮ #¦ #┆
############################## 以下為短語 ##########################################
bopomo_onion_phrase:
dictionary: ""
user_dict: bopomo_onion_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
################################ 以下為使用ooo反查注音 #############################
reverse2_lookup:
tag: reverse2_lookup
dictionary: cangjie5
enable_completion: false
enable_sentence: false
enable_user_dict: true
prefix: "="
suffix: " "
tips: "《反查》"
preedit_format:
# - "xlit|abcdefghijklmnopqrstuvwxyz|ABCDEFGHIJKLMNOPQRSTUVWXYZ|"
- "xlit|abcdefghijklmnopqrstuvwxyz|日月金木水火土竹戈十大中一弓人心手口尸廿山女田難卜符|"
- xform/^/《反查》/
- 'xform/\\/ /'
bpm_reverse_lookup:
tags: [ reverse2_lookup ]
overwrite_comment: true
dictionary: bopomo_onion.extended
comment_format:
- 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/zhi?/Z/
- xform/chi?/C/
- xform/shi?/S/
- xform/([zcsr])i/$1/
- 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|ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦˊˇˋ˙|'
################################### 符號處理 ####################################
punctuator:
import_preset: bopomo_onion_symbols
full_shape:
"=" : [ "=", "々", "〃", "〻" ]
"[" : [ "「", 〈, 〔, "‘", [, {, <, (, ﹝, ﹛, ﹤, ﹙, ‹, ˂, "⁽", "₍", "⁅", "「", "[", "{", "<", "(" ]
"]" : [ "」", 〉, 〕, "’", ], }, >, ), ﹞, ﹜, ﹥, ﹚, ›, ˃, "⁾", "₎", "⁆", "」", "]", "}", ">", ")" ]
"{" : { commit: "『" }
"}" : { commit: "』" }
":" : { commit: ":" }
"'" : [ "、","—", "──", "——", "⸺", "‧", "·", "●", "•", "・", "・" ]
"\"" : { commit: ";" }
"<" : { commit: "," }
">" : { commit: "。" }
"?" : { commit: "?" }
"\\" : [ "\", "\\", "﹨" ]
"|" : [ "|", "|", "︱", "§", "¶", "⁋", "❡", "⁌", "⁍", "∣", "︳", "│", "┃", "¦", "╎", "╏", "┆", "┇", "┊", "┋", "‖", "║", "‖", "∥", "᱿", "᰼" ]
"`" : [ "`" ]
half_shape:
"<" : { commit: "," }
">" : { commit: "。" }
"?" : { commit: "?" }
":" : { commit: ":" }
"'" : [ "、","—", "──", "——", "⸺", "‧", "·", "●", "•", "・", "・" ]
"\"" : { commit: "、" }
"\\" : [ "\\", "\", "﹨" ]
"|" : [ "|", "|", "︱", "§", "¶", "⁋", "❡", "⁌", "⁍", "∣", "︳", "│", "┃", "¦", "╎", "╏", "┆", "┇", "┊", "┋", "‖", "║", "‖", "∥", "᱿", "᰼" ]
"`" : [ "`" ]
# "`" : [ "`", " ※ 輸入【項目】每字第一個注音,調出相關符號。", "【表情】【自然】【飲食】【活動】【旅遊】【物品】【符號】", "【國旗】【微笑】【大笑】【冒汗】【喜愛】【討厭】【無奈】", "【哭泣】【冷淡】【驚訝】【生氣】【懷疑】【大頭】【人物】", "【獸面】【貓頭】【怪物】【五官】【手勢】【亞裔】【白人】", "【黑人】【天氣】【下雪】【天體】【夜空】【地球】【景色】", "【景點】【名勝】【日本】【美國】【法國】【建築】【節日】", "【娛樂】【遊戲】【運動】【球具】【獎項】【獎牌】【食物】", "【正飯】【午餐】【早餐】【早點】【中餐】【西餐】【快餐】", "【速食】【米飯】【麵包】【捲物】【串物】【甜點】【零食】", "【飲料】【熱飲】【酒精】【酒類】【植物】【水果】【蔬菜】", "【粗糧】【花卉】【葉子】【肉類】【肉品】【牲畜】【畜牲】", "【禽類】【鳥類】【魚圖】【鳥圖】【衣物】【衣服】【褲子】", "【帽子】【包包】【頭髮】【膚色】【化妝】【愛情】【愛心】", "【兩性】【效果】【色塊】【宗教】【音樂】【樂器】【時鐘】", "【標誌】【圖示】【圖標】【箭標】【指示】【回收】【有害】", "【科學】【通訊】【電腦】【電子】【武器】【象棋】【麻將】", "【骰子】【撲克】【船隻】【飛機】【汽車】【車輛】【公交】", "【城軌】【捷運】【火車】【錢財】【鈔票】【紙鈔】【紙幣】", "【貨幣】【單位】【數學】【分數】【打勾】【星號】【箭頭】", "【線段】【幾何】【三角】【方塊】【圓形】【填色】【文化】", "【占星】【星座】【易經】【八卦】【卦名】【天干】【地支】", "【干支】【節氣】【月份】【日期】【曜日】【時間】【符碼】", "【標點】【合字】【部首】【偏旁】【筆畫】【倉頡】【結構】", "【拼音】【注音】【聲調】【上標】【下標】【羅馬】【希臘】", "【俄語】【韓文】【(平)假名】", "【幾何圖】【鞋子圖】【眼鏡圖】【工具圖】【電器圖】【甜食圖】", "【餐具圖】【動物圖】【生肖圖】【家禽圖】【魚類圖】【精怪圖】", "【月相圖】【交通圖】【飛行器】【黃種人】【拉美裔】【棕色人】", "【白種人】【阿拉伯】【動物臉】【猴子頭】【咧嘴笑】【做運動】", "【日本菜】【食物捲】【辦公室】【警消護】【大自然】【遊樂園】", "【撲克牌】【西洋棋】【輸入法】【日用品】【單線框】【雙線框】", "【色塊心】【色塊方】【色塊圓】【十字架】【星座名】【十二宮】", "【太玄經】【蘇州碼】【標點直】【羅馬大】【希臘大】【俄語大】", "【字母圈】【字母括】【字母方】【字母框】【數字圈】【數字括】", "【數字點】【數字標】【漢字圈】【漢字框】【漢字括】【韓文圈】【韓文括】", "【假名圈】【片假名】【IRO(いろは順)】【假名半(形)】【日本年】【填色塊】", "【猴子表情】【十二生肖】【交通工具】【公共運輸】【日式料理】", "【日本料理】【日本星期】【羅馬數字】【數字圈黑】【數字黑圈】", "【字母圈大】【字母括大】【字母黑圈】【字母圈黑】【字母黑方】", "【字母方黑】【字母框黑】【字母黑框】【易經卦名】【六十四卦】", "【六十四卦名】【羅馬數字大】", "【運動ㄋㄩ(女)】【運動ㄋㄢ(男)】【精怪ㄋㄩ(女)】【精怪ㄋㄢ(男)】", "【 a 假名】【 i 假名】【 u 假名】【 e 假名】【 o 假名】", "【 k 假名】【 g 假名】【 s 假名】【 z 假名】【 t 假名】【 d 假名】", "【 n 假名】【 h 假名】【 b 假名】【 p 假名】【 m 假名】【 y 假名】", "【 r 假名】【 w 假名】「圈」「框」「括」數字字母:【 0 ~ 9 】【 1-0 ~ 5-0 】【 a ~ z 】" ]
"~" : { commit: "~" }
"!" : { commit: "!" }
"@" : { commit: "@" }
"#" : { commit: "#" }
"%" : { commit: "%" }
"$" : { commit: "$" }
"^" : { commit: "^" }
"&" : { commit: "&" }
"*" : { commit: "*" }
"(" : { commit: ( }
")" : { commit: ) }
"_" : { commit: "_" }
"+" : { commit: "+" }
"=" : [ "=", "々", "〃", "〻" ]
"[" : [ "「", 〈, 〔, "‘", [, {, <, (, ﹝, ﹛, ﹤, ﹙, ‹, ˂, "⁽", "₍", "⁅", "「", "[", "{", "<", "(" ]
"]" : [ "」", 〉, 〕, "’", ], }, >, ), ﹞, ﹜, ﹥, ﹚, ›, ˃, "⁾", "₎", "⁆", "」", "]", "}", ">", ")" ]
"{" : { commit: "『" }
"}" : { commit: "』" }
# "3" : [ "https://", "http://", "ftp://", "mailto://", "file://" ]
# "4" : [ "www.", "line.me/", "/Users/", "/Library/", "C:\\>", "D:\\>", '<a href=""></a>', '<img sre=""></img>', '<a href="mailto:"></a>', '<a href=""><img src="" border="0"></a>' ]
# "6" : [ ".com", ".org", ".net", ".co", ".gov", ".edu", ".info" ]
# "7" : [ ".tw", ".jp", ".kr", ".hk", ".cn", ".uk", ".us", ".de", ".fr", ".cc" ]
################################# 按鍵處理 ######################################
key_binder:
import_preset: default
bindings:
### 避大千注音鍵位和 RIME 原設定鍵位衝突 ###
- {accept: comma, send: comma, when: has_menu}
- {accept: period, send: period, when: has_menu}
- {accept: minus, send: minus, when: has_menu}
- {accept: equal, send: equal, when: has_menu}
### 切分移位 ###
- {accept: Up, send: KP_Left, when: composing} #左移一個注音
- {accept: Up, send: Up, when: paging} #修正上條目出現的bug
##
- {accept: Right, send: Shift+Right, when: composing} #右移一整個字
- {accept: Shift+Right, send: Right, when: composing} #右移一個注音
- {accept: Shift+Left, send: KP_Left, when: composing} #左移一個注音
- {accept: Shift+space, send: Shift+Right, when: composing} #首節
# - {accept: Shift+space, send: KP_Left, when: composing} #左移一個注音
# - {accept: Left, send: KP_Left, when: composing} #左移一個注音
##
# - {accept: Shift+Tab, send: Right, when: composing} #右移一個注音
# - {accept: Tab, send: KP_Left, when: composing} #左移一個注音
### 選字翻頁 ###
- {accept: Left, send: Page_Up, when: paging} #直式選單用 #has_menu
- {accept: Right, send: Page_Down, when: paging} #直式選單用 #has_menu
# - {accept: Up, send: Page_Up, when: paging} #橫式選單用
# - {accept: Down, send: Page_Down, when: paging} #橫式選單用
# - {accept: Left, send: Left, when: has_menu} #橫式選單用 #send: Shift+Up
# - {accept: Right, send: Right, when: has_menu} #橫式選單用 #send: Shift+Down
- {accept: Tab, send: Page_Down, when: has_menu} #「tab」翻頁。
- {accept: Shift+Tab, send: Page_Up, when: paging} #選字時「Shift」+「tab」翻頁。
- {accept: Shift+Down, send: Page_Down, when: has_menu} #選字時「Shift」+「下」翻頁。
- {accept: Shift+Up, send: Page_Up, when: paging} #選字時「Shift」+「上」翻頁。
- {accept: Shift+space, send: Shift+Left, when: paging} #於選單列選字時,回復到輸入列(避免有時回復不了,故增加)。
# - {accept: Tab, send: Shift+Left, when: paging} #於選單列選字時,回復到輸入列(避免有時回復不了,故增加)。
# - {accept: Shift+space, send: Page_Down, when: has_menu} #選字時「Shift」+「空白鍵」翻頁。 #send: Right #send: Down
### 空白鍵 ###
- {accept: space, send: Return, when: paging} #方向鍵選字時,space直接上屏(避免被一聲空格影響)
# - {accept: space, send: Page_Down, when: paging} #方向鍵選字時,space翻頁(上條遮屏需開啟,否則「=」+「符號」會誤按)
## - {accept: space, send: Down, when: has_menu}
## - {accept: space, send: Down, when: paging}
## - {accept: space, send: space, when: composing}
## - {accept: space, send: space, when: has_menu} #非空碼時,空白還是空白
## - {accept: space, send: Escape, when: composing} #空碼時,按空格清除
### 刪除鍵 ###
- {accept: BackSpace, send: Control+BackSpace, when: has_menu} #〔關〕刪除前一個拼音字符〔開〕:刪除整組拼音字符(一個字)
- {accept: Shift+BackSpace, send: BackSpace, when: has_menu}
- {accept: backslash, send: BackSpace, when: has_menu} #「\」鍵位刪除一個拼音字符。
# - {accept: backslash, send: Shift+BackSpace, when: has_menu} #「\」鍵位刪除整組拼音字符(一個字)。
# - {accept: backslash, send: Shift+Return, when: has_menu} #「\」鍵位上屏英文。
### 功能快捷鍵 ###
# - {accept: Control+apostrophe, toggle: zh_tw, when: always} #accept: Control+semicolon
## - {accept: Control+Shift+6, toggle: zh_tw, when: always} #誤按沒警示,避免誤按,可關閉!(開關台灣習慣用字)
## - {accept: Control+Shift+7, toggle: emoji_segestion, when: always} #誤按沒警示,避免誤按,可關閉!(開關跟隨的emoji)
## - {accept: Control+Shift+8, toggle: back_mark, when: always} #誤按沒警示,避免誤按,可關閉!(開關標註)
## - {accept: Return, send: space, when: has_menu}
### 避聲調重複按 ###
- {accept: 3, send: Escape, when: composing}
- {accept: 3, send: 3, when: has_menu}
- {accept: 4, send: Escape, when: composing}
- {accept: 4, send: 4, when: has_menu}
- {accept: 6, send: Escape, when: composing}
- {accept: 6, send: 6, when: has_menu}
- {accept: 7, send: Escape, when: composing}
- {accept: 7, send: 7, when: has_menu}
### shift 和 ctrl調換 ###
# - {accept: "Control+comma", send: "less", when: always} #「逗號」#接受「Contol」+「,」直出「<」
# - {accept: "Control+period", send: "greater", when: always} #「句號」#接受「Contol」+「.」直出「>」
# - {accept: "Control+slash", send: "question", when: always} #「問號」#接受「Contol」+「/」直出「?」
# - {accept: "Control+apostrophe", send: "quotedbl", when: always} #「頓號」#接受「Contol」+「'」直出「"」
editor:
bindings:
# space: commit_composition #使用 fluency_editor 時開啟
Return: confirm #使用 express_editor 時開啟
Shift+Return: commit_raw_input # 上屏原始輸入
Control+Return: commit_script_text # 上屏變換後輸入
########################## 用正則調出各種功能 ##############################
recognizer:
patterns:
uppercase: "^[A-Z][-_+.'0-9A-Za-z]*$"
url: "^(https?:|ftp:|mailto:|file:).*$"
email: "^[a-z][-_.0-9a-z]*@.*$"
punct: "(?<![=`])`[`]?[-,;/0-9a-z]*$|[[][[]?[']?$|[]][]]?[']?$|[[][]]$|[[][[][]][]]$|[[]['][]][']$|[[][[]['][]][]][']$|[']['][']?$|[=][=][=]?$|[=][`][`]?$|[=]['][']?$|[=]['][']?[=]['][']?$|[=][][][][]?$|[=][][][][]?[=][][][][]?$|[=][-,./;][-,./;]? ?$|[=][,][,][=][.][.] ?$|[=][0-9] ?$|[=][9][=][0] ?$|[=][=][].,90'[]+ ?$"
reverse2_lookup: "=[a-z]* ?$"
# lua: "^'/[a-z0-9/-]*$"