We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
return { init=function(env) env.engine.context.commit_notifier:connect( function(ctx) local lct=ctx:get_commit_text() if isPureChinese(lct) then record(lct) end end) end, func=function()end }
这个 Lua 会在汉字上屏后调用 record 函数,记录上屏内容,因此不需要 func 部分,但目前的 Lua组件 中 func 的值必须是函数。
The text was updated successfully, but these errors were encountered:
lua_gears static void raw_init
lua_gears
static void raw_init
... if (lua_type(L, -1) != LUA_TFUNCTION) { LOG(ERROR) << "Lua Compoment of initialize error:(" << " module: "<< t.klass << " name_space: " << t.name_space << " func type: " << luaL_typename(L, -1) << " ): " << "func type error expect function "; } ...
报错的似乎是这串代码,能否让他在 func 值为 nil 时跳过而非报错
Sorry, something went wrong.
使用 notifier:connect() 一定要在 fini(env) 中,加入 notifier:disconnect() 解構
func 是 processor segmentor translator filter 的主體,主要應用 改 c++ , lua ; 覺得 lua 容易些
目前我的解决办法是在engine/processors末尾调用一个func部分永远返回kNoop的lua_processor 基本符合预期
engine/processors
func
kNoop
lua_processor
return { init=function(env) ... end, func=function() return 2; end, fini=function() ... end, };
No branches or pull requests
这个 Lua 会在汉字上屏后调用 record 函数,记录上屏内容,因此不需要 func 部分,但目前的 Lua组件 中 func 的值必须是函数。
The text was updated successfully, but these errors were encountered: