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

Memory 组件不能调用 FinishSession,使得对用户词典的写入有延迟 #312

Open
tansongchen opened this issue Feb 13, 2024 · 1 comment

Comments

@tansongchen
Copy link
Contributor

在使用中,观察到以下现象:如果使用 Memory 的 update_userdict() 函数更新了用户词典,则这个更新的内容一般不会立刻反映出来,但如果按了回车等 Rime 不会处理的键,就能立刻反映出来。我认为原因是:TableTranslator 和 ScriptTranslator 都在一开始调用了 FinishSession() 这个函数,以保证上一次的写入生效,但是 lua 中的 Memory 没有暴露这个函数,因此无法调用。

建议把

  bool StartSession();
  bool FinishSession();
  bool DiscardSession();

这几个函数也加入 lua 接口,方便开发者调用。

@shewer
Copy link
Contributor

shewer commented Feb 14, 2024

你可以試試在

memory.clearUser();

加入 memory.FinishSession();

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

2 participants