rime / librime Goto Github PK
View Code? Open in Web Editor NEWRime Input Method Engine, the core library
Home Page: https://rime.im
License: BSD 3-Clause "New" or "Revised" License
Rime Input Method Engine, the core library
Home Page: https://rime.im
License: BSD 3-Clause "New" or "Revised" License
搞不定了,老大幫忙。
log2出來了,log3沒有,卡在 translators_.clear()
這裏。然後再往哪裏跟蹤呢?
diff --git a/src/engine.cc b/src/engine.cc
index 25f07dc..b4a3017 100644
--- a/src/engine.cc
+++ b/src/engine.cc
@@ -88,8 +88,11 @@ ConcreteEngine::ConcreteEngine() {
ConcreteEngine::~ConcreteEngine() {
LOG(INFO) << "engine disposed.";
processors_.clear();
+ LOG(INFO) << "engine disposed1.";
segmentors_.clear();
+ LOG(INFO) << "engine disposed2.";
translators_.clear();
+ LOG(INFO) << "engine disposed3.";
}
提起鼠须管,很多人都会说’词库小‘,然后导入外部的词库,可是这样也引入了更多的重码。打不出词组的时候苦恼,打出太多词组也是负担。即使这样,也没有改善单字重码的问题,反而更加剧了。倒不如一个基本的词库,加上’以词定字‘功能。
/pkg/librime/src/gear/simplifier.cc: In member function 「bool rime::Opencc::ConvertSingleCharacter(const string&, std::vectorstd::basic_string)」:
/pkg/librime/src/gear/simplifier.cc:52:39: 錯誤:「const class opencc::DictEntry」 沒具名為 「Values」 的成員
for (const char value : entry->Values()) {
^
src/CMakeFiles/rime.dir/build.make:1253: recipe for target 'src/CMakeFiles/rime.dir/gear/simplifier.cc.o' failed
make[2]: *** [src/CMakeFiles/rime.dir/gear/simplifier.cc.o] Error 1
CMakeFiles/Makefile2:109: recipe for target 'src/CMakeFiles/rime.dir/all' failed
make[1]: *** [src/CMakeFiles/rime.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2
編譯器是gcc 4.8.3,opencc 1.0.1
Need to reactor menu and the filter interface.
如题。现在的小狼毫的空格在空编码状态下的作用是直接将编码上屏。这样,小狼毫也就默认此时用户的行为是要输入英文字符的处理的。
但是个人感觉,小狼毫不应该将在空编码状态下的空码直接理解为上屏输入处理。一来,对于输入法来说,特是对于形码来说,在存在空编码时,在严格匹配中,就不会出现正确的候选。此时用户希望的是将这一无用的编码清除掉,而非将这一空编码上屏。而空格相比esc肯定最近,使用空格将空编码清除掉,无疑是首选。
二来,小狼毫毕竟是中文输入法。人们习惯了当输入英文时,特别是长段英文,首先绝对不是在一个中文输入环境中完成的,而是首先将输入环境预设为英文尔后,才进行输入的。而通过挂只包含常用的英文码表时,已经可以完成使命。
第三点,是重要的。拿具体的码表来说,如拼音。当随便输入一个空统码时zhoumover,空格一下,将编码上屏。然而,这样的周末ver,上屏后有什么用的呢。根本就不是英文。我承认,有可能有这种的情况:空编码是某个单词。但这样的情况又有多少呢?
Hi,
I can see the tags of this project are just a load of mess, can you retag all this tags with proper version?
e.g. 1.0, 1.1
or v1.0, v1.1
Instead of weasel-0.9.21, squirrel-0.9.16, these will not only confuse the tracking system but also confuse some of those end users, what exactly is the version?
Thanks.
在一份方言码表中收录了下列两个字及其读音,并且配置了普通话(汉语拼音)反查。
# X.dict.yaml
丑 tiu
醜 ciu
在繁体字模式下,反查chou
,可以查到两个字音。
`chou>
1. 丑 tiu
2. 醜 ciu
但在简化字模式下,反查chou
,只能查到一个字音,另一个字音似乎在繁转简、去重的过程中丢失了。
`chou>
1. 丑 tiu
请问有没有可能实现这种效果:字形去重,但保留、合并字音?
`chou>
1. 丑 tiu ciu
這個API在觸屏上很有用,哈哈。
如果不改也不錯,可以從所有候選中選擇。
//! select a candidate from current page
Bool (*select_candidate)(RimeSessionId session_id, size_t index);
Bool RimeSelectCandidate(RimeSessionId session_id, size_t index) {
rime::shared_ptr<rime::Session> session(rime::Service::instance().GetSession(session_id));
if (!session)
return False;
rime::Context *ctx = session->context();
if (!ctx)
return False;
return Bool(ctx->Select(index));
}
bool Selector::SelectCandidateAt(Context* ctx, int index) {
Composition& comp = ctx->composition();
if (comp.empty())
return false;
int page_size = engine_->schema()->page_size();
if (index >= page_size)
return false;
int selected_index = comp.back().selected_index;
int page_start = (selected_index / page_size) * page_size;
return ctx->Select(page_start + index);
}
比如输入“大”后,可以有相关的候选词出现,“大家”,“大多”,“大多数”之类的候选
大部分输入法都支持此功能,如果rime也能开放相关接口就好了。
要不要push一個上去?最近的是1.2,獲取版本不方便。
librime % git describe --tags
rime-1.2-143-g90ddec9
切換方案之後,需要手動再設定一次?
最近嘗試做一個方便鍵入Emoji的方案,想到用OpenCC會很好,因爲基於漢字的轉換可以適用於任意輸入方案,能夠做出一個通用方案。
但是在實際使用過程中發現OpenCC不支持詞組的一對多映射。
在把漢字轉換成Emoji時,漢字必須得到保留,否則將無法正常鍵入中文,所以所有的映射都是一對多。單字一對多沒有問題,但是遇到詞就不行了。Emoji數量非常多,用單字很難描述,更有大量國旗之類,詞組一對多在所難免。
現在各大輸入法都帶上了Emoji聯想功能,十分希望Rime也能有優秀的Emoji鍵入體驗。
@BYVoid
@wengxt told me I should report this issue here (https://github.com/fcitx/fcitx-rime/issues/18)
My request is by using radical in pinyin input to let a specific character be located a little bit faster.
e.g. hao (蒿),after inputting [h][a][o], then I can trigger a key([tab]/[`] whatever) continue with [c](草)and [g](高)to locate it.
After I installed the library, I run make
and get the following error.
make[3]: *** [src/CMakeFiles/rime.dir/setup.cc.o] Error 1
make[3]: Leaving directory /home/jack/Desktop/github/librime/build' make[2]: *** [src/CMakeFiles/rime.dir/all] Error 2 make[2]: Leaving directory
/home/jack/Desktop/github/librime/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/jack/Desktop/github/librime/build'
make: *** [librime] Error 2
http://tieba.baidu.com/p/2713677519
多種日期、時間、星期格式:農曆、干支
當前時間、指定時間
可使用translator或者組合鍵輸入
由于经常需要写中文 LaTeX 文档或者带公式的 Markdown 文档,中英文切换非常烦人。一直想做一个能够做到中英文自动切换的输入法,简单扫了一下 Rime 的文档之后没有看到相关的介绍,在这里问一下吧。
最基本的要求其实非常简单,比如输入 "$" 符号或者 "$$" 自动开启英文模式(甚至开启 LaTeX 补全),然后再次输入 "$“ 符号等切换到正常模式就可以了。
我还想在这个思路上做一点扩展,自动识别输入的是拼音还是单词,实现自动中英文切换。需要混合输入中英文时语言切换太痛苦了。当然这个功能的实现估计要放弃中文简拼。
临时不方便输入繁体中文,望见谅!
目前只有通過extended_charset
過濾擴展字符集吧?
https://github.com/rime/librime/blob/develop/src/gear/charset_filter.cc#L18
Boost.Locale 庫是否可以過濾gbk、big5等標準字符集?
甚至自定義字符集https://github.com/rime-aca/character_set
librime无法用Visual Studio 2015编译,会生成大量错误,我会在还原错误后贴出。
希望能够增加对Visual Studio 2015的支持。
这样的话编译有问题能被尽早发现。顺便 @osfans
目前的版本中第47行:
cd %BOOST_ROOT%
我clone后的代码是存放在E盘的,而我下的boost的代码,我是解压到T盘的,
所以在指定到T盘的路径后, 这个bat中的cd %BOOST_ROOT%
并不能切换到 bjam.exe
所在的目录, 后来我把clone后的代码也复制到T盘了一份,才ok了.
是个小问题.
windows版在魔兽世界3内无法使用,输入框闪出而后不见,能盲输入,即不看选词框直接选词。
schema list的有接口,但是switches好像沒有。
那就自己發個“F4”、再發個“2”的keyevent?
目前,五筆有「加入自造詞的同時,固定原來的字詞順序的解法 #9」但不是真正的固有功能,而是一種「技巧」。
建議拼音方案在動態不調頻情況下,但可記憶新詞,新詞排列在設定的位置。
I/dict_compiler.cc:44 dict name: luna_pinyin
I/dict_compiler.cc:45 dict version: 0.12.20120711
I/table.cc:318 loading table file: .\luna_pinyin.table.bin
fixme:ntdll:NtQuerySection (0x80,0,0x92b978,0x00000010,(nil)) stub!
terminate called after throwing an instance of 'boost::interprocess::interprocess_exception'
what(): boost::interprocess_exception::library_error
abnormal program termination
terminate called recursively
abnormal program termination
對於雙拼的使用者「簡拼」是無效的,增加「長詞聯想」能快速輸入。
since v1 api is used in develop branch and it's not ABI compatible.
想问一下,调用librime中的接口,sessionid获取到了,为什么得不到候选字?不能够调试啊
類似於字典的功能。
輸入法中,可以查詢光標處或者剪貼板中漢字的編碼。
reverse.bin應該可以用來實現這個功能吧?
软件环境:
Windows 7 64bit
RIME小狼毫0.9.30输入法 http://rime.im/
FireFox 45 浏览器 http://www.firefox.com.cn/
bilibili弹幕视频网 http://www.bilibili.com/
问题描述及期待解决方案:
使用其他输入法(搜狗、百度、qq等)都可以在bilibili网站的视频下发中文,但是RIME打不出中文,我用的是简体字(具体忘记叫什么了)。
希望可以能够支持bilibili的弹幕框发中文。
想speller/max_code_length: 4
或者speller/auto_select_pattern : .{4}
時,四碼爲空不上屏。
舉例如下:
auto_select: true
码表:
苗 al
蘲 allf
虆 alli
藟 alll
蘽 alls
輸入allc
時,會自動上al
的苗。原因是四碼爲空,AutoSelectPreviousMatch
會選到al
。
Hi, opencc 发布了 1.0.1 版本, soname 有所变动: libopencc.so.1
=> libopencc.so.2
. 编译 rime 1.2 时出现了如下错误, 应该与相应 API 变化有关, 希望 librime 能兼容新版 opencc.
[ 65%] Building CXX object src/CMakeFiles/rime.dir/gear/simplifier.cc.o
/build/librime/src/librime-rime-1.2/src/gear/simplifier.cc: In member function 'bool rime::Opencc::ConvertText(const string&, std::string*, bool*)':
/build/librime/src/librime-rime-1.2/src/gear/simplifier.cc:71:37: error: 'OPENCC_CONVERSION_LIST_CANDIDATES' was not declared in this scope
opencc_set_conversion_mode(od_, OPENCC_CONVERSION_LIST_CANDIDATES);
^
/build/librime/src/librime-rime-1.2/src/gear/simplifier.cc:71:70: error: 'opencc_set_conversion_mode' was not declared in this scope
opencc_set_conversion_mode(od_, OPENCC_CONVERSION_LIST_CANDIDATES);
^
/build/librime/src/librime-rime-1.2/src/gear/simplifier.cc:75:37: error: 'OPENCC_CONVERSION_FAST' was not declared in this scope
opencc_set_conversion_mode(od_, OPENCC_CONVERSION_FAST);
^
/build/librime/src/librime-rime-1.2/src/gear/simplifier.cc:75:59: error: 'opencc_set_conversion_mode' was not declared in this scope
opencc_set_conversion_mode(od_, OPENCC_CONVERSION_FAST);
^
/build/librime/src/librime-rime-1.2/src/gear/simplifier.cc:77:74: error: 'opencc_convert' was not declared in this scope
size_t converted = opencc_convert(od_, &inptr, &inlen, &outptr, &outlen);
^
src/CMakeFiles/rime.dir/build.make:1388: recipe for target 'src/CMakeFiles/rime.dir/gear/simplifier.cc.o' failed
make[3]: *** [src/CMakeFiles/rime.dir/gear/simplifier.cc.o] Error 1
make[3]: Leaving directory '/build/librime/src/librime-rime-1.2/build'
CMakeFiles/Makefile2:106: recipe for target 'src/CMakeFiles/rime.dir/all' failed
make[2]: *** [src/CMakeFiles/rime.dir/all] Error 2
make[2]: Leaving directory '/build/librime/src/librime-rime-1.2/build'
Makefile:117: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/build/librime/src/librime-rime-1.2/build'
Makefile:29: recipe for target 'librime' failed
make: *** [librime] Error 2
同样也编译运行过rime_api_console,控制台在显示
initializing...
message: [0] [deploy] start
后,卡在那无法继续运行
假定用户输入了一半,切换到了其它输入法,这时候我需要把用户的原始输入上屏。如何取得原始输入?
API似乎还没有提供这个接口。
CJK Unified Ideographs Extension D starts from \x2B740 rather than \x2B840 which rime currently uses.
不知道能不能實現單字禁止調頻,而語句模式自動組詞的功能?不僅限於形碼,我覺得音碼也需要這個吧?
兔嫂在Gentoo Linux下,使Fcitx-Rime 0.3.1,librime 1.2,rime-data 0.35。
前日欲打出「剋」一字,这个字有两种读法,一个是念「ke4」,是「克」之异体,另一念「kei1」,又作「尅」,见于《新华字典》第262-263页。然当输入「kei」时,发觉rime将其自动分割成「ke'i」,并无法打出此字。由于读此音者,只有这一个字,疑心是词库中并无此音,特于此反应bug。并对楼主表示感谢。
兔嫂于2015,1,26 (1)
又來問方法了。
有辦法運行時設定模糊音等拼寫規則嗎?
比如通過set_option("ing2in", true),然後就啓用某條規則。
還是只能修改schema.yaml,然後必須重新部署?
編譯成動態庫時,沒有t2s.json或者空的json文件rime直接掛掉,在simplifier.cc這一段:
try {
opencc_.reset(new Opencc(opencc_config_path.string()));
}
catch (opencc::Exception& e) {
LOG(ERROR) << "Error initializing opencc: " << e.what();
}
而編成靜態庫時,會有出錯提示:
I/native (17215): I/simplifier.cc:37 initilizing opencc: /sdcard/rime/opencc/t2s.json
E/native (17215): E/simplifier.cc:128 Error initializing opencc: Invalid format: Error parsing JSON
這是opencc動態庫的問題?還是現在只能編譯成靜態庫?
謝謝!
用 thirdparty/src 下的 opencc 库会编译失败。
Mac OS X 10.10 Xcode + clang
问题在 simplifier.cc
36行
opencc::Config config(config_path);
converter_ = config.GetConverter();
46行
opencc::Optionalopencc::DictEntry item = dict_->Match(text);
51行
*forms = item.Get().values;
opencc 的这几个接口有些变化,需要改改。
https://github.com/rime/home/wiki/CustomizationGuide#空碼時按空格鍵清空輸入碼
在这一个性指南中,rime给出了空格的空码清屏作用,实测有效。但在回车设置清屏这一前提下,如果按这一教程设置后,就会引发一个非常蛋疼的问题:用shift引导临时英文,再然后,就无法空格上屏了。应该是rime的这个清屏设置无法区分临时英文和空码所导致。望修复!
http://www.zdic.net/z/18/js/5AD1.htm
不知是未覆盖完全还是怎样?
语句模式下,设置“auto_selec:true”不起空码顶屏效果。
例子①:打拼音fenbianlvv后,“分辨率v”不自动上屏到目标文本,v变黄色提示空码。(这不是我自用方案需求的。)
例子②:在alphabet配置里加入逗号键后,句子后面再打逗号时,不自动上屏了,逗号也显黄色。此时后面再输入按键,一律都是黄色空码键。(这也不是我方案需求的。)
能否让这两例子在设置“auto_selec:true”后,自动空码顶屏、上屏?在我理解里,auto_selec不应该在语句模式下失效。。。(我用的是小狼毫)
若在词典中加入一个中英混合的词条,比如K歌
:
---
name: luna_pinyin
version: "2015.06.15"
sort: by_weight
use_preset_vocabulary: true
...
K歌 k ge
〇 ling
ㄓ zhi
ㄔ chi
ㄕ shi
ㄖ ri
ㄗ zi
仅改动这一处,重新部署后,输入kge
,原先可以正常显示的词条都不见了,只能显示「K歌」一词:
更严重的是,单独输入k
时显示的是空码,k的简拼都没了:
以k开头的词条必须输入全拼才能显示:
词典中只要混入了这样的有单个声母做编码的词条,就都会这样
暂时的解法:
kge
代替k ge
kg
来打xform/^([b-df-np-z])$/$1_/
处理,再取首码简拼。(贴吧@imy0823的做法)请问:以上rime「单独输入k
,就只返回空码」的现象是不是bug?
不知有無現成或者間接的接口。沒有的話,我可以自己提交pull request吧?
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.