rime_frost.custom.yaml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. patch:
  2. # ----------------------------------------
  3. # 1. 引擎与组件加载 (Lua 脚本)
  4. # ----------------------------------------
  5. engine/processors/+:
  6. - lua_processor@*cold_word_drop.processor
  7. engine/filters/+:
  8. - lua_filter@*cold_word_drop.filter
  9. # ----------------------------------------
  10. # 2. 翻译器设定 (Translator)
  11. # ----------------------------------------
  12. translator/dictionary: rime_frost.custom
  13. translator/preedit_format/+:
  14. - xform/(?<=[A-Z])\s(?=[A-Z])//
  15. # ----------------------------------------
  16. # 6. 杂项设定 (Filters & Patterns)
  17. # ----------------------------------------
  18. recognizer/patterns/punct: "^v([0-9]|10|[A-Za-z]+)$"
  19. long_word_filter/count: 3
  20. # ----------------------------------------
  21. # 4. 方案切换开关 (Switches)
  22. # ----------------------------------------
  23. switches:
  24. - name: ascii_mode
  25. states: [中, 英]
  26. - name: ascii_punct
  27. states: ["中标", "英标"]
  28. # reset: 1 # 默认英标 (如需开启请取消注释)
  29. - name: traditionalization
  30. states: [简, 繁]
  31. - name: emoji
  32. states: [表情关, 表情开]
  33. - name: full_shape
  34. states: [半角, 全角]
  35. - name: search_single_char
  36. abbrev: [词, 单]
  37. states: [正常, 单字]
  38. # ----------------------------------------
  39. # 3. 中英文运算
  40. # ----------------------------------------
  41. melt_eng/initial_quality: 1.1
  42. # 降低常见英文单词的优先级,避免干扰中文输入
  43. reduce_english_filter:
  44. mode: custom
  45. idx: 3
  46. words: [
  47. aid, ann,
  48. bail, bait, bam, band, bans, bat, bay, bend, bent, benz, bib, bid, bien, biz, boc, bop, bos, bud, buf, bus, bach, bench, bush, bog,
  49. cab, cad, cain, cam, cans, cap, cef, chad, chan, chap, chef, cher, chew, chic, chin, chip, chit, coup, cum, cunt, cur, couch,
  50. dab, dag, dal, dam, dent, dew, dial, diet, dim, din, dip, dis, dit, doug, dub, dug, dunn, don,
  51. fab, fax, fob, fog, foul, fur, fend,
  52. gag, gail, gain, gal, gam, gaol, ged, gel, ger, guam, gus, gut,
  53. hail, ham, hank, hans, hat, hay, heil, heir, hem, hep, hex, hud, hum, hung, hunk, hut, hush,
  54. jim, jug,
  55. kat, key,
  56. lab, lad, lag, laid, lam, laos, lap, lat, lax, lay, led, leg, lex, liam, lib, lichen, lid, lied, lien, lies, linn, lip, lit, liz, lob, lug, lund, lung, lux, lash, loch, lush,
  57. mag, maid, mann, mar, mat, med, mel, mend, mens, ment, mil, mins, mint, mob, moc, mop, mos, mot, mud, mug, mum, mesh,
  58. nap, nat, nay, neil, nib, nip, noun, nous, nun, nut, nail, nash,
  59. pac, paid, pail, pain, pair, pak, pal, pam, pans, pant, pap, par, pat, paw, pax, pens, pic, pier, pies, pins, pint, pit, pix, pod, pop, pos, pot, pour, pow, pub, pinch, pouch,
  60. rand, rant, rent, rep, res, ret, rex, rib, rid, rig, rim, rub, rug, rum, runc, runs, ranch,
  61. sac, sail, sal, sam, sans, sap, saw, sax, sew, sham, shaw, shin, sig, sin, sip, sis, suit, sung, suns, sup, sur, sus, ship,
  62. tad, tail, taj, tar, tax, tec, ted, tel, ter, tex, tic, tied, tier, ties, tim, tin, tit, tour, tout, tum,
  63. wag, wand, womens, wap, wax, weir, won, went,
  64. yan, yen, yes,
  65. zach,
  66. my, mt, dj, as, js, cs, ak, ps, cd, cn, hk, bt, pk, ml
  67. ]
  68. # ----------------------------------------
  69. # 3. 拼写运算 (Speller/Algebra)
  70. # ----------------------------------------
  71. speller/algebra:
  72. # --- 自定义简拼 ---
  73. # 让 bei 都能由 be 打出来 (杯/北/被)
  74. - derive/^([b])ei$/$1e/
  75. # --- 模糊音 (已全部开启) ---
  76. # 声母模糊
  77. - derive/^([zcs])h/$1/ # zh,ch,sh => z,c,s
  78. - derive/^([zcs])([^h])/$1h$2/ # z,c,s => zh,ch,sh
  79. # 韵母模糊
  80. - derive/ang$/an/ # ang => an
  81. - derive/an$/ang/ # an => ang
  82. - derive/eng$/en/ # eng => en
  83. - derive/en$/eng/ # en => eng
  84. - derive/in$/ing/ # in => ing
  85. - derive/ing$/in/ # ing => in
  86. - derive/ian$/iang/ # ian => iang
  87. - derive/iang$/ian/ # iang => ian
  88. - derive/uan$/uang/ # uan => uang
  89. - derive/uang$/uan/ # uang => uan
  90. - derive/ong$/on/ # ong => on
  91. - derive/on$/ong/ # on => ong
  92. # --- 超级简拼与修正 ---
  93. - erase/^hm$/
  94. - erase/^m$/
  95. - erase/^n$/
  96. - erase/^ng$/
  97. # 首字母简拼
  98. - abbrev/^([a-z]).+$/$1/
  99. # 声母简拼优化 (shih -> 时候)
  100. - abbrev/^([zcs]h).+$/$1/
  101. - abbrev/^([a-z]i).+$/$1/
  102. # --- 容错拼写 (v/u 混用) ---
  103. - derive/^([nl])ve$/$1ue/
  104. - derive/^([jqxy])u/$1v/
  105. - derive/^([nl])ue$/$1ve/
  106. - derive/^([jqxy])v/$1u/
  107. # --- 自动纠错 (错音修正) ---
  108. # 警告:以下规则可能会对简拼产生副作用
  109. - derive/([zcs])h(a|e|i|u|ai|ei|an|en|ou|uo|ua|un|ui|uan|uai|uang|ang|eng|ong)$/h$1$2/
  110. - derive/([wfghk])ai$/$1ia/
  111. - derive/([wfghkz])ei$/$1ie/
  112. - derive/([jqx])ie$/$1ei/
  113. - derive/([rtypsdghklzcbnm])ao$/$1oa/
  114. - derive/([ypfm])ou$/$1uo/
  115. - derive/([wrtypsdfghklzcbnm])ang$/$1nag/
  116. - derive/([wrtypsdfghklzcbnm])ang$/$1agn/
  117. - derive/([wrtpsdfghklzcbnm])eng$/$1neg/
  118. - derive/([wrtpsdfghklzcbnm])eng$/$1egn/
  119. - derive/([qtypdjlxbnm])ing$/$1nig/
  120. - derive/([qtypdjlxbnm])ing$/$1ign/
  121. - derive/([rtysdghklzcn])ong$/$1nog/
  122. - derive/([rtysdghklzcn])ong$/$1ogn/
  123. - derive/([qtpdjlxbnm])iao$/$1ioa/
  124. - derive/([qtpdjlxbnm])iao$/$1oia/
  125. - derive/([rtsghkzc])ui$/$1iu/
  126. - derive/([qjlxnm])iu$/$1ui/
  127. - derive/([qjlxn])iang$/$1aing/
  128. - derive/([qjlxn])iang$/$1inag/
  129. - derive/([g|k|h|zh|sh])ua$/$1au/
  130. - derive/([g|h|k|zh|ch|sh])uai$/$1aui/
  131. - derive/([qrtysdghjklzxcn])uan$/$1aun/
  132. - derive/([nlyjqx])ue$/$1eu/
  133. - derive/([g|h|k|zh|ch|sh])uang$/$1aung/
  134. - derive/([g|h|k|zh|ch|sh])uang$/$1uagn/
  135. - derive/([g|h|k|zh|ch|sh])uang$/$1unag/
  136. - derive/([g|h|k|zh|ch|sh])uang$/$1augn/
  137. - derive/([jqx])iong$/$1inog/
  138. - derive/([jqx])iong$/$1oing/
  139. - derive/([jqx])iong$/$1iogn/
  140. - derive/([jqx])iong$/$1oign/
  141. - derive/([rtsdghkzc])o(u|ng)$/$1o/
  142. - derive/(.+)ong$/$1on/
  143. - derive/([tl])eng$/$1en/
  144. - derive/([qwrtypsdfghjklzxcbnm])([aeio])ng$/$1ng/