Selaa lähdekoodia

add word drop and debug

Dew-OF-Aurora 5 kuukautta sitten
vanhempi
sitoutus
d7f94bb0ed
2 muutettua tiedostoa jossa 87 lisäystä ja 17 poistoa
  1. 40 17
      custom/default.custom.yaml
  2. 47 0
      custom/rime_frost.custom.yaml

+ 40 - 17
custom/default.custom.yaml

@@ -1,14 +1,6 @@
 patch:
-  # 方案列表
   schema_list:
-    # 可以直接删除或注释不需要的方案,对应的 *.schema.yaml 方案文件也可以直接删除
     - schema: rime_frost # 白霜拼音(全拼)
-    # - schema: rime_frost_double_pinyin # 自然码双拼
-    # - schema: rime_frost_double_pinyin_mspy # 微软双拼
-    # - schema: rime_frost_double_pinyin_sogou # 搜狗双拼
-    # - schema: rime_frost_double_pinyin_flypy # 小鹤双拼
-    # - schema: rime_frost_double_pinyin_abc      # 智能 ABC 双拼
-    # - schema: rime_frost_double_pinyin_ziguang  # 紫光双拼
 
   # 菜单
   menu:
@@ -28,15 +20,46 @@ patch:
       - emoji
       - full_shape
       - search_single_char
-    fold_options: true # 呼出时是否折叠,多方案时建议折叠 true ,一个方案建议展开 false
+    fold_options: false # 呼出时是否折叠,多方案时建议折叠 true ,一个方案建议展开 false
     abbreviate_options: true # 折叠时是否缩写选项
     option_list_separator: " / " # 折叠时的选项分隔符
 
-  ascii_composer:
-    good_old_caps_lock: true # true | false
-    switch_key:
-      Caps_Lock: clear # commit_code | commit_text | clear
-      Shift_L: commit_code # commit_code | commit_text | inline_ascii | clear | noop
-      Shift_R: noop # commit_code | commit_text | inline_ascii | clear | noop
-      Control_L: noop # commit_code | commit_text | inline_ascii | clear | noop
-      Control_R: noop # commit_code | commit_text | inline_ascii | clear | noop
+  key_binder:
+    # Lua 配置: 以词定字(上屏当前词句的第一个或最后一个字),和中括号翻页有冲突
+    select_first_character: "bracketleft" # 左中括号 [
+    select_last_character: "bracketright" # 右中括号 ]
+    reduce_freq_cand: "Control+j" # 匹配当前输入码后隐藏指定的候选字词 或候选词条放到第四候选位置
+    drop_cand: "Control+d" # 强制删词, 无视输入的编码
+
+    bindings:
+      # Tab / Shift+Tab 切换光标至下/上一个拼音
+      - { when: composing, accept: Shift+Tab, send: Shift+Left }
+      - { when: composing, accept: Tab, send: Shift+Right }
+
+      # Option/Alt + ←/→ 切换光标至下/上一个拼音
+      - { when: composing, accept: Alt+Left, send: Shift+Left }
+      - { when: composing, accept: Alt+Right, send: Shift+Right }
+
+      # 翻页 - =
+      - { when: has_menu, accept: minus, send: Page_Up }
+      - { when: has_menu, accept: equal, send: Page_Down }
+      - { when: always, toggle: ascii_punct, accept: Control+Shift+3 } # 切换中英标点
+      - { when: always, toggle: ascii_punct, accept: Control+Shift+numbersign } # 切换中英标点
+      - { when: always, toggle: traditionalization, accept: Control+Shift+4 } # 切换简繁
+      - {
+          when: always,
+          toggle: traditionalization,
+          accept: Control+Shift+dollar,
+        } # 切换简繁
+      - { when: composing, accept: Control+k, send: Shift+Delete }
+      - { accept: KP_0, send: 0, when: composing }
+      - { accept: KP_1, send: 1, when: composing }
+      - { accept: KP_2, send: 2, when: composing }
+      - { accept: KP_3, send: 3, when: composing }
+      - { accept: KP_4, send: 4, when: composing }
+      - { accept: KP_5, send: 5, when: composing }
+      - { accept: KP_6, send: 6, when: composing }
+      - { accept: KP_7, send: 7, when: composing }
+      - { accept: KP_8, send: 8, when: composing }
+      - { accept: KP_9, send: 9, when: composing }
+      - { accept: KP_Decimal, send: period, when: composing }

+ 47 - 0
custom/rime_frost.custom.yaml

@@ -24,6 +24,53 @@ patch:
     enable_sentence: false # 禁止造句
     initial_quality: 1000 # custom_phrase 的权重应该比 pinyin 和 melt_eng 大
 
+  engine:
+    processors:
+      - lua_processor@*cold_word_drop.processor
+      - lua_processor@*select_character # 以词定字
+      - ascii_composer
+      - recognizer
+      - key_binder
+      - speller
+      - punctuator
+      - selector
+      - navigator
+      - express_editor
+    segmentors:
+      - ascii_segmentor
+      - matcher
+      - abc_segmentor
+      - affix_segmentor@radical_lookup # 部件拆字自定义 tag
+      - punct_segmentor
+      - fallback_segmentor
+    translators:
+      - punct_translator
+      - script_translator
+      - lua_translator@*date_translator # 时间、日期、星期
+      - lua_translator@*lunar # 农历
+      - table_translator@custom_phrase # 自定义短语 custom_phrase.txt
+      - table_translator@melt_eng # 英文输入
+      - table_translator@cn_en # 中英混合词汇
+      - table_translator@radical_lookup # 部件拆字反查
+      - lua_translator@*unicode # Unicode
+      - lua_translator@*number_translator # 数字、金额大写
+      - lua_translator@*force_gc # 暴力 GC
+      - lua_translator@*calculator # 计算器
+    filters:
+      - lua_filter@*cold_word_drop.filter
+      - lua_filter@*is_in_user_dict # 用户词典的词加上一个*
+      - lua_filter@*corrector # 错音错字提示
+      - reverse_lookup_filter@radical_reverse_lookup # 部件拆字滤镜
+      - lua_filter@*autocap_filter # 英文自动大写
+      - lua_filter@*v_filter # v 模式 symbols 优先
+      - lua_filter@*pin_cand_filter # 置顶候选项(顺序要求:置顶候选项 > Emoji > 简繁切换)
+      - lua_filter@*long_word_filter # 长词优先(顺序要求:长词优先 > Emoji)
+      - lua_filter@*reduce_english_filter # 降低部分英语单词在候选项的位置
+      - simplifier@emoji # Emoji
+      - simplifier@traditionalize # 简繁切换
+      - lua_filter@*aux_code # 墨奇辅助码
+      - uniquifier # 去重
+
   speller:
     # 如果不想让什么标点直接上屏,可以加在 alphabet,或者编辑标点符号为两个及以上的映射
     alphabet: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA`/