rime_frost.custom.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. patch:
  2. # ----------------------------------------
  3. # 6. 杂项设定 (Filters & Patterns)
  4. # ----------------------------------------
  5. engine/processors/+:
  6. - lua_processor@*cold_word_drop.processor
  7. engine/filters/+:
  8. - lua_filter@*cold_word_drop.filter
  9. translator/dictionary: rime_frost.custom
  10. translator/preedit_format/+:
  11. - xform/(?<=[A-Z])\s(?=[A-Z])//
  12. recognizer/patterns/punct: "^v([0-9]|10|[A-Za-z]+)$"
  13. long_word_filter/count: 3
  14. # ----------------------------------------
  15. # 4. 方案切换开关 (Switches)
  16. # ----------------------------------------
  17. switches:
  18. - name: ascii_mode
  19. states: [中, 英]
  20. - name: ascii_punct
  21. states: ["中标", "英标"]
  22. # reset: 1 # 默认英标 (如需开启请取消注释)
  23. - name: traditionalization
  24. states: [简, 繁]
  25. - name: emoji
  26. states: [表情关, 表情开]
  27. - name: full_shape
  28. states: [半角, 全角]
  29. - name: search_single_char
  30. abbrev: [词, 单]
  31. states: [正常, 单字]
  32. # ----------------------------------------
  33. # 3. 中英文运算
  34. # ----------------------------------------
  35. melt_eng/initial_quality: 1.1
  36. # 降低常见英文单词的优先级,避免干扰中文输入
  37. reduce_english_filter:
  38. mode: custom
  39. idx: 3
  40. words: [bus, key, yes]
  41. # ----------------------------------------
  42. # 3. 拼写运算 (Speller/Algebra)
  43. # ----------------------------------------
  44. speller/algebra:
  45. # --- 自定义简拼 ---
  46. # 让 bei 都能由 be 打出来 (杯/北/被)
  47. - derive/^([b])ei$/$1e/
  48. # --- 模糊音 ---
  49. # 声母模糊
  50. - derive/^([zcs])h/$1/ # zh,ch,sh => z,c,s
  51. - derive/^([zcs])([^h])/$1h$2/ # z,c,s => zh,ch,sh
  52. # 韵母模糊
  53. - derive/ang$/an/ # ang => an
  54. - derive/an$/ang/ # an => ang
  55. - derive/eng$/en/ # eng => en
  56. - derive/en$/eng/ # en => eng
  57. - derive/in$/ing/ # in => ing
  58. - derive/ing$/in/ # ing => in
  59. - derive/ian$/iang/ # ian => iang
  60. - derive/iang$/ian/ # iang => ian
  61. - derive/uan$/uang/ # uan => uang
  62. - derive/uang$/uan/ # uang => uan
  63. - derive/ong$/on/ # ong => on
  64. - derive/on$/ong/ # on => ong
  65. # --- 超级简拼与修正 ---
  66. - erase/^hm$/
  67. - erase/^m$/
  68. - erase/^n$/
  69. - erase/^ng$/
  70. # 首字母简拼
  71. - abbrev/^([a-z]).+$/$1/
  72. # 声母简拼优化 (shih -> 时候)
  73. - abbrev/^([zcs]h).+$/$1/
  74. - abbrev/^([a-z]i).+$/$1/
  75. # --- 容错拼写 (v/u 混用) ---
  76. - derive/^([nl])ve$/$1ue/
  77. - derive/^([jqxy])u/$1v/
  78. - derive/^([nl])ue$/$1ve/
  79. - derive/^([jqxy])v/$1u/
  80. # --- 自动纠错 (错音修正) ---
  81. # 警告:以下规则可能会对简拼产生副作用
  82. - 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/
  83. - derive/([wfghk])ai$/$1ia/
  84. - derive/([wfghkz])ei$/$1ie/
  85. - derive/([jqx])ie$/$1ei/
  86. - derive/([rtypsdghklzcbnm])ao$/$1oa/
  87. - derive/([ypfm])ou$/$1uo/
  88. - derive/([wrtypsdfghklzcbnm])ang$/$1nag/
  89. - derive/([wrtypsdfghklzcbnm])ang$/$1agn/
  90. - derive/([wrtpsdfghklzcbnm])eng$/$1neg/
  91. - derive/([wrtpsdfghklzcbnm])eng$/$1egn/
  92. - derive/([qtypdjlxbnm])ing$/$1nig/
  93. - derive/([qtypdjlxbnm])ing$/$1ign/
  94. - derive/([rtysdghklzcn])ong$/$1nog/
  95. - derive/([rtysdghklzcn])ong$/$1ogn/
  96. - derive/([qtpdjlxbnm])iao$/$1ioa/
  97. - derive/([qtpdjlxbnm])iao$/$1oia/
  98. - derive/([rtsghkzc])ui$/$1iu/
  99. - derive/([qjlxnm])iu$/$1ui/
  100. - derive/([qjlxn])iang$/$1aing/
  101. - derive/([qjlxn])iang$/$1inag/
  102. - derive/([g|k|h|zh|sh])ua$/$1au/
  103. - derive/([g|h|k|zh|ch|sh])uai$/$1aui/
  104. - derive/([qrtysdghjklzxcn])uan$/$1aun/
  105. - derive/([nlyjqx])ue$/$1eu/
  106. - derive/([g|h|k|zh|ch|sh])uang$/$1aung/
  107. - derive/([g|h|k|zh|ch|sh])uang$/$1uagn/
  108. - derive/([g|h|k|zh|ch|sh])uang$/$1unag/
  109. - derive/([g|h|k|zh|ch|sh])uang$/$1augn/
  110. - derive/([jqx])iong$/$1inog/
  111. - derive/([jqx])iong$/$1oing/
  112. - derive/([jqx])iong$/$1iogn/
  113. - derive/([jqx])iong$/$1oign/
  114. - derive/([rtsdghkzc])o(u|ng)$/$1o/
  115. - derive/(.+)ong$/$1on/
  116. - derive/([tl])eng$/$1en/
  117. - derive/([qwrtypsdfghjklzxcbnm])([aeio])ng$/$1ng/