-
Notifications
You must be signed in to change notification settings - Fork 0
/
tungdzih.schema.yaml
184 lines (169 loc) · 4.16 KB
/
tungdzih.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
# Rime schema
# encoding: utf-8
schema:
schema_id: &schema_id tungdzih
name: 通字羅馬字
version: "2.2"
author:
- Baopaau <baopaau@gmail.com>
description: |
整理自趙元任《通字方案 (General Chinese)》
dependencies:
- terra_pinyin
- jyut6ping3
- stroke
- cangjie5
switches:
- name: ascii_mode
reset: 0
states: [ 中文, ASCII ]
- name: full_shape
states: [ 半寬, 全寬 ]
- name: simplification
states: [ 漢字, 汉字 ]
- name: ascii_punct
states: [ 。,, ., ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- affix_segmentor@jyut6ping3
- affix_segmentor@stroke
- affix_segmentor@this_translator
- affix_segmentor@terra_pinyin
- affix_segmentor@cangjie5
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- script_translator
- script_translator@jyut6ping3
- table_translator@stroke
- script_translator@this_translator
- script_translator@terra_pinyin
- table_translator@cangjie5
filters:
- simplifier
- uniquifier
- reverse_lookup_filter
speller:
alphabet: zyxwvutsrqponmlkjihgfedcba
delimiter: " '"
algebra:
# 忽略聲調
- derive/h$//
- derive/([nm])\1$/$1/
- derive/([aoeui])\1(|[nm])$/$1$2/
- derive/([aoeu])[ey]$/$1i/
- derive/([aoe])[ow]$/$1u/
- derive/([aoeui])[gq]$/$1ng/
# 簡拼
- abbrev/^([a-z]).+$/$1/
- abbrev/^([bpmfvdtnlczsjckgqxhyw]?[hryvsz]y?).+$/$1/
#- abbrev/^([a-z]{2}).+$/$1/
translator:
dictionary: tungdzih
prism: *schema_id
spelling_hints: 7
#initial_quality: 1
comment_format: &comment
this_translator:
tag: this_translator
dictionary: tungdzih
prism: *schema_id
prefix: "~"
tips: 〔通字〕
comment_format: *comment
preedit_format:
- xform/^(.*)$/‹$1› 通字/
terra_pinyin:
tag: terra_pinyin
dictionary: terra_pinyin
prism: terra_pinyin
prefix: ":"
tips: 〔普通話〕
preedit_format:
- 'xlit -/<\;,> 1234134'
- xform/([iuvaoe](|ng?))vvvvv\>/${1}5/
- xform/([iuvaoe](|ng?))vvvv\>/${1}4/
- xform/([iuvaoe](|ng?))vvv\>/${1}3/
- xform/([iuvaoe](|ng?))vv\>/${1}2/
- xform/([iuvaoe](|ng?))v\>/${1}1/
- xform/([nl])v/$1ü/
- xform/([nl])ue/$1üe/
- xform/([jqxy])v/$1u/
- xlit/123456/¹²³⁴⁵⁶/
- xform/^(.*)$/‹$1› 普通話/
jyut6ping3:
tag: jyut6ping3
dictionary: jyut6ping3
prism: jyut6ping3
prefix: ";"
tips: 〔粵拼〕
preedit_format:
- xform/([aeioumngptk])vv/${1}4/
- xform/([aeioumngptk])xx/${1}5/
- xform/([aeioumngptk])qq/${1}6/
- xform/([aeioumngptk])v/${1}1/
- xform/([aeioumngptk])x/${1}2/
- xform/([aeioumngptk])q/${1}3/
- xlit/123456/¹²³⁴⁵⁶/
- xform/^(.*)$/‹$1› 粵拼/
stroke:
tag: stroke
dictionary: stroke
prefix: "`"
tips: 〔筆畫〕
preedit_format:
- xlit/hspnz/一丨丿丶乙/
- xform/^(.*)$/‹$1› 筆畫/
cangjie5:
tag: cangjie5
dictionary: cangjie5
enable_user_dict: false
prefix: "`c"
tips: 〔倉頡〕
preedit_format:
- 'xform/^([a-z]*)$/$1:\U$1\E /'
- "xlit|ABCDEFGHIJKLMNOPQRSTUVWXYZ|日月金木水火土竹戈十大中一弓人心手口尸廿山女田難卜符|"
- xform/^(.*)$/‹$1› 倉頡/
comment_format:
- "xlit|abcdefghijklmnopqrstuvwxyz~|日月金木水火土竹戈十大中一弓人心手口尸廿山女田難卜符~|"
disable_user_dict_for_patterns:
- "^z.*$"
- "^yyy.*$"
reverse_lookup:
tags: [ terra_pinyin, jyut6ping3, stroke, cangjie5 ]
overwrite_comment: true
dictionary: tungdzih
comment_format: *comment
abc_segmentor:
extra_tags:
#- jyut6ping3
#- terra_pinyin
#- cangjie5
punctuator:
import_preset: default
key_binder:
import_preset: default
bindings:
#- { when: has_menu, accept: space, send: Shift+Return }
recognizer:
import_preset: default
patterns:
punct: "^/.*$"
stroke: "^`.*$"
jyut6ping3: "^;.*$"
cangjie5: "^`c.*$"
this_translator: "^~.*$"
terra_pinyin: "^:.*$"