Git Product home page Git Product logo

librime's People

Contributors

alswl avatar bambooin avatar byvoid avatar dependabot[bot] avatar eagleoflqj avatar fxliang avatar groverlynn avatar hosiet avatar jixiuf avatar kionz avatar ksqsf avatar kuoruan avatar lembacon avatar leoyoon-tsaw avatar lotem avatar nameoverflow avatar nopdan avatar osfans avatar prcuvu avatar rocka avatar shewer avatar shiami avatar shikisuen avatar sleepybag avatar timxx avatar wengxt avatar whiredplanck avatar windhamwong avatar wxyzh avatar ztl8702 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

librime's Issues

Android版destroy_session時卡住

搞不定了,老大幫忙。

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.";
 }

[Feature Request] 以词定字

提起鼠须管,很多人都会说’词库小‘,然后导入外部的词库,可是这样也引入了更多的重码。打不出词组的时候苦恼,打出太多词组也是负担。即使这样,也没有改善单字重码的问题,反而更加剧了。倒不如一个基本的词库,加上’以词定字‘功能。

最新的 develop 分支在 Linux 下編譯錯誤

/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

空编码时空格的作用

如题。现在的小狼毫的空格在空编码状态下的作用是直接将编码上屏。这样,小狼毫也就默认此时用户的行为是要输入英文字符的处理的。
但是个人感觉,小狼毫不应该将在空编码状态下的空码直接理解为上屏输入处理。一来,对于输入法来说,特是对于形码来说,在存在空编码时,在严格匹配中,就不会出现正确的候选。此时用户希望的是将这一无用的编码清除掉,而非将这一空编码上屏。而空格相比esc肯定最近,使用空格将空编码清除掉,无疑是首选。
二来,小狼毫毕竟是中文输入法。人们习惯了当输入英文时,特别是长段英文,首先绝对不是在一个中文输入环境中完成的,而是首先将输入环境预设为英文尔后,才进行输入的。而通过挂只包含常用的英文码表时,已经可以完成使命。
第三点,是重要的。拿具体的码表来说,如拼音。当随便输入一个空统码时zhoumover,空格一下,将编码上屏。然而,这样的周末ver,上屏后有什么用的呢。根本就不是英文。我承认,有可能有这种的情况:空编码是某个单词。但这样的情况又有多少呢?

Retag

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

select_candidate只取了首頁,是否要修正爲當前頁?

這個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也能开放相关接口就好了。

沒有1.2.9的標籤

要不要push一個上去?最近的是1.2,獲取版本不方便。

librime % git describe --tags
rime-1.2-143-g90ddec9

OpenCC轉換時,詞無法一對多

最近嘗試做一個方便鍵入Emoji的方案,想到用OpenCC會很好,因爲基於漢字的轉換可以適用於任意輸入方案,能夠做出一個通用方案。
但是在實際使用過程中發現OpenCC不支持詞組的一對多映射
在把漢字轉換成Emoji時,漢字必須得到保留,否則將無法正常鍵入中文,所以所有的映射都是一對多。單字一對多沒有問題,但是遇到詞就不行了。Emoji數量非常多,用單字很難描述,更有大量國旗之類,詞組一對多在所難免。
現在各大輸入法都帶上了Emoji聯想功能,十分希望Rime也能有優秀的Emoji鍵入體驗。
@BYVoid

make error

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

中英文输入自动切换

由于经常需要写中文 LaTeX 文档或者带公式的 Markdown 文档,中英文切换非常烦人。一直想做一个能够做到中英文自动切换的输入法,简单扫了一下 Rime 的文档之后没有看到相关的介绍,在这里问一下吧。

最基本的要求其实非常简单,比如输入 "$" 符号或者 "$$" 自动开启英文模式(甚至开启 LaTeX 补全),然后再次输入 "$“ 符号等切换到正常模式就可以了。

我还想在这个思路上做一点扩展,自动识别输入的是拼音还是单词,实现自动中英文切换。需要混合输入中英文时语言切换太痛苦了。当然这个功能的实现估计要放弃中文简拼。

临时不方便输入繁体中文,望见谅!

内存泄漏

在 Instruments 里监视了一下,发现多处内存泄漏:
screen shot 2014-10-27 at 6 37 09 pm
每一处具体的调用栈 Instruments 也指出了。
我使用的是develop分支编译出的最新版。

无法用Visual Studio 2015编译

librime无法用Visual Studio 2015编译,会生成大量错误,我会在还原错误后贴出。

希望能够增加对Visual Studio 2015的支持。

vcbuild.bat 一处小问题

目前的版本中第47行:
cd %BOOST_ROOT%

我clone后的代码是存放在E盘的,而我下的boost的代码,我是解压到T盘的,
所以在指定到T盘的路径后, 这个bat中的cd %BOOST_ROOT% 并不能切换到 bjam.exe 所在的目录, 后来我把clone后的代码也复制到T盘了一份,才ok了.

是个小问题.

魔兽争霸War3内无法使用

windows版在魔兽世界3内无法使用,输入框闪出而后不见,能盲输入,即不看选词框直接选词。

建議拼音增加「不調頻可記憶新詞」功能

目前,五筆有「加入自造詞的同時,固定原來的字詞順序的解法 #9」但不是真正的固有功能,而是一種「技巧」。

建議拼音方案在動態不調頻情況下,但可記憶新詞,新詞排列在設定的位置。

linux中用mingw編譯、用wine運行時出錯

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

RIME输入法无法在bilibili网站上发弹幕

软件环境:
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的弹幕框发中文。

auto_select時空碼不上屏問題

speller/max_code_length: 4 或者speller/auto_select_pattern : .{4}時,四碼爲空不上屏。

舉例如下:

auto_select: true
码表:

苗 al
蘲 allf
虆 alli
藟 alll
蘽 alls

輸入allc時,會自動上al的苗。原因是四碼爲空,AutoSelectPreviousMatch會選到al

具體參見貼吧:http://tieba.baidu.com/p/4054640112

opencc 1.0.1 支持

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

如何取得原始输入的字符串?

假定用户输入了一半,切换到了其它输入法,这时候我需要把用户的原始输入上屏。如何取得原始输入?
API似乎还没有提供这个接口。

關於單字固頂與自動組詞

不知道能不能實現單字禁止調頻,而語句模式自動組詞的功能?不僅限於形碼,我覺得音碼也需要這個吧?

剋「kei」字打不出。

兔嫂在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)

現在opencc只能編譯成靜態庫嗎?

編譯成動態庫時,沒有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動態庫的問題?還是現在只能編譯成靜態庫?
謝謝!

develop 分支编译不通过

用 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 的这几个接口有些变化,需要改改。

Bug:rime空格无法区分临时英文和空码

https://github.com/rime/home/wiki/CustomizationGuide#空碼時按空格鍵清空輸入碼
在这一个性指南中,rime给出了空格的空码清屏作用,实测有效。但在回车设置清屏这一前提下,如果按这一教程设置后,就会引发一个非常蛋疼的问题:用shift引导临时英文,再然后,就无法空格上屏了。应该是rime的这个清屏设置无法区分临时英文和空码所导致。望修复!

语句模式下,“auto_select: true”的问题

语句模式下,设置“auto_selec:true”不起空码顶屏效果。

例子①:打拼音fenbianlvv后,“分辨率v”不自动上屏到目标文本,v变黄色提示空码。(这不是我自用方案需求的。)

例子②:在alphabet配置里加入逗号键后,句子后面再打逗号时,不自动上屏了,逗号也显黄色。此时后面再输入按键,一律都是黄色空码键。(这也不是我方案需求的。)

能否让这两例子在设置“auto_selec:true”后,自动空码顶屏、上屏?在我理解里,auto_selec不应该在语句模式下失效。。。(我用的是小狼毫)

dict加入一个词条,就会使其它词条无法显示

用的是最新brise中的朙月拼音。正常输入时是这样:
单独输入k
输入kge

若在词典中加入一个中英混合的词条,比如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歌」一词:
再输入kge

更严重的是,单独输入k时显示的是空码,k的简拼都没了:
再单独输入k
以k开头的词条必须输入全拼才能显示:
输入全拼
词典中只要混入了这样的有单个声母做编码的词条,就都会这样

暂时的解法:

  • 中英混合词条编码不留空格。比如用kge代替k ge
    缺点是中英混合词条无法用简拼kg来打
  • 先用拼写运算xform/^([b-df-np-z])$/$1_/处理,再取首码简拼。(贴吧@imy0823的做法)

请问:以上rime「单独输入k,就只返回空码」的现象是不是bug?

再問幾個觸屏相關的功能

不知有無現成或者間接的接口。沒有的話,我可以自己提交pull request吧?

  1. 直接設定當前高亮的候選項,目前好像只能通過發送Up/Down按鍵事件設定。觸屏可以通過長按或滑動設定。
  2. 直接設定當前編碼區RimeComposition的光標位置,目前好像只能通過發送Left/Right等按鍵事件移動光標位置。觸屏可以直接點擊設定光標位置。
  3. 獲取所有候選字。這個可能會慢,不知是否可行。#38 select_candidate 已經實現從所有候選字中選擇。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.