Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

简体输入时emoji提示仍显示繁体 #199

Open
russell-liu opened this issue Nov 22, 2024 · 5 comments
Open

简体输入时emoji提示仍显示繁体 #199

russell-liu opened this issue Nov 22, 2024 · 5 comments

Comments

@russell-liu
Copy link
Contributor

russell-liu commented Nov 22, 2024

@graphemecluster 最近嘅commit 0ce3764 修复咗繁简有差别时简体输入无法显示emoji嘅问题;呢个问题我最近都研究过,所以有以下提议:

目前修复后仲有一个小问题,就系简体输入时emoji提示仍显示繁体,如下图:
1

我觉得噉样有少少奇怪,谂到两个解决方法:

一,直程唔显示emoji旁嘅提示码。呢个系rime-emoji采用嘅解决方法(见: rime/rime-emoji@618b9a5#diff-12665968d8ab35203380b57e071c87fe524e5cb970388dc04ad87372662b94e2R13 ;呢个commit删去咗emoji列表入面嘅简体字),只需加tips: noneinherit_comment: false。我觉得呢个方法嘅道理在于每个emoji候选项嘅前一个非emoji候选项其实等同佢嘅提示(如上图中1. 妈妈提示2. 👩🏻️),所以emoji隔嚟嘅提示码其实系多余嘅。

二,用比较另类嘅方法强行使emoji旁嘅提示码简体输入时显示为简体。将simplifier@emoji_suggestion摆系filters最前意味住用tips: all会显示繁体提示码,而提示码又唔可以再进行简化;所以我利用simplifier嘅show_in_comment功能,用多个simplifier「手动」产生简体提示码。噉样无可避免会产生重复嘅候选项,但好在用咗uniquifier就表面上冇分别。改动为:

...

engine:
...
  filters:
    - simplifier@emoji_suggestion_duplicate
    - simplifier@simplified_variants_hk
    - simplifier@simplified_trad_tw
    - simplifier@simplified
    - simplifier@simplified_emoji_suggestion
    - simplifier@variants_hk
    - simplifier@trad_tw
    - simplifier
    - simplifier@emoji_suggestion
    - uniquifier
    - reverse_lookup_filter@jyut6ping3_reverse_lookup

...

emoji_suggestion_duplicate:
  opencc_config: emoji.json
  option_name: emoji_suggestion
  tips: none
  show_in_comment: true

simplified_variants_hk:
  option_name: variants_hk
  opencc_config: t2hkf.json
  tips: all
  show_in_comment: true
  comment_format:
    - xform/^/〔/
    - xform/$/〕/
  excluded_types: [ punct, phrase, user_phrase, table, user_table, completion, sentence ]

simplified_trad_tw:
  option_name: trad_tw
  opencc_config: t2tw.json
  tips: all
  show_in_comment: true
  comment_format:
    - xform/^/〔/
    - xform/$/〕/
  excluded_types: [ punct, phrase, user_phrase, table, user_table, completion, sentence ]

simplified:
  option_name: simplification
  opencc_config: t2s.json
  tips: all
  show_in_comment: true
  comment_format:
    - xform/^/〔/
    - xform/$/〕/
  excluded_types: [ punct, phrase, user_phrase, table, user_table, completion, sentence ]

simplified_emoji_suggestion:
  opencc_config: emoji.json
  option_name: emoji_suggestion
  tips: none
  excluded_types: [ punct, phrase, user_phrase, table, user_table, completion, sentence ]

...

呢个改动嘅弊处在于:复杂、冗长、效率低(uniquify前产生重复嘅候选项,尤其喺一词配多emoji时情况严重)。但佢确实可以实现简体输入时简体提示。

我个人觉得采纳方法一合理啲,但既然思考时将方法二谂咗出嚟,都写埋出嚟畀大家考虑同参考。

graphemecluster added a commit that referenced this issue Nov 22, 2024
@graphemecluster
Copy link
Collaborator

試過你個 patch 但唔 work(直程打唔到字),有冇話要新版先 work 定係點?

@russell-liu
Copy link
Contributor Author

我自己用緊weasel 0.15.0.0,librime 1.11.2;頭先將patch發佈喺 https://github.com/russell-liu/rime-cantonese/tree/emoji-simplified-tips ,跟住再改埋個方案名發佈喺 https://github.com/russell-liu/rime-cantonese/tree/emoji-simplified-tips-renamed ,用 https://my-rime.vercel.app 測試咗(選擇Micro Plum,然後Schema URL填https://github.com/russell-liu/rime-cantonese/blob/emoji-simplified-tips-renamed/jyut6ping3_renamed.schema.yaml;唔改名嘅話會同default粵拼撞名而見唔到改動)。My RIME上面都work;應該係用緊呢個版本嘅librime: https://github.com/rime/librime/tree/f6dd30059e78bfbf6d48788ef35daea8f5806e1d (1.11.2同1.12.0之間)。唔知你用緊咩版本?

@russell-liu
Copy link
Contributor Author

你好,请问你觉得呢个issue仲使唔使开住?我见jyut6ping3最近改咗用emoji_cantonese,不过显唔显示提示嘅问题应该同用emoji定emoji_cantonese无关。但其实我觉得上面我𠮶个按繁简体显示提示嘅patch唔系一个适宜嘅解决方法,所以都唔系好需要考虑啦。

顺带一提,呢个repo嘅wiki入面嘅安装教程系咪都应该改为用emoji_cantonese而非emoji?

@laubonghaudoi
Copy link
Member

@bingzheung 唔知你嗰個emoji有冇解決呢個問題

@bingzheung
Copy link
Collaborator

@bingzheung 唔知你嗰個emoji有冇解決呢個問題

用呢度提到嘅方法一,熄咗提示。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants