Results 215 comments of Shewer Lu

你可以檢查 /build/ 下的方案是否有更新,有時重新build時有錯誤 不會更新build/下的方案 上面的patch 會加入到 engine/filters/ 最後 engine/filters/@0:lua_filter@completion engine/filters/@1:single_char_filter

code 有問題 , 修正一下. ```lua local M={} function M.init(env) local config=env.engine.schema.config -- default translator env.finals= config:get_string("speller/finals") -- 取得 speller/finals 字元 end function M.fini(env) end -- enable func local function func(input,env)...

如果你對 Segment(segmention) --> Translator -->filter 熟悉 ,就會放棄吧 細部的部分我是不熟悉 preedit_format 是在 translator or segment 轉換??? 以下是我初步預想 , 你可以試試 1 translator 不可行 lua_translator 只能管自己的 translator 無法控制其他~~ translator 2 lua_segmentor -- 不熟悉 3...

你是 win or linux https://ci.appveyor.com/api/buildjobs/m4yhqfofhqfmw8f0/artifacts/rime.zip

我只調整過 candidate 你這試試 或詢問 librime那 api 如何使用置換 在到 librime-lua src/types.cc 查詢 lua api ContextReg 有三個 get_ 前二個 return String , Preedit obj 可以比較一下差異 context:get_preedit_text() -- return Preedit https://github.com/hchunhui/librime-lua/blob/67ef681a9fd03262c49cc7f850cc92fc791b1e85/src/types.cc#L460-L482 PreeditReg local...

Preedit 是Struct log.error 沒有錯的話, 應該是有設定 可以再取回確認 ,說不定是程序上沒有刷新 或是在 改cand.preedit 但是 cand 是translator 產生的 和segment start _end 相關 ,不知道有沒有影響,可以一試 可以在 lua_filter yield debug candidate 查看 candidata 也有 preedit ``` local preeidt=context:get_preedit()...

'''lua local function func(inp,env) yield( Candidate( "debug" , 1 ,1, text, comment) ) for cand in inp:iter() do .... end end ```

你是說 text= "abc" 無法改成功是嗎 preedxt.text 是 ascii or preed_format? 看來是沒用 不是參照 ```c++ 24 │ Preedit Composition::GetPreedit(const string& full_input, size_t caret_pos, 25 │ const string& caret) const { 26 │ Preedit...

table_translator.cc ```c++ 33 │ TableTranslation::TableTranslation(TranslatorOptions* options, 34 │ const Language* language, 35 │ const string& input, 36 │ size_t start, 37 │ size_t end, 38 │ const string& preedit, 39...

是吧 如果 游標在右 還好處理 在左 右邊字串 不好處理 librime 對於 segment 處理嚴謹,從source ( processor segment translator) .. 都在算 input 位置 librime-lua 只要 yield( candidate )segment 位置不對也可以