-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmiddle_chinese_lookup.schema.yaml
505 lines (465 loc) · 14.1 KB
/
middle_chinese_lookup.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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# Rime schema
# encoding: utf-8
schema:
schema_id: middle_chinese_lookup
name: 切韻查詢
version: "7.2"
author:
- ayaka14732
- 雪齋
- 佛振
description:
基於切韻拼音(Tshet-uinh Phonetic Alphabet, TUPA)製作
韻典網·廣韻 http://ytenx.org/kyonh/
知乎文章 https://zhuanlan.zhihu.com/p/560047021
雪齋在此基礎上寫出反算廣韻漢字聲韻調算法
分聲母、介音、韻腹、韻尾。其中只有韻腹必須存在,其他三者可無,聲調標於韻腹上。
dependencies:
- cangjie5
- luna_pinyin
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
reset: 0
states: [ 半角, 全角 ]
- name: extended_charset
states: [ 通用, 增廣 ]
- name: ascii_punct
states: [ ,。, ,. ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- affix_segmentor@pinyin
- affix_segmentor@cangjie
- affix_segmentor@reverse_lookup
- punct_segmentor
- fallback_segmentor
translators:
- echo_translator
- punct_translator
- script_translator@tupa
- table_translator@cangjie
- script_translator@pinyin
filters:
- reverse_lookup_filter@middle_chinese_lookup
- uniquifier
- cjk_minifier
speller:
alphabet: 'zyxwvutsrqponmlkjihgfedcba'
delimiter: " '"
algebra:
- xform/-/ /
# 中古全拼
abc_segmentor:
extra_tags: [ pinyin, cangjie ]
tupa:
dictionary: tupa
spelling_hints: 4
preedit_format:
- "xform/^([a-z]*)$/【切韻】$1/"
# 用倉頡輸入,加前綴C:
cangjie:
# table_translator@cangjie
dictionary: cangjie5
enable_charset_filter: true
preedit_format:
- 'xform/^([a-z]*)$/【倉頡】$1|\U$1\E/'
- "xlit|ABCDEFGHIJKLMNOPQRSTUVWXYZ|日月金木水火土竹戈十大中一弓人心手口尸廿山女田難卜符|"
comment_format:
- "xlit|abcdefghijklmnopqrstuvwxyz'~|日月金木水火土竹戈十大中一弓人心手口尸廿山女田難卜符·~|"
# affix_segmentor@cangjie
tag: cangjie
prefix: "C:"
suffix: ';'
initial_quality: 0.5
tips: 〔倉頡〕
closing_tips: 〔廣韻〕
# 用漢語拼音輸入,加前綴P:
pinyin:
# script_translator@pinyin
dictionary: luna_pinyin
preedit_format:
- "xform/^([a-z]*)$/【拼音】$1/"
- "xform/v/ü/"
# affix_segmentor@pinyin
tag: pinyin
prefix: "P:"
suffix: ';'
initial_quality: 0.25
tips: 〔拼音〕
closing_tips: 〔廣韻〕
# 用倉頡或拼音反查,加前綴:
# affix_segmentor@reverse_lookup
reverse_lookup:
tag: reverse_lookup
extra_tags: [ cangjie, pinyin ]
prefix: ':'
suffix: ';'
tips: 〔反查〕
closing_tips: 〔廣韻〕
key_binder:
import_preset: default
punctuator:
import_preset: default
recognizer:
import_preset: default
patterns:
cangjie: "C:[a-z']*;?$"
pinyin: "P:[a-z']*;?$"
reverse_lookup: "(?<![A-Z]):[a-z']*;?$"
upper_case: ^[A-Z][a-zA-Z]*$
# 標註中古音
middle_chinese_lookup:
tags: # any
dictionary: tupa
overwrite_comment: true # 覆蓋其他提示
comment_format:
- xform/([ -])/\x03\1\x01/
- xform/$/\x03/
- xform/^/\x01/
# 鈍音聲母
- xform/\x01ph/滂P\x02/
- xform/\x01p/幫P\x02/
- xform/\x01b/並P\x02/
- xform/\x01m/明P\x02/
- xform/\x01kh/谿\x02/
- xform/\x01k/見\x02/
- xform/\x01gh/匣\x02/
- xform/\x01g/羣\x02/
- xform/\x01ng/疑\x02/
- xform/\x01q/影\x02/
- xform/\x01h/曉\x02/
# 銳音聲母
- xform/\x01tsrh/初R\x02/
- xform/\x01tsr/莊R\x02/
- xform/\x01dzr/崇R\x02/
- xform/\x01sr/生R\x02/
- xform/\x01zr/俟R\x02/
- xform/\x01tjh/昌J\x02/
- xform/\x01tj/章J\x02/
- xform/\x01dj/常J\x02/
- xform/\x01sj/書J\x02/
- xform/\x01zj/船J\x02/
- xform/\x01tsh/淸J\x02/
- xform/\x01ts/精J\x02/
- xform/\x01dz/從J\x02/
- xform/\x01s/心J\x02/
- xform/\x01z/邪J\x02/
- xform/\x01nj/日J\x02/
- xform/\x01trh/徹R\x02/
- xform/\x01tr/知R\x02/
- xform/\x01dr/澄R\x02/
- xform/\x01nr/孃R\x02/
- xform/\x01th/透\x02/
- xform/\x01t/端\x02/
- xform/\x01d/定\x02/
- xform/\x01n/泥\x02/
- xform/\x01j/以J\x02/
- xform/\x01([iyuoaew])/云R\x02\1/
- xform/\x01l/來R\x02/
# 聲調
- xform/([^ptkqh])\x03/\1\x03平/
- xform/k\x03/ng\x03入/
- xform/t\x03/n\x03入/
- xform/p\x03/m\x03入/
- xform/q\x03/\x03上/
- xform/h\x03/\x03去/
# 後鼻脣韻
- xform/\x02(u)ng\x03/\x02\1C東/
- xform/\x02oung\x03/\x02wC東/
- xform/\x02oeung\x03/\x02w2江/
- xform/\x02ong\x03/\x02wC冬/
- xform/\x02(u)ong\x03/\x02\1C鐘/
- xform/\x02([yui])ang\x03/\x02\1C陽/
- xform/\x02(w?)ang\x03/\x02\1唐/
# 後鼻顎韻
- xform/\x02(y)ng\x03/\x02\1C蒸/
- xform/\x02([yu])ing\x03/\x02\1B蒸/
- xform/\x02(w?)eong\x03/\x02\1登/
- xform/\x02(w?)eeng\x03/\x02\12耕/
- xform/\x02(w?)eng\x03/\x02\14靑/
- xform/P\x02w?iaeng\x03/\x02wiB淸/
- xform/\x02(w?i)aeng\x03/\x02\1B淸/
- xform/\x02([yu])aeng\x03/\x02\1B庚/ #庚三
- xform/\x02(w?)aeng\x03/\x02\12庚/ #庚二
# 開韻
- xform/\x02(w?)ae\x03/\x02\12麻/ #麻二
- xform/\x02(i)ae\x03/\x02\1麻/ #麻三
- xform/\x02([wyu]?)a\x03/\x02\1C歌/
- xform/\x02(y)o\x03/\x02\1C魚/
- xform/\x02(u)o\x03/\x02\1C虞/
- xform/\x02o\x03/\x02w模/
- xform/P\x02ie\x03/\x02wiB支/
- xform/\x02(w?[iyu])e\x03/\x02\1B支/
- xform/\x02(w?)ee\x03/\x02\12佳/
- xform/\x02(y)\x03/\x02\1C之/
# 收脣韻
- xform/\x02ou\x03/\x02w侯/
- xform/\x02(u)\x03/\x02\1C尤/
- xform/\x02(y?i)w\x03/\x02\1B幽/
- xform/\x02([iy])ew\x03/\x02\1B宵/
- xform/\x02ew\x03/\x024蕭/
- xform/\x02aw\x03/\x02豪/
- xform/\x02aew\x03/\x022肴/
# 收齒韻
- xform/P\x02i\x03/\x02wiB脂/
- xform/\x02([wyu]?i)\x03/\x02\1B脂/
- xform/\x02([yu])j\x03/\x02\1C微/
- xform/P\x02iej\x03/\x02wiB祭/
- xform/\x02(w?[iyu])ej\x03/\x02\1B祭/
- xform/\x02(w?)ej\x03/\x02\14齊/
- xform/\x02(w?)eej\x03/\x02\12皆/
- xform/\x02([yu])oj\x03/\x02\1C廢/
- xform/\x02oj\x03/\x02w灰/
- xform/\x02eoj\x03/\x02咍/
- xform/\x02(w?)aj\x03/\x02\1泰/
- xform/\x02(w?)aej\x03/\x02\12夬/
# 前鼻韻
- xform/P\x02in\x03/\x02wiB真/ #真
- xform/\x02(w?i|[yu]i)n\x03/\x02\1B真/ #真臻
- xform/\x02(y)n\x03/\x02\1C殷/
- xform/\x02(u)n\x03/\x02\1C文/
- xform/\x02([yu])on\x03/\x02\1C元/
- xform/\x02on\x03/\x02w魂/
- xform/\x02eon\x03/\x02痕/
- xform/P\x02ien\x03/\x02wiB仙/
- xform/\x02(w?[iyu])en\x03/\x02\1B仙/
- xform/\x02(w?)en\x03/\x02\14先/
- xform/\x02(w?)een\x03/\x02\12山/
- xform/\x02(w?)an\x03/\x02\1寒/
- xform/\x02(w?)aen\x03/\x02\12刪/
# 脣鼻韻
- xform/P\x02(i|yi)m\x03/\x02\1B侵/
- xform/\x02(i|yi)m\x03/\x02\1C侵/
- xform/\x02([iy])em\x03/\x02\1B鹽/
- xform/\x02em\x03/\x024添/
- xform/\x02eem\x03/\x022咸/
- xform/\x02om\x03/\x02C覃/
- xform/\x02(y)om\x03/\x02\1C嚴/
- xform/\x02(u)om\x03/\x02\1C凡/
- xform/\x02am\x03/\x02談/
- xform/\x02aem\x03/\x022銜/
# 介音
- xform/R\x02(wi|u)[a-zA-Z0-9]*/逶/
- xform/R\x02[iy][a-zA-Z0-9]*/漪/
- xform/C\x02(wi|u)[a-zA-Z0-9]*/憂/
- xform/C\x02[iy][a-zA-Z0-9]*/醫/
- xform/J\x02(wi|u)[a-zA-Z0-9]*/幽/
- xform/J\x02[iy][a-zA-Z0-9]*/伊/
- xform/J\x02w2[a-zA-Z0-9]*/逶/ #異常音
- xform/J\x022[a-zA-Z0-9]*/漪/ #異常音
- xform/R?\x02u[a-z]*B[a-zA-Z0-9]*/逶/
- xform/R?\x02y[a-z]*B[a-zA-Z0-9]*/漪/
- xform/C?\x02u[a-z]*C[a-zA-Z0-9]*/憂/
- xform/C?\x02y[a-z]*C[a-zA-Z0-9]*/醫/
- xform/J?\x02wi[a-zA-Z0-9]*/幽/
- xform/J?\x02i[a-zA-Z0-9]*/伊/
- xform/R?\x02w2[a-zA-Z0-9]*/蛙/
- xform/R?\x022[a-zA-Z0-9]*/娃/
- xform/R?\x02w4[a-zA-Z0-9]*/烓/
- xform/R?\x024[a-zA-Z0-9]*/翳/
# - xform/R\x02w[a-zA-Z0-9]*/蛙/ #異常音
# - xform/R\x02[a-zA-Z0-9]*/娃/ #異常音
# - xform/J\x02w[a-zA-Z0-9]*/幽/ #異常音
# - xform/J\x02[a-zA-Z0-9]*/伊/ #異常音
- xform/[RJCP]//
- xform/\x02w[a-zA-Z0-9]*/區/
- xform/\x02[a-zA-Z0-9]*/烏/
- xform/\s+/、/
- xform/幫(區|烏|娃|蛙|烓|翳)/p\1/
- xform/幫(憂|醫|逶|漪|幽|伊)/p\1/
- xform/滂(區|烏|娃|蛙|烓|翳)/pʰ\1/
- xform/滂(憂|醫|逶|漪|幽|伊)/pʰ\1/
- xform/並(區|烏|娃|蛙|烓|翳)/b\1/
- xform/並(憂|醫|逶|漪|幽|伊)/b\1/
- xform/明(區|烏|娃|蛙|烓|翳)/m\1/
- xform/明(憂|醫|逶|漪|幽|伊)/m\1/
- xform/見(區|烏|娃|蛙|烓|翳)/q\1/
- xform/見(憂|醫|逶|漪|幽|伊)/k\1/
- xform/谿(區|烏|娃|蛙|烓|翳)/qʰ\1/
- xform/谿(憂|醫|逶|漪|幽|伊)/kʰ\1/
- xform/羣(區|烏|娃|蛙|烓|翳)/ɢ\1/
- xform/羣(憂|醫|逶|漪|幽|伊)/g\1/
- xform/疑(區|烏|娃|蛙|烓|翳)/ɴ\1/
- xform/疑(憂|醫|逶|漪|幽|伊)/ŋ\1/
- xform/曉(區|烏|娃|蛙|烓|翳)/x\1/
- xform/曉(憂|醫|逶|漪|幽|伊)/x\1/
- xform/匣(區|烏|娃|蛙|烓|翳)/ʁ\1/
- xform/匣(憂|醫|逶|漪|幽|伊)/ɦ\1/
- xform/影(區|烏|娃|蛙|烓|翳)/ʔ\1/
- xform/影(憂|醫|逶|漪|幽|伊)/ʔ\1/
- xform/端/t/
- xform/知(娃|蛙|逶|漪)/tɹ\1/
- xform/章(幽|伊)/c\1/
- xform/透/tʰ/
- xform/徹(娃|蛙|逶|漪)/tʰɹ\1/
- xform/昌(幽|伊)/cʰ\1/
- xform/定/d/
- xform/澄(娃|蛙|逶|漪)/dɹ\1/
- xform/常(幽|伊)/ɟ\1/
- xform/泥/n/
- xform/孃(娃|蛙|逶|漪)/nɹ\1/
- xform/日(幽|伊)/ɲ\1/
- xform/書(幽|伊)/ç\1/
- xform/船(幽|伊)/ɮ\1/
- xform/以(幽|伊)/ʝ\1/
- xform/云(憂|醫|逶|漪|幽|伊)/ɦ\1/
- xform/精(區|烏|烓|翳)/ʦ\1/
- xform/精(幽|伊)/ʦ\1/
- xform/莊(娃|蛙|逶|漪)/ꭧ\1/
- xform/莊/ꭧ\1/
- xform/淸(區|烏|烓|翳)/ʦʰ\1/
- xform/淸(幽|伊)/ʦʰ\1/
- xform/初(娃|蛙|逶|漪)/ꭧʰ\1/
- xform/初/ꭧʰ\1/
- xform/從(區|烏|烓|翳)/ʣ\1/
- xform/從(幽|伊)/ʣ\1/
- xform/崇(娃|蛙|逶|漪)/ꭦ\1/
- xform/崇/ꭦ\1/
- xform/心(區|烏|烓|翳)/s\1/
- xform/心(幽|伊)/s\1/
- xform/生(娃|蛙|逶|漪)/ʂ\1/
- xform/生/ʂ\1/
- xform/邪(幽|伊)/z\1/
- xform/俟(逶|漪)/ʐ\1/
- xform/來(區|烏|烓|翳)/l\1/
- xform/來(娃|蛙|逶|漪)/lɹ\1/
- xform/(憂|逶|幽)尤/uT/
- xform/漪幽/ɹiTu/
- xform/伊幽/iTu/
- xform/區侯/ɔuT/
- xform/漪宵/ɹieTu/
- xform/伊宵/ieTu/
- xform/翳蕭/ɛeTu/
- xform/娃肴/ɹɛeTu/
- xform/烏豪/ʌɤTu/
- xform/區東/ɔuTɴ/
- xform/(憂|逶|幽)東/uTɴ/
- xform/(憂|逶|幽)鐘/uoTɴ/
- xform/區冬/ɔoTɴ/
- xform/蛙江/ɹɔoTɴ/
- xform/(醫|漪|伊)陽/ɯɑTɴ/
- xform/(憂|逶|幽)陽/uɑTɴ/
- xform/烏唐/ɑTɴ/
- xform/區唐/ɔɑTɴ/
- xform/(醫|伊)蒸/ɯTŋ/
- xform/憂蒸/uTŋ/
- xform/漪蒸/ɹɯTŋ/
- xform/逶蒸/ɹuTŋ/
- xform/翳靑/ɛeTŋ/
- xform/烓靑/œeTŋ/
- xform/娃耕/ɹɛeTŋ/
- xform/蛙耕/ɹœeTŋ/
- xform/烏登/ʌɤTŋ/
- xform/區登/ɔɤTŋ/
- xform/娃庚/ɹaTŋ/
- xform/蛙庚/ɹœaTŋ/
- xform/(醫|漪)(庚|淸)/ɹiaTŋ/
- xform/(憂|逶)(庚|淸)/ɹyaTŋ/
- xform/伊淸/iaTŋ/
- xform/幽淸/yaTŋ/
- xform/(醫|漪|伊)之/ɯT/
- xform/(醫|漪|伊)魚/ɯɤT/
- xform/(憂|逶|幽)虞/uoT/
- xform/(醫|漪)支/ɹieT/
- xform/(憂|逶)支/ɹyeT/
- xform/伊支/ieT/
- xform/幽支/yeT/
- xform/區模/ɔoT/
- xform/娃佳/ɹɛeT/
- xform/蛙佳/ɹœeT/
- xform/伊麻/iaT/
- xform/幽麻/yaT/
- xform/(醫|漪)歌/ɯɑT/
- xform/(憂|逶)歌/uɑT/
- xform/娃麻/ɹaT/
- xform/蛙麻/ɹœaT/
- xform/烏歌/ɑT/
- xform/區歌/ɔɑT/
- xform/(漪|醫)微/ɯTi/
- xform/(逶|憂)微/uTi/
- xform/(漪|醫)脂/ɹiT/
- xform/(逶|憂)脂/ɹyiT/
- xform/伊脂/iT/
- xform/幽脂/yiT/
- xform/(醫|漪|伊)廢/ɯɤTi/
- xform/(憂|逶|幽)廢/uoTi/
- xform/漪祭/ɹieTi/
- xform/逶祭/ɹyeTi/
- xform/伊祭/ieTi/
- xform/幽祭/yeTi/
- xform/烏咍/ʌɤTi/
- xform/區灰/ɔoTi/
- xform/娃皆/ɹɛeTi/
- xform/蛙皆/ɹœeTi/
- xform/翳齊/ɛeTi/
- xform/烓齊/œeTi/
- xform/烏泰/ɑTi/
- xform/區泰/ɔɑTi/
- xform/娃夬/ɹaTi/
- xform/蛙夬/ɹœaTi/
- xform/(醫|漪)殷/ɯTn/
- xform/(憂|逶)文/uTn/
- xform/漪真/ɹiTn/
- xform/逶真/ɹyiTn/
- xform/伊真/iTn/
- xform/幽真/yiTn/
- xform/(醫|漪)元/ɯɤTn/
- xform/(憂|逶)元/uoTn/
- xform/漪仙/ɹieTn/
- xform/逶仙/ɹyeTn/
- xform/伊仙/ieTn/
- xform/幽仙/yeTn/
- xform/烏痕/ʌɤTn/
- xform/區魂/ɔoTn/
- xform/娃山/ɹɛeTn/
- xform/蛙山/ɹœeTn/
- xform/翳先/ɛeTn/
- xform/烓先/œeTn/
- xform/烏寒/ɑTn/
- xform/區寒/ɔɑTn/
- xform/娃刪/ɹaTn/
- xform/蛙刪/ɹœaTn/
- xform/漪侵/ɹiTm/
- xform/醫侵/ɯTm/
- xform/伊侵/iTm/
- xform/(醫|伊)嚴/ɯɤTm/
- xform/憂凡/uoTm/
- xform/漪鹽/ɹieTm/
- xform/伊鹽/ieTm/
- xform/烏覃/ʌɤTm/
- xform/娃咸/ɹɛeTm/
- xform/翳添/ɛeTm/
- xform/烏談/ɑTm/
- xform/娃銜/ɹaTm/
- xform/(ɹ)+/\1/
- xform/(ꭧ|ꭧʰ|ꭦ|ʂ|ʐ)ɹ/\1/
- xform/(ꭧ|ꭧʰ|ꭦ|ʂ|ʐ)(ɹ)?(u|œ|ɔ)(i|e|a|ɑ)/\1ʷ\4/
- xform/(ꭧ|ꭧʰ|ꭦ|ʂ|ʐ)(ɹ)?(y)(e|a|ɑ)/\1ʷ\4/
- xform/(ꭧ|ꭧʰ|ꭦ|ʂ|ʐ)(ɹ)?(i|ɯ|ɛ|ʌ|u|œ|ɔ)([^T])/\1\4/
- xform/(ɹ)?(œ|ɔ)(a|ɑ)T/ʷ\1\3T/
- xform/((p|pʰ|b|m)ɹ|(ꭧ|ꭧʰ|ꭦ|ʂ|ʐ))iTm/\1ɯTm/
- xform/(ꭧ|ꭧʰ|ꭦ|ʂ|ʐ)iT(n|t)/\1ɯT\2/
- "xform/T([^T]*)平/\u0304\\1/"
- "xform/T([^T]*)上/\u0301\\1/"
- "xform/T([^T]*)去/\u0300\\1/"
- "xform/T([^T]*入)/\u0307\\1/"
- "xform/ɴ入/q/"
- "xform/ŋ入/k/"
- "xform/n入/t/"
- "xform/m入/p/"
- xform/、/, /
- xform/-/ /