rime / home

Rime::Home is home to Rime users and developers
https://rime.im
4.23k stars 230 forks source link

五筆86無法自動造詞 #1629

Closed Dqxyyhl closed 1 month ago

Dqxyyhl commented 1 month ago

試過其他輸入方案(如朙月拼音、極點五筆),自動造詞都無問題。唯獨五筆86如何調試皆無法成功,向各位請教。

目前的wubi86.schema.yaml文件:

# Rime schema settings
# encoding: utf-8

schema:
  schema_id: wubi86
  name: "五笔86"
  version: "0.21"
  author:
    - 發明人 王永民先生
  description: |
    五筆字型86版
    碼表源自 ibus-table
    敲 z 鍵進入拼音反查
  dependencies:
    - pinyin_simp

switches:
  - name: ascii_mode
    reset: 0
    states: [ 中文, 西文 ]
  - name: full_shape
    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
    - punct_segmentor
    - fallback_segmentor
  translators:
    - punct_translator
    - reverse_lookup_translator
    - table_translator

speller:
  delimiter: " ;'"
  max_code_length: 0
  auto_select: false

translator:
  dictionary: wubi86
  enable_charset_filter: true
  enable_sentence: true
  enable_user_dict: true
  enable_encoder: true
  encode_commit_history: true
  max_phrase_length: 4
  disable_user_dict_for_patterns:
    - "^z.*$"

reverse_lookup:
  dictionary: pinyin_simp
  prefix: "z"
  suffix: "'"
  tips: 〔拼音〕
  preedit_format:
    - xform/([nl])v/$1ü/
    - xform/([nl])ue/$1üe/
    - xform/([jqxy])v/$1u/

punctuator:
  import_preset: symbols

key_binder:
  import_preset: default

recognizer:
  import_preset: default
  patterns:
    punct: '^/([0-9]0?|[A-Za-z]+)$'
    reverse_lookup: "^z[a-z]*'?$"

理論上translator處的若干參數調整為true即可,但目前仍然無法做到自動造詞。如鍵入「ytmfhqdy」上屏「謝瞻」,再鍵入「ythq」時「謝瞻」並未如預期出現。

目前的wubi86.custom.yaml文件:

patch:
# 配置translator ,便于管理词库
  translator/dictionary: wubi86.config

  switches/@next:
    name: emoji_suggestion
    reset: 1
    states: [ "🈚︎", "🈶️" ]
  'engine/filters/@before 0':
    simplifier@emoji_suggestion
  emoji_suggestion:
    opencc_config: emoji.json
    option_name: emoji_suggestion
    tips: none
    inherit_comment: false

  speller:
    max_code_length: 0   # 最长编码长度,0表示不设置长度
    auto_select: false  # 关闭自动上屏
  translator:
    enable_sentence: true  # 开启句子输入模式(连打模式)
    enable_user_dict: true  # 启用用户词典
    enable_encoder: true  # 启用编码器
    encode_commit_history: true

冒昧打擾,望諸位不吝賜教!

lotem commented 1 month ago
# wubi86.custom.yaml
patch:
  translator/dictionary: wubi86.config  # 請刪除這一行

應該是因爲這裏沒有設置成原裝的 wubi86 詞典。

Dqxyyhl commented 1 month ago

謝謝!之前配置用戶詞庫時用了比較糟糕的方式(在custom文件裏面用config),現在把用戶詞庫加入wubi86_user.dict.yaml中,並在原裝的詞典中用inport_tables導入用戶詞庫,就完全解決了。