Tag Archives: fcitx

用拼音输入 Emoji

从技术上来说,没有什么难的,就是挂一个额外的词库。唯一难的就是词库从哪来的问题。因为开源软件总是绕不开一个 License 的问题。 从哪来这件事,Unicode 的 CLDR 提供了一个数据来源,根据语言给不同的颜文字标注了各个语言的文字。所以 Emoji 到汉字的映射就是可以从这里来了。到这里,我们其实可以选择直接像实现笔画输入或者英文输入那样直接匹配插入,但是这样当然会带来一个问题,就是很难把输入的词汇频率和这种外部挂接的候选词组合起来。另一方面,也就无法让句子中混合输入 Emoji 和汉字。所以这里就必须把 Emoji 做成一个从拼音映射过去的词库。然而,如果简单的使用 CLDR 的标记的话,就势必会出现类似现在某个挂载了 Emoji 的 Rime 一样,一个词无数个 Emoji 候选。所以还需要小心的对这些数据进行过滤。所以这部分主要就是我手工来进行修改的,总之有以下几个原则。 1、单个 Emoji 不要对应太多不同的意思,避免“联想”含义的意思。2、避免动词,例如有个🪓的Emoji,在数据里面还有“砍”这样的数据。3、避免单字对应。出于拼音输入的特殊性,如果单字对应 Emoji 过多,可能会影响正常输入。4、避免某个读音有大量的 Emoji 对应。5、避免同一个Emoji的对应汉字互相包含。例如摩托和摩托车都对应了🏍,但是如果它们同时出现在数据中,对于用户来说是无法区分🏍是对应了摩托两个字还是摩托车这三个字的拼音,所以要避免这样的情况发生。 虽然这样有不小的手工工作量,但是为了输入效果应该来说是值得做的。 示例:

Posted in fcitx development | Tagged , | Leave a comment

纯粹不吐不快

更新:好吧原文作者说是 “gnome control center”。 后文可以略过了。 http://forum.ubuntu.org.cn/viewtopic.php?t=486270&p=3200398#p3200398 下面是原文 其余内容不论,我们单说第一句:「前一阵子 Ubuntu 的预设输入系统从 IBus 改为 Fcitx,但因后者不支持 gcc,搞得天下大乱,于是 Ubuntu 17.10 又换回 Ibus 了。 LZ 建议把 ibus 删除掉换成 fcitx,并不见得问题就消失了。」 不支持 gcc???黑人问号??? 其一、世界上绝大多数发行版,包括 ubuntu 都是默认 gcc 编译器。debian 的迁移到 clang 的进程虽然一直有提但是绝对还没有完成,而且也只是测试是否「可以编译」,作为 debian 下游的 ubuntu 也显然还没有迁移到非 gcc 编译器。打包 … Continue reading

Posted in fcitx development | Tagged | Leave a comment

The Road to Fcitx 5: 5. Good news for people who use multiple display server

A big refactor in fcitx 5 is to enable it to support for multiple display server. This is not limited to X11 + wayland, but it means you can use fcitx with multiple X11 server. While such functionality may have … Continue reading

Posted in fcitx development | Tagged , , | Leave a comment

Road to Fcitx 5: 4. Compatibility for different im modules.

I have been always care about the compatibility. Fcitx 5 will be able to type with either fcitx 4’s im module, or fcitx 5’s im module. Fcitx 5’s im module will announce itself to accept both “fcitx5” and “fcitx”. Even … Continue reading

Posted in fcitx development | Tagged , | Leave a comment

A case study: how to compile a Fcitx platforminputcontext plugin for a proprietary software that uses Qt 5

Due to the fact, that Qt 5 does not support XIM, the only way to type with fcitx under Qt is to use platforminputcontext plugin. The problem is that for some proprietary software like mathematica, it is impossible to use … Continue reading

Posted in fcitx development | Tagged , , | 1 Comment