rime / rime-emoji Goto Github PK
View Code? Open in Web Editor NEWEmoji / 繪文字輸入方案
License: GNU Lesser General Public License v3.0
Emoji / 繪文字輸入方案
License: GNU Lesser General Public License v3.0
rime-emoji/opencc/emoji_word.txt
Line 5420 in 5e34d22
“尔”与“尓”
如題,很早添加的 emoji 現在不想再要。macOS 10.14.5,Squirrel 0.11.0 但配置是從 0.9.20 繼承來的。
另外 Deploy 一直報錯,去 $TMPDIR 裏看 log 也提示替身找不到原身,‘ERROR’、‘INFO’、和 ‘WARNING’ 都這麼提示。所以順便也提一下這個 issue……
空格作为分割符了,请问有办法写入一些含有空格的词句吗?
这个repo似乎没有wiki,故权且在这里记一笔,兴许能帮到一两个人。
我没有安装東風破,而是使用比较简单的小狼毫自带的管理界面。
下载本repo压缩包,假设下载路径为D:\Download\rime-emoji-master.zip
右键图标,进入 方案選單設定
D:\Download\rime-emoji-master.zip
emoji_suggestion.yaml
,将其中的内容复制到想要添加emoji输入的输入法自定义文件中。以luna_pinyin_simp.custom.yaml
为例,复制完成的效果如下:patch:
punctuator/full_shape:
"\\" : "、"
#以上是本人自定义部分,与本repo无关
switches/@next:
name: emoji_suggestion
reset: 1
states: [ "🈚️️\uFE0E", "🈶️️\uFE0F" ]
'engine/filters/@before 0':
simplifier@emoji_suggestion
emoji_suggestion:
opencc_config: emoji.json
option_name: emoji_suggestion
tips: all
此时,如果不出意外,你应该能在正常输入时看到emoji候选。
# luna_pinyin_simp.custom.yaml
patch:
# 指定自定义词库位置
"translator/dictionary": luna_pinyin.my
# 标点符号全英文
"punctuator/import_preset": alternative
# emoji的使用
switches/@next:
name: emoji_suggestion
reset: 1
states: [ "🈚️️\uFE0E", "🈶️️\uFE0F" ]
'engine/filters/@before 0':
simplifier@emoji_suggestion
emoji_suggestion:
opencc_config: emoji.json
option_name: emoji_suggestion
tips: all
另外的文件都复制过来了,opencc的也是,但是还是一样,切换的时候找不到这个emoji_suggestion
将emoji应用到明月拼音,使用明月拼音简化字,表情的suggestion是繁体字,请问如何显示简体字,我看emoji_word.txt和emoji_category.txt中繁体字和简体字是都有的。
例如,“花”,“饭”,这些一个字对应很多很多 emoji 表情的时候,这个问题尤为明显,已被多次反馈
使用命令安裝在custom檔內增加了
__patch:
# Rx: emoji:customize:schema {
- patch/+:
__include: emoji_suggestion:/patch
# }
經test無效
之後又註釋掉這一段,通過手動安裝將schema檔修改成了
switches:
...
- name: emoji_suggestion
reset: 1
states: [ "🈚️️\uFE0E", "🈶️️\uFE0F" ]
...
engine:
...
filters:
- simplifier@emoji_suggestion
- simplifier
- uniquifier
...
emoji_suggestion:
option_name: emoji_suggestion
opencc_config: emoji.json
tips: all
opencc內的文件也都複製了,但方案中只有switches這裏有效,無法打出任何emoji
schema是內置的基於朙月拼音的自然碼雙拼
rime-emoji/opencc/emoji_word.txt
Line 1755 in 4806104
其中第一个(中间图案像盾牌的)应该是安道尔的国旗,第二个(中间图案像鸟类的)才是摩尔多瓦的国旗
bash rime-install emoji:customize:schema=terra_pinyin
安装成功后重新部署成功,但候选词中没有出现emoji。
# terra_pinyin.custom.yaml
patch:
switches: # 注意縮進
- name: ascii_mode
reset: 0 # reset 0 的作用是當從其他輸入方案切換到本方案時,
states: [ 中文, 西文 ] # 重設爲指定的狀態,而不保留在前一個方案中設定的狀態。
- name: full_shape # 選擇輸入方案後通常需要立即輸入中文,故重設 ascii_mode = 0;
states: [ 半角, 全角 ] # 而全/半角則可沿用之前方案中的用法。
- name: simplification
reset: 1 # 增加這一行:默認啓用「繁→簡」轉換。
states: [ 漢字, 汉字 ]
__patch:
# Rx: emoji:customize:schema=terra_pinyin {
- patch/+:
__include: emoji_suggestion:/patch
# }
此外,我还尝试了朙月拼音,似乎也没有效果。
google了半天实在找不到使用东风破安装emoji的其他案例,无奈来此提交Issues,万望指点。
我在方案配置文件里打开了 gbk 过滤
engine/filters:
- simplifier
- uniquifier
- charset_filter@gbk
然后 emoji 就失效了
由于这个方案将中文候选词翻译成 emoji,一旦某个 emoji 对应的词并不存在用户词库(比如刚安装的极光拼音是没有 笑哭
这个词的),就没办法提示相关的 emoji。我想到的一个解决方案是生成一个和 emoji 的 opencc 列表对应的 RIME 词典,这样有需要的用户可以通过自己编写扩充词库导入 emoji 词典保证输入法能够生成相关的词组。
由于已有的 emoji 列表比较长,词典需要把这些汉字翻译成对应的拼音,可能需要比较多的工作,不过也许可以利用一些现有的汉字转拼音的库处理一遍,然后慢慢查缺补漏,不知道是否可行。
比如github的解析这样:joy:
打出:joy:
官方提供的文件把中文映射emoji了,我个人觉得用英文稍微方便点
还有 fcitx的码表好像在rime不管用耶
rime-emoji版本:安装于2019年4月
rime版本:0.11
macOS版本:14.04
iTerm2版本:3.2.9
zsh版本:5.7.1
实际的效果:以草莓为例,其他表情均存在问题。终端下的emoji输入后会有个<fe0f>
的标记,显示为🍓️<fe0f>
。见下图。
预期的效果:当输入草莓的emoji时,没有<fe0f>
,只显示🍓️
测试的终端:iTerm2 Mac系统自带的终端 Hyper等
这些终端下的表现:
🍓️
,按删除键,可以删除删除,如果再按删除键可以删除掉命令行的提示符。换输入法测试:使用系统自带的输入法、搜狗输入法、Mac系统内置的插入表情符号工具。表现均和预期一样。
目前用的是五笔拼音输入法,大多数表情都能打出来, 但是个几个却无法显示(比如:调皮(ymhc
或tiaopi
)🤪等)。
但是打切(av)
能出来🤪,在五笔和依赖的拼音词库都有调皮
这个词。
可能的原因有哪些?
I'm using ibus-rime on ubuntu 20.04, which was installed by compiling source.
I've installed emoji with plum, and it works smoothly. I greatly appreciate it!
Now I have set the default option as "0", then the emoji suggestions does not show as I expect. I want to set up a shortcut to change the option to "1", and have setup in the schema:
patch:
'key_binder/bindings': # This does not work as I expect?
- { when: always, accept: Control+Shift+9, toggle: emoji_suggestion }
- { when: always, accept: Control+Shift+(, toggle: emoji_suggestion }
However, it does not work, and I cannot see emoji suggestions.
其实问题很简单#32号里已经提了,可问题没解决就无缘无故的关闭了
我再说一下,自动安装方式和手动复制的方式都试过,完全参照说明文的进行操作,可就是出不来,很郁闷
现在我放上我的完整的double_pinyin.custom.yaml配置文件,希望能破了这个案:
# Rime schema
# encoding: utf-8
patch:
# 开启自动造词相关设置
translator/enable_completion: true # 开启逐键提示
translator/enable_sentence: true # 关闭句子输入
translator/enable_user_dict: true # 是否开启用户词典(记录词频,用户词)
translator/enable_encoder: true # 自动造词
translator/encode_commit_history: true # 是否对已上屏的词自动造词
translator/preedit_format: [] # 输入双拼码的时候不转化为全拼码
translator/dictionary: mine
punctuator/import_preset: mysymbols
recognizer/patterns/punct: "^\\\\([A-Z|a-z]*|[0-9]|10)$"
engine/translators:
- punct_translator
- reverse_lookup_translator
- script_translator
- table_translator@english
- table_translator@custom_phrase #表示调用 custom_phrase段编码
- table_translator
custom_phrase:
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
enable_completion: true
enable_sentence: true
initial_quality: 1
switches/@next:
name: emoji_suggestion
reset: 1
states: [ "🈚︎", "🈶️" ]
'engine/filters/@before 0':
simplifier@emoji_suggestion
emoji_suggestion:
opencc_config: emoji.json
option_name: emoji_suggestion
tips: none
inherit_comment: false
schema:
schema_id: double_pinyin
name: 自然碼雙拼
version: "0.15"
author:
- 佛振 <[email protected]>
description: |
朙月拼音+自然碼雙拼方案。
dependencies:
- stroke
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: simplification
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
- script_translator
filters:
- simplifier
- uniquifier
speller:
alphabet: zyxwvutsrqponmlkjihgfedcba
delimiter: " '"
algebra:
- erase/^xx$/
- derive/^([jqxy])u$/$1v/
- derive/^([aoe])([ioun])$/$1$1$2/
- xform/^([aoe])(ng)?$/$1$1$2/
- xform/iu$/Q/
- xform/[iu]a$/W/
- xform/[uv]an$/R/
- xform/[uv]e$/T/
- xform/ing$|uai$/Y/
- xform/^sh/U/
- xform/^ch/I/
- xform/^zh/V/
- xform/uo$/O/
- xform/[uv]n$/P/
- xform/i?ong$/S/
- xform/[iu]ang$/D/
- xform/(.)en$/$1F/
- xform/(.)eng$/$1G/
- xform/(.)ang$/$1H/
- xform/ian$/M/
- xform/(.)an$/$1J/
- xform/iao$/C/
- xform/(.)ao$/$1K/
- xform/(.)ai$/$1L/
- xform/(.)ei$/$1Z/
- xform/ie$/X/
- xform/ui$/V/
- xform/(.)ou$/$1B/
- xform/in$/N/
- xlit/QWRTYUIOPSDFGHMJCKLZXVBN/qwrtyuiopsdfghmjcklzxvbn/
#- abbrev/^(.).+$/$1/
translator:
dictionary: luna_pinyin
prism: double_pinyin
preedit_format:
- xform/([bpmnljqxy])n/$1in/
- xform/(\w)g/$1eng/
- xform/(\w)q/$1iu/
- xform/([gkhvuirzcs])w/$1ua/
- xform/(\w)w/$1ia/
- xform/([dtnlgkhjqxyvuirzcs])r/$1uan/
- xform/(\w)t/$1ve/
- xform/([gkhvuirzcs])y/$1uai/
- xform/(\w)y/$1ing/
- xform/([dtnlgkhvuirzcs])o/$1uo/
- xform/(\w)p/$1un/
- xform/([jqx])s/$1iong/
- xform/(\w)s/$1ong/
- xform/([jqxnl])d/$1iang/
- xform/(\w)d/$1uang/
- xform/(\w)f/$1en/
- xform/(\w)h/$1ang/
- xform/(\w)j/$1an/
- xform/(\w)k/$1ao/
- xform/(\w)l/$1ai/
- xform/(\w)z/$1ei/
- xform/(\w)x/$1ie/
- xform/(\w)c/$1iao/
- xform/([dtgkhvuirzcs])v/$1ui/
- xform/(\w)b/$1ou/
- xform/(\w)m/$1ian/
- xform/([aoe])\1(\w)/$1$2/
- "xform/(^|[ '])v/$1zh/"
- "xform/(^|[ '])i/$1ch/"
- "xform/(^|[ '])u/$1sh/"
- xform/([jqxy])v/$1u/
- xform/([nl])v/$1ü/
reverse_lookup:
dictionary: stroke
enable_completion: true
prefix: "`"
suffix: "'"
tips: 〔筆畫〕
preedit_format:
- xlit/hspnz/一丨丿丶乙/
comment_format:
- xform/([nl])v/$1ü/
punctuator:
import_preset: default
key_binder:
import_preset: default
recognizer:
import_preset: default
patterns:
reverse_lookup: "`[a-z]*'?$"
bash rime-install emoji:customize:schema=luna_pinyin_simp
以上方式安装之后,会生成 luna_pinyin_simp.custom.yaml
配置文件,内容为
__patch:
# Rx: emoji:customize:schema=luna_pinyin_simp {
- patch/+:
__include: emoji_suggestion:/patch
# }
重新部署之后实际上并未生效。
将 luna_pinyin_simp.custom.yaml
手动方式修改为 emoji_suggestion.yaml
的内容再重新部署即可生效。
看起来像是 rime 引擎解析配置的问题,不支持 patch 引用方式,但是不知道该怎么解决。
环境是Ubuntu 18.04,fcitx-rime,librime 1.2.9,opencc 1.0.4
请问可能是哪里出现了问题?
windows 下,安装 Rime 以后, plum 的安装目录在 %appdata%/plum
下,目录下有 rime-install.bat
文件,按照 这里 给出的第二种方式,直接运行下面的命令安装 emoji,
rime-install emoji
或者使用
rime-install.bat emoji
输出的相同的错误信息:
Rime package installer
Working directory: C:\Users\Administrator\AppData\Roaming\plum
Package installer directory: C:\Users\Administrator\AppData\Roaming\plum\
Download cache directory: C:\Users\ADMINI~1\AppData\Local\Temp
Rime user directory: C:\Users\Administrator\AppData\Roaming\Rime
rime-install: line 2: $'\r': command not found
rime-install: line 53: syntax error near unexpected token `$'do\r''
'ime-install: line 53: `for target in "${targets[@]}"; do
必须在 bash 环境下安装 package 才能成功,需要安装 git-for-windows。安装以后,cd 到 plum 所在的目录,首先运行以下命令安装 emoji,
bash rime-install emoji
然后,试用下面的命令给输入方案打 patch,我使用的输入方案是 luna_pinyin_simp,所以参考这里的命令:
bash rime-install emoji:customize:schema=luna_pinyin_simp
这样才会 patch 成功,这时,位于 %appdata%/rime
目录下的 luna_pinyin_simp.custom.yaml
文件中会增加以下配置:
__patch:
# Rx: emoji:customize:schema=luna_pinyin_simp {
- patch/+:
__include: emoji_suggestion:/patch
# }
然后重新部署,emoji 添加成功。
按字典釋義:
小醜:稱小人、盜匪等
小丑:戲劇中的丑角等
Squirrel安装完没有export rime-install环境变量,所以这个rime-install是在哪个目录里的?
Installing: emoji_suggestion.yaml
Creating directory: /home/roach/.config/ibus/rime/opencc
Installing: opencc/emoji_category.txt
Installing: opencc/emoji.json
Installing: opencc/emoji_word.txt
Updated ~ 4 files from 1 packages in '/home/roach/.config/ibus/rime'
Can't fine file with emoji
prefix under directory /home/roach/.config/fcitx/rime.
And as I install fctix-rime is there a way to not install all these yaml relate to ibus?
Such as kaixin
: ^_^
, ^ω^
?
如「動物」詞條下的「蜘蛛」在碼表裏只有 0x1f577,實際上根據 emoji 的標準,編碼應該是 0x1f577 0xfe0f。
參考:https://unicode.org/Public/emoji/13.0/emoji-sequences.txt
I have found that in previous version, one can input emoji use their English name. Which is defined in dictionary file.
I understand that rime is focused on providing Chinese input, but inputing emoji by shortcode is a thing in many softwares that we use everyday. Including Slack, Twitter, or Telegram.
使用 OpenCC 中的 t2s.json
, hk2s.json
, tw2s.json
都不能将其转换为「鼓」,这是否意味着「鼔」字并非 OpenCC、香港、**之标准?或者意味着应在 OpenCC 中加入这个字的转换?
感谢!
opencc升级到1.1.2之后,rime-emoji失效。重新安装opencc-1.1.1之后,恢复正常。
系统:Arch Linux
有时候我想输入某个表情符,但是根据输入建议找不到,比如我想输入笑的两眼飙泪的表情:😂,我输入“笑死”,建议的是“🤣”,是一个脑袋斜着的表情,虽说意思相近,但并不是我要找的。我尝试用别的词语,比如“笑”、“笑哭”、“哈哈哈哈”等都没找到我要的符号,所以我在想,是不是应该有办法直接打开emoji面板,专门搜索和选择emoji,以方便输入呢。
C-n
C-n
bash rime-install emoji:customize:schema=luna_pinyin
在 `luna_pinyin.custom.yaml 中添加了下内容:
# Rx: emoji:customize:schema=luna_pinyin {
- patch/+:
__include: emoji_suggestion:/patch
# }
部署出错:
E0908 22:11:39.110625 207474688 config_compiler.cc:428] resource could not be loaded: emoji_suggestion
E0908 22:11:39.110667 207474688 config_compiler.cc:536] unresolved dependency: Include(emoji_suggestion:/patch)
E0908 22:11:39.110707 207474688 config_compiler.cc:536] unresolved dependency: PendingChild(luna_pinyin.custom:/__patch/@1/patch/+)
E0908 22:11:39.110746 207474688 config_compiler.cc:536] unresolved dependency: PendingChild(luna_pinyin.custom:/__patch/@1)
E0908 22:11:39.110786 207474688 config_compiler.cc:536] unresolved dependency: PendingChild(luna_pinyin.custom:/__patch)
观察到自动安装并未复制 opencc 文件夹,于是手动复制,重新依然部署失败。
$ cp -r rime-emoji/opencc ~/Library/Rime/
$ cat<<EOF>~/Library/Rime/luna_pinyin.schema.custom.yaml
# encoding: utf-8
patch:
switches/@next:
name: emoji_suggestion
reset: 1
states: [ "🈚️️\uFE0E", "🈶️️\uFE0F" ]
'engine/filters/@before 0':
simplifier@emoji_suggestion
emoji_suggestion:
opencc_config: emoji.json
option_name: emoji_suggestion
tips: all
EOF
部署成功,但仍然无效。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.