Skip to content
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

新改的 英打模式 #4

Open
shewer opened this issue Oct 13, 2020 · 4 comments
Open

新改的 英打模式 #4

shewer opened this issue Oct 13, 2020 · 4 comments

Comments

@shewer
Copy link

shewer commented Oct 13, 2020

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

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

lua segment 打上 english tag

@shewer
Copy link
Author

shewer commented Oct 13, 2020

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
Copy link
Author

shewer commented Oct 17, 2020

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

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

lua segment 打上 english tag

@shewer shewer closed this as completed Oct 17, 2020
@shewer shewer reopened this Oct 17, 2020
@shewer
Copy link
Author

shewer commented Oct 17, 2020

誤触

@shewer
Copy link
Author

shewer commented Oct 19, 2020

我已經做好了 , 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant