-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathc42.schema.yaml
176 lines (157 loc) · 3.83 KB
/
c42.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
schema:
schema_id: c42
name: "C 输入 · 四二顶"
version: "2.4"
author:
- Cicin(15.02.05版)
- 蓝落萧改编
description: |
改编自 Cicin 所作的 C 输入,取前 3 码为全码,4 码顶 2 码上屏
dependencies:
- pinyin_simp
- stroke
switches:
- name: ascii_mode
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: simplification
states: [ 汉字, 漢字 ]
- name: ascii_punct
states: [ 。,, ., ]
- name: popping_method
states: [ 四二, 五二 ]
- name: prediction
reset: 1
states: [ 关闭, 联想 ]
- name: encode
states: [ 完成, 造词 ]
menu:
page_size: 6
engine:
processors:
- ascii_composer
- recognizer
- lua_processor@*c42.popping
- lua_processor@*c42.encoder
- speller
- key_binder
- punctuator
- selector
- navigator
- lua_processor@*c42.key_binder
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- affix_segmentor@extra
- affix_segmentor@wildcard
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- table_translator
- script_translator@stroke
- script_translator@pinyin_simp
- history_translator
filters:
- lua_filter@*c42.assist
- simplifier
- reverse_lookup_filter@reverse_lookup
- lua_filter@*c42.predictor
- uniquifier
- lua_filter@*c42.select_comment
- lua_filter@*c42.assembly
# processors
speller:
alphabet: "qwertasdfgzxcvbyuiophjkl;nm,./`"
initials: "qwertasdfgzxcvbyuiophjkl;nm"
algebra:
- derive/[A-Z\?]+/`/
- xlit/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
popping:
- when_not: popping_method
match: "[a-z;][a-z;,./][a-z;]"
accept: "[a-z;,./]"
prefix: 2
- when: popping_method
match: "[a-z;][a-z;,./][a-z;][a-z;,./]"
accept: "[a-z;]"
prefix: 2
- when: popping_method
match: "[a-z;][a-z;,./][a-z;][a-z;,./]"
accept: "[,./]"
- match: "[a-z;][a-z;,./]"
accept: "[,./]"
punctuator:
import_preset: c42.symbols
recognizer:
patterns:
history: '^;$'
extra: '^`[a-z]*$'
wildcard: '^.+`$'
punct: '^\\([0-9]0?|[A-Za-z]*)$'
key_binder:
import_preset: default
bindings:
- { when: has_menu, accept: period, send: period }
- { when: has_menu, accept: comma, send: comma }
- { when: has_menu, accept: minus, send: minus }
- { when: has_menu, accept: equal, send: equal }
- { when: has_menu, accept: Tab, send: Page_Down }
- { when: paging, accept: "Shift+Tab", send: Page_Up }
- { when: has_menu, accept: 0, send: 2 }
- { when: has_menu, accept: 9, send: 3 }
- { when: has_menu, accept: 8, send: 4 }
- { when: has_menu, accept: 7, send: 5 }
- { when: always, accept: "Control+Shift+5", toggle: prediction }
- { when: always, accept: "Control+Shift+6", toggle: encode }
- { when: composing, accept: apostrophe, toggle: encode }
# segmentors
extra:
tag: extra
prefix: "`"
tips: "〔反查〕"
# translators
translator:
dictionary: c42
enable_encoder: false
encode_commit_history: false
enable_user_dict: false
enable_completion: false
enable_sentence: false
preedit_format:
- xform/`/\?/
predictor:
dictionary: ""
user_dict: c42
enable_encoder: false
encode_commit_history: false
enable_completion: false
history:
tag: history
input: ";"
size: 5
initial_quality: -1
pinyin_simp:
tag: extra
dictionary: pinyin_simp
enable_user_dict: false
initial_quality: 1
stroke:
tag: extra
dictionary: stroke
enable_user_dict: false
initial_quality: 100
# filters
simplifier:
option_name: simplification
opencc_config: s2t.json
tags: [abc]
reverse_lookup:
dictionary: c42
overwrite_comment: true
comment_format:
- "xform/~//"
tags: [extra, wildcard]