-
Notifications
You must be signed in to change notification settings - Fork 563
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(rime_api): add RimeApi::set_input #771
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a special case covered by set_input
. There is no point to add this function
类中文九宫格输入方案,需要替换用户输入的模糊串。比如输入“426 23”,可以是 “hao de”, 也可以是 “gan de”。 此时需要一个api 替换其中已经输入的串。具体见 issue #547 |
这个和set_input的区别在于部分替换吗?那完全可以自己外部实现
|
您好,我对 rime 不了解, 另外。如您说的 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看起来问题的症结不在缺一个replace的功能,而是set_input没有导出rime api。能否去掉replace_input
和RimeReplaceInput
,而是实现一个RimeSetInput
?
那我重新修改下,只导出 |
set_input没有导出,我个人认为添加导出就够了,set_input应该能满足replace的需求 |
我个人非常赞同,九宫格方案确实需要这个接口 |
好的,我重新修改后,在提交。 |
九宮格選擇拼音僅僅替換輸入碼還不夠。需要同時添加輔助切分音節的信息。 |
基于rime ios粤语输入法写了个插件,主线如果暂时不收,你可以看下那个 |
仓输入法已经使用之前 |
目前是通过模糊输入+精确替换来实现的。 模糊输入使用数字穷举了全部的拼音组合。这部分也在九宫格的输入方案中进行了配置。 前端内置的也有穷举后的拼音组合。候选拼音可通过 目前测试一切正常。 |
https://github.com/Cantoboard/librime-cantoboard.git 他们是做了个插件,像gram和lua一样 |
收到,感谢 |
替換拼音串無法解決已經經過用戶確認的拼音音節被再次切分的問題。 我有完整的解決方案,但還需要一段時間把代碼寫出來。你先用臨時的方法頂着。 |
你需要注意C String是null terminated的,而且utf8是可變長度,隨意替換容易產生非法字符導致rime崩潰,然而最終使用的新分配的內存字節數甚至是一樣的,代碼反而更繁瑣 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pull request
新增 api 用于调整用户已输入的字符。
Issue tracker
Feature
resolve #547
Unit test
Manual test
Code Review
Additional Info