librime-lua
librime-lua copied to clipboard
請問 LuaTranslation 如何要使用
LuaTransltion https://github.com/hchunhui/librime-lua/blob/67ef681a9fd03262c49cc7f850cc92fc791b1e85/src/lua_gears.cc#L11
LuaTranslator https://github.com/hchunhui/librime-lua/blob/67ef681a9fd03262c49cc7f850cc92fc791b1e85/src/lua_gears.cc#L108
1 Translation( func) func 如何設計 參數如何傳送
2 看起來 像是和 Lua_translator func 設計類似 要用 yield( candidate )
自問自答: 但是還是不曉得如何在 沒有keyevent 下送出候選字
function gen_translator(str)
return Translation(
function()
words= dict(str) -- list
for word in ipairs(words) do
yield( Candidate( "--" , 1, 1 , word, "") )
end
end)
end