Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: chareset_filter always allow emoji #213

Closed
wants to merge 1 commit into from

Conversation

alswl
Copy link
Contributor

@alswl alswl commented Jul 5, 2018

#59
即便选择 GBK 字符集时候,始终允许 Emoji 出现。

Emoji 数据源来自于:https://github.com/rhdunn/espeak/blob/master/dictsource/en_emoji

@lotem lotem requested a review from osfans July 5, 2018 04:47
@osfans
Copy link
Contributor

osfans commented Jul 5, 2018

感覺有點問題。
在選擇GBK的條件下,
只要有一個字符是emoji,就會顯示了?
是不是應該檢查所有字符都必須是GBK或者emoji?

@osfans
Copy link
Contributor

osfans commented Jul 5, 2018

另外emoji要不要單獨搞個開關?
unicode程序中可以顯示emoji,但是gb2312的txt應該無法顯示emoji。

@osfans
Copy link
Contributor

osfans commented Jul 5, 2018

還有個問題,symbols.yaml中的符號要不要始終顯示?

@alswl
Copy link
Contributor Author

alswl commented Jul 5, 2018

  • 第一个问题是存在的,我再处理一下,保证完全都是 emoji 才认为 text 是 emoji。
  • 第二个问题
    • 赞同加开关,不过我对 librime 代码不够熟悉,暂时没有能力,不知道 osfans 能否代为实现。
      PS,我觉得比较好的形式是 charset_filter@gbk+emoji 这样,不用单独再 开一个 Option
    • 我目前需要使用的场景就是在 GBK / GB2312 允许使用 Emoji。
      是否正常显示和字体相关,和字符集无关。字符集仅仅用来筛选候选字,使用 GB2312 可以避免大量生僻字。
    • 如果相对 symbols.yaml 特别处理,可以考虑使用 charset_filter@gbk+emoji+symbols

@lotem
Copy link
Member

lotem commented Jul 9, 2018

我没有更好的实现,所以纯粹发表一些看法:
GBK 开关的含义很明确,是仅输出 GBK 字符集内的字符。
有例外,未免名不副实,例外多了,不好懂也记不住。
所以最好不要例外。仅当需要限定 GBK 字符集时才用这个过滤器。
当然啦,字符集能组合更好。

具体到这个 PR,GBK 和 emoji 并不存在代码改动所反映的联系,所以这个实现是讲不出道理的。

@alswl
Copy link
Contributor Author

alswl commented Jul 9, 2018

@lotem 如果使用 "charset_filter@gbk+emoji" 这样的过滤方式觉得如何呢?

@lotem
Copy link
Member

lotem commented Dec 17, 2018

Given that the current architecture doesn't support merging results from two filters, specifying multiple character sets like charset_filter@gbk+emoji seems to be the best option.

@lotem
Copy link
Member

lotem commented Jan 14, 2019

我覺得 charset_filter 正確的實現應該能準確定位需要過濾的編碼段,即「集外漢字」。
@osfans 可以考慮一下這個思路。

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

Successfully merging this pull request may close these issues.

None yet

3 participants