|
|
@@ -1,26 +1,34 @@
|
|
|
patch:
|
|
|
+ # ----------------------------------------
|
|
|
+ # 1. 引擎与组件加载 (Lua 脚本)
|
|
|
+ # ----------------------------------------
|
|
|
engine/processors/+:
|
|
|
- lua_processor@*cold_word_drop.processor
|
|
|
engine/filters/+:
|
|
|
- lua_filter@*cold_word_drop.filter
|
|
|
|
|
|
+ # ----------------------------------------
|
|
|
+ # 2. 翻译器设定 (Translator)
|
|
|
+ # ----------------------------------------
|
|
|
translator/dictionary: rime_frost.custom
|
|
|
-
|
|
|
translator/preedit_format/+:
|
|
|
- - xform/(?<=[A-Z])\s(?=[A-Z])// # 消除大写字母之间的空格
|
|
|
-
|
|
|
- melt_eng/initial_quality: 1.1
|
|
|
-
|
|
|
+ - xform/(?<=[A-Z])\s(?=[A-Z])//
|
|
|
+
|
|
|
+ # ----------------------------------------
|
|
|
+ # 6. 杂项设定 (Filters & Patterns)
|
|
|
+ # ----------------------------------------
|
|
|
recognizer/patterns/punct: "^v([0-9]|10|[A-Za-z]+)$"
|
|
|
-
|
|
|
long_word_filter/count: 3
|
|
|
|
|
|
+ # ----------------------------------------
|
|
|
+ # 4. 方案切换开关 (Switches)
|
|
|
+ # ----------------------------------------
|
|
|
switches:
|
|
|
- name: ascii_mode
|
|
|
states: [中, 英]
|
|
|
- name: ascii_punct
|
|
|
states: ["中标", "英标"]
|
|
|
- # reset: 1 # 默认英标
|
|
|
+ # reset: 1 # 默认英标 (如需开启请取消注释)
|
|
|
- name: traditionalization
|
|
|
states: [简, 繁]
|
|
|
- name: emoji
|
|
|
@@ -30,7 +38,12 @@ patch:
|
|
|
- name: search_single_char
|
|
|
abbrev: [词, 单]
|
|
|
states: [正常, 单字]
|
|
|
-
|
|
|
+
|
|
|
+ # ----------------------------------------
|
|
|
+ # 3. 中英文运算
|
|
|
+ # ----------------------------------------
|
|
|
+ melt_eng/initial_quality: 1.1
|
|
|
+ # 降低常见英文单词的优先级,避免干扰中文输入
|
|
|
reduce_english_filter:
|
|
|
mode: custom
|
|
|
idx: 3
|
|
|
@@ -57,38 +70,52 @@ patch:
|
|
|
my, mt, dj, as, js, cs, ak, ps, cd, cn, hk, bt, pk, ml
|
|
|
]
|
|
|
|
|
|
+
|
|
|
+ # ----------------------------------------
|
|
|
+ # 3. 拼写运算 (Speller/Algebra)
|
|
|
+ # ----------------------------------------
|
|
|
speller/algebra:
|
|
|
- #-----------------------------------
|
|
|
- # 让 bei 都能由 be 打出来
|
|
|
+ # --- 自定义简拼 ---
|
|
|
+ # 让 bei 都能由 be 打出来 (杯/北/被)
|
|
|
- derive/^([b])ei$/$1e/
|
|
|
- #-----------------------------------
|
|
|
- - derive/^([zcs])h/$1/
|
|
|
- - derive/^([zcs])([^h])/$1h$2/
|
|
|
- - derive/ang$/an/
|
|
|
- - derive/an$/ang/
|
|
|
- - derive/eng$/en/
|
|
|
- - derive/en$/eng/
|
|
|
- - derive/in$/ing/
|
|
|
- - derive/ing$/in/
|
|
|
- - derive/ian$/iang/
|
|
|
- - derive/iang$/ian/
|
|
|
- - derive/uan$/uang/
|
|
|
- - derive/uang$/uan/
|
|
|
- - derive/ong$/on/
|
|
|
- - derive/on$/ong/
|
|
|
- #-----------------------------------
|
|
|
+
|
|
|
+ # --- 模糊音 (已全部开启) ---
|
|
|
+ # 声母模糊
|
|
|
+ - derive/^([zcs])h/$1/ # zh,ch,sh => z,c,s
|
|
|
+ - derive/^([zcs])([^h])/$1h$2/ # z,c,s => zh,ch,sh
|
|
|
+ # 韵母模糊
|
|
|
+ - derive/ang$/an/ # ang => an
|
|
|
+ - derive/an$/ang/ # an => ang
|
|
|
+ - derive/eng$/en/ # eng => en
|
|
|
+ - derive/en$/eng/ # en => eng
|
|
|
+ - derive/in$/ing/ # in => ing
|
|
|
+ - derive/ing$/in/ # ing => in
|
|
|
+ - derive/ian$/iang/ # ian => iang
|
|
|
+ - derive/iang$/ian/ # iang => ian
|
|
|
+ - derive/uan$/uang/ # uan => uang
|
|
|
+ - derive/uang$/uan/ # uang => uan
|
|
|
+ - derive/ong$/on/ # ong => on
|
|
|
+ - derive/on$/ong/ # on => ong
|
|
|
+
|
|
|
+ # --- 超级简拼与修正 ---
|
|
|
- erase/^hm$/
|
|
|
- erase/^m$/
|
|
|
- erase/^n$/
|
|
|
- erase/^ng$/
|
|
|
- # shih -> 时候
|
|
|
+ # 首字母简拼
|
|
|
- abbrev/^([a-z]).+$/$1/
|
|
|
+ # 声母简拼优化 (shih -> 时候)
|
|
|
- abbrev/^([zcs]h).+$/$1/
|
|
|
- abbrev/^([a-z]i).+$/$1/
|
|
|
+
|
|
|
+ # --- 容错拼写 (v/u 混用) ---
|
|
|
- derive/^([nl])ve$/$1ue/
|
|
|
- derive/^([jqxy])u/$1v/
|
|
|
- derive/^([nl])ue$/$1ve/
|
|
|
- derive/^([jqxy])v/$1u/
|
|
|
+
|
|
|
+ # --- 自动纠错 (错音修正) ---
|
|
|
+ # 警告:以下规则可能会对简拼产生副作用
|
|
|
- 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/
|
|
|
- derive/([wfghk])ai$/$1ia/
|
|
|
- derive/([wfghkz])ei$/$1ie/
|
|
|
@@ -124,4 +151,4 @@ patch:
|
|
|
- derive/([rtsdghkzc])o(u|ng)$/$1o/
|
|
|
- derive/(.+)ong$/$1on/
|
|
|
- derive/([tl])eng$/$1en/
|
|
|
- - derive/([qwrtypsdfghjklzxcbnm])([aeio])ng$/$1ng/
|
|
|
+ - derive/([qwrtypsdfghjklzxcbnm])([aeio])ng$/$1ng/
|