-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhuma_trad.schema.yaml
335 lines (293 loc) · 8.4 KB
/
huma_trad.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
324
325
326
327
328
329
330
331
332
333
334
335
# Rime schema settings
# encoding: utf-8
schema:
schema_id: huma_trad
name: 虎碼・繁
version: "20241229"
author:
- 發明人 ID;PeaceB
- rime schema by ywxt
description: |
虎碼輸入方案,繁體簡碼
QQ群:21134461
雙重反查、三重註解、屏蔽詞組、全碼後置、繁入簡出、手動造詞...
https://gitee.com/ywxt/rime-huma/
https://github.com/ywxt/rime-huma/
dependencies:
- luna_pinyin
- stroke
- huma_spelling_pseudo
- huma.japanese
__patch:
- symbols:/patch?
- huma_trad.custom:/patch?
switches:
- name: charset_filter
reset: 1
states: [ 全集, 常用 ]
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: simplification
states: [ 漢字, 汉字 ]
- name: ascii_punct
states: [ 。,, ., ]
# 切换热键由 spelling/lua 下的 cycle_key 和 switch_key 定义
- options:
- spelling.off
- spelling.lv1
- spelling.lv2
- spelling.lv3
reset: 0
states: [ 〇註解, 一重註解, 二重註解, 三重註解 ]
- name: emoji_suggestion
states: [ "🈚️", "🈶️" ]
- name: codepoints
states: [ 無碼點, 有碼點 ]
- name: segments
states: [ 無碼段, 有碼段 ]
- name: postpone_fullcode # 仅作用于单字。
reset: 1
states: [ =原始排序, ↓全碼後置 ]
- name: single_char_only
states: [ 詞組派, 單字派 ]
- name: postpone_uncommon
reset: 1
engine:
processors:
- ascii_composer
- recognizer
- lua_processor@*huma.spelling_processor@spelling_processor
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- affix_segmentor@japanese
- affix_segmentor@luna_pinyin_lookup
- affix_segmentor@stroke_lookup
- affix_segmentor@reverse_lookup
- affix_segmentor@encode
- affix_segmentor@function_selector
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- table_translator@fixed
- table_translator
- script_translator@luna_pinyin
- script_translator@luna_pinyin_lookup
- table_translator@stroke_lookup
- table_translator@fixed_encode
- table_translator@encode_sentence
- script_translator@japanese
- table_translator@japanese_mixed
- lua_translator@*huma.function_selector@function_selector
filters:
- lua_filter@*huma.single_char_only@single_char_only
- lua_filter@*huma.charset_filter@charset_filter
- lua_filter@*huma.postpone_uncommon@postpone_uncommon
- simplifier@emoji_suggestion
- simplifier@simplify
- simplifier@japanese_simplify
- reverse_lookup_filter@luna_pinyin_reverse_lookup
- reverse_lookup_filter@stroke_reverse_lookup
- reverse_lookup_filter@japanese_reverse_lookup
- lua_filter@*huma.unicode_code@unicode_code
- lua_filter@*huma.spelling@spelling
- lua_filter@*huma.postpone_fullcode@postpone_fullcode
- uniquifier
# - lua_filter@debug_filter
# 防止对 punct 进行过滤
zh_tags:
tags: [ abc, encode, reverse_lookup, luna_pinyin_lookup, stroke_lookup ]
single_char_only:
__include: zh_tags
charset_filter:
__include: zh_tags
postpone_uncommon:
tags: [ abc ]
postpone_fullcode:
tags: [ abc, encode ]
unicode_code:
tags: [ abc ]
simplify:
tags: [ abc, encode, reverse_lookup, luna_pinyin_lookup, stroke_lookup, function_selector ]
option_name: simplification
tips: all
opencc_config: huma.t2s.json
lua_reverse_db:
spelling: huma_spelling_pseudo
code: huma_trad
spelling:
__include: zh_tags
lua:
switch_key: 'Control+c'
cycle_key: 'Shift+Control+C'
# 注意写法:Shift 在前,Control 在后。
emoji_suggestion:
tags: [ abc ]
opencc_config: huma.emoji.json
option_name: emoji_suggestion
tips: none
inherit_comment: false
speller:
alphabet: zyxwvutsrqponmlkjihgfedcba
delimiter: " `'"
max_code_length: 4
auto_select: true
auto_clear: max_length
algebra:
- xform/^\*// # 特码以星号开头,以便在全码后置脚本中区分,以防识别为全码
function_selector:
tag: function_selector
prefix: '/'
tips: 【功能選擇】
closing_tips: 【功能選擇關閉】
tags: [ function_selector ]
fixed:
__include: translator
enable_user_dict: false
enable_sentence: false
initial_quality: 1000
fixed_encode:
__include: fixed
tag: encode
translator:
dictionary: huma_trad
prism: huma_trad
enable_sentence: false
enable_user_dict: true
enable_encoder: true
enable_completion: false
encode_commit_history: false # 对连续上屏的词自动成词
max_phrase_length: 10 # 自动成词的最大词长
# preedit_format:
# - 'xform/^([a-z]*)$/$1\t(\U$1\E)/'
encode:
tag: encode
prefix: "'"
tips: 【手動造詞】
closing_tips: 【造詞關閉】
encode_sentence:
__include: translator
tag: encode
enable_sentence: true
enable_user_dict: true
enable_completion: true
japanese_mixed:
__include: translator
tag: japanese
enable_user_dict: false
enable_encoder: false
enable_completion: false
initial_quality: 0.1
japanese:
tag: japanese
prefix: 'J'
tips: 【日文模式】
closing_tips: 【日文模式關閉】
dictionary: huma.japanese
spelling_hints: 5
comment_format:
- 'xlit|q-|ーー|'
preedit_format:
- 'xlit|q-|ーー|'
enable_sentence: true
enable_user_dict: true
enable_encoder: true
enable_completion: true
encode_commit_history: false # 对连续上屏的词自动成词
max_phrase_length: 10 # 自动成词的最大词长
initial_quality: 100
japanese_simplify:
tags: [ japanese ]
opencc_config: huma.t2jp.json
tips: all
# 用于混输
luna_pinyin:
tag: luna_pinyin
dictionary: luna_pinyin
initial_quality: 0.3
# 拼音混输。不使用 luna_pinyin_lookup,是因为那样做会导致所有常规编码段和常规候
# 选被同时打上 abc 和 luna_pinyin_lookup 标签,从而同时被 xmsp 和 xmsp_for_rvlk
# 接收,被添加两次注释。
# abc_segmentor:
# extra_tags: [ luna_pinyin ]
reverse_lookup:
tag: reverse_lookup
prefix: "`" # 反查引导符「`」
# suffix: # 反查关闭符,暂不定义
tips: 【反查:拼音+筆畫】
closing_tips: 【反查關閉】
# preedit_format:
# - xform/([nljqxy])v/$1ü/
extra_tags:
- luna_pinyin_lookup
- stroke_lookup
luna_pinyin_lookup:
tag: luna_pinyin_lookup
dictionary: luna_pinyin
prefix: '`P'
tips: 【朙月拼音反查】
closing_tips: 【反查關閉】
initial_quality: 0.2
stroke_lookup:
tag: stroke_lookup
dictionary: stroke
prefix: '`B'
tips: 【五筆劃反查】
closing_tips: 【反查關閉】
initial_quality: 0.5
preedit_format:
- 'xform/^([hspnz]+)$/$1\t(\U$1\E)/'
- 'xlit/HSPNZ/一丨丿丶乙/'
luna_pinyin_reverse_lookup:
tags: [ luna_pinyin_lookup, luna_pinyin ]
dictionary: huma_trad
# overwrite_comment: true # 覆蓋其他提示
stroke_reverse_lookup:
__include: luna_pinyin_reverse_lookup
tags: [ stroke_lookup ]
japanese_reverse_lookup:
tags: [ japanese ]
dictionary: huma.japanese
comment_format:
- 'xlit|q-|ーー|'
punctuator:
__patch: huma.symbols:/punctuator?
# 本节点仅用于被 __patch 指令引用
key_bindings:
__append:
- { when: always, accept: "Control+Shift+space", toggle: simplification }
- { when: composing, accept: "Control+s", toggle: single_char_only }
- { when: composing, accept: "Control+o", toggle: charset_filter }
- { when: composing, accept: "Control+e", toggle: emoji_suggestion }
- { when: has_menu, accept: semicolon, send: 2 } # 分号次选
- { when: has_menu, accept: apostrophe, send: 3 } # 引号三选
key_binder:
bindings:
__patch:
- key_bindings:/emacs_editing?
- key_bindings:/move_by_word_with_tab?
- key_bindings:/paging_with_minus_equal?
- key_bindings:/numbered_mode_switch?
- key_bindings
# 方案用户可仿照 key_bindings 节点在 *.custom.yaml 文件中添加按键绑定:
- huma_trad.custom:/key_bindings?
recognizer:
patterns:
# uppercase: "^(?![`;]).*[A-Z][-_+.'0-9A-Za-z]*$"
encode: "^'([a-z]+'?)*$"
reverse_lookup: "^`([a-z]+'?)*$"
luna_pinyin_lookup: "^`P([a-z]+'?)*$"
stroke_lookup: "^`B([a-z]+'?)*$"
japanese: "^J([-_a-z]+'?)*$"
punct: '^/([0-9]0?|[A-Za-z]+)$'