rime / librime

Rime Input Method Engine, the core library
https://rime.im
BSD 3-Clause "New" or "Revised" License
3.33k stars 547 forks source link

reverse_lookup_filter导致五笔四码唯一不自动上屏的问题 #565

Open qq420100523 opened 2 years ago

qq420100523 commented 2 years ago

Describe the bug 在此码表(https://github.com/rime/rime-wubi)的基础上添加了- reverse_lookup_filter配置,结果导致无法四码唯一上屏。

To Reproduce 这是我的五笔配置文件:

# 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
  filters:                        # 过滤器
    - reverse_lookup_filter@pinyin_reverse_lookup   # 返查拼音编码过滤器
    - uniquifier                  # 重复候选词过滤器

speller:
  delimiter: " ;'"
  max_code_length: 4              # 四码上屏
  auto_select: true               # 四码唯一时,自动上屏

translator:
  dictionary: wubi86
  enable_charset_filter: true
  enable_completion: false        # 提前显示编码未输入完整的词条
  enable_sentence: false
  enable_encoder: false
  encode_commit_history: false
  # 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/

# 返查拼音编码配置
pinyin_reverse_lookup:
  tags: [ pinyin_comment ]
  dictionary: pinyin_simp
  comment_format:
    - xform/([nl])v/$1ü/
    - xform/([nl])ue/$1üe/
    - xform/([jqxy])v/$1u/
    - xform/^/♪ /
    - xform/$/

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]*'?$"
    pinyin_comment: "^[a-y]*?$"

Flavor(please complete the following information): Select your flavor:

Package:

Ace-Who commented 2 years ago

行为符合设计。在 recognizer 识别到符合 pinyin_comment 模式的输入码时,会阻止上屏并打上标签。解决办法是不要通过 recognizer 打标,而使用默认的 abc 标签。

qq420100523 commented 2 years ago

行为符合设计。在 recognizer 识别到符合 pinyin_comment 模式的输入码时,会阻止上屏并打上标签。解决办法是不要通过 recognizer 打标,而使用默认的 abc 标签。

确实,不使用recognizer打tag,直接使用默认的'abc' tag就不会影响到四码唯一上屏。谢谢