rime / librime

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

fix(speller): make simple candidates auto-selectable #894

Closed ksqsf closed 3 months ago

ksqsf commented 3 months ago

Pull request

Previously, the speller only auto-selects Phrases (type "table" and "user_table"), and does not select SimpleCandidate, but history_translator only produces SimpleCandidate, and thus history candidates cannot be auto-selected. This PR corrects this oversight.

(history_translator will preserve the old candidate type, e.g. "uniquified", but we cannot access the genuine candidate via SimpleCandidate here, unfortuantely.)

Issue tracker

Fixes will automatically close the related issue

Fixes #

Feature

Describe feature of pull request

Unit test

Manual test

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

ksqsf commented 3 months ago

I'm confused why the speller only considers table and user_table in the first place.

If there's a good reason, alternatively, we can make history_translator always tag candidates as "history".

ksqsf commented 3 months ago

Somewhat related: I think we should also support script_translator.

lotem commented 3 months ago

Somewhat related: I think we should also support script_translator.

The auto-select feature comes from table-based IMEs. I'm not sure if the feature works with script_translator because the latter always enables sentence input, therefore you can hardly tell when the input is done and cannot be any longer.