Add caching to AI prediction results as well.

This commit is contained in:
fanlusky committed 2026-07-19 23:00:18 +08:00
1 parent a7a4434b97
commit 3cbec4e790
8 files changed
+49 -10

No files matched your search

+4 -3
View File
@@ -279,10 +279,11 @@ int EngineInputSession::remove_candidate(std::string pinyin, std::string word)
return session_.delete_by_pinyin_and_word(std::move(pinyin), std::move(word));
}
int EngineInputSession::cache_dynamic_candidate(const std::string &pinyin, const std::string &word)
int EngineInputSession::cache_dynamic_candidate(const std::string &pinyin, const std::string &word,
CandidateSource source)
{
const int cache_result = session_.cache_dynamic_candidate(pinyin, word);
(void)session_.cache_dynamic_candidate_for_current_request(word);
const int cache_result = session_.cache_dynamic_candidate(pinyin, word, source);
(void)session_.cache_dynamic_candidate_for_current_request(word, source);
return cache_result;
}