sdadonkey / rime-english

Rime English:在西文模式下實現英文單詞輸入
https://github.com/sdadonkey/rime-english
78 stars 13 forks source link

新改的 英打模式 #4

Open shewer opened 4 years ago

shewer commented 4 years ago

rime-engilsh(https://github.com/shewer/rime-english)

lua_processor Tab 更新 cand.text to context.text 會補上空白 或 , 字符

lua segment 打上 english tag

shewer commented 4 years ago

string.find_words 修改 增加 func 可以 加載 yiald 增加 查詢效率 filter & translator 的 yield 都有 Coroutine 功能

local function translator(inpet,seg,env)

input:find_words(
function(elm)
    log.info("--- in tran yield loop -elm:" .. elm )
    if flag and context.input ~= elm then
        yield( Candidate("pre_english", seg.start,seg._end , context.input , "[english]"))
    end
    flag=false
    yield( Candidate("english", seg.start,seg._end, elm, "[english]") )
end
)
shewer commented 4 years ago

rime-engilsh(https://github.com/shewer/rime-english)

lua_processor Tab 更新 cand.text to context.text 會補上空白 或 , 字符

lua segment 打上 english tag

shewer commented 4 years ago

誤触

shewer commented 4 years ago

我已經做好了 , english_dict.lua english_init.lua 應該可以利用 也可以線外測試 dict.iter_dict_match( wildword, fold_sw) -- string ,bool -- "a/i:a" --> "a*ing:a"

打 teg 的segment 也還算簡單 processor 以收 a-zA-Z,_-/:.
,. " " 上屏時 Rejected -- auto keyevent: [,. ] context:commit ; Rejected ex: wildword 功能 詞類 old on/off for text,commet in ( dict.iter_dict_match(input,true) do yield( Candidate(type, text,seg.start,seg._end,commet) )) end