Fix the trigger condition for cloud prediction.

This commit is contained in:
fanlusky committed 2026-06-20 21:38:38 +08:00
1 parent 504ee31cf6
commit 6d606580e0
1 file changed
+19
@@ -259,6 +259,25 @@ IInputSession::SelectionTransition EngineInputSession::advance_composition_after
IInputSession::CloudQueryState EngineInputSession::get_cloud_query_state() const
{
CloudQueryState state;
if (is_shuangpin())
{
const auto &pinyin_with_cases = get_pinyin_sequence_with_cases();
if (!pinyin_with_cases.empty() && pinyin_with_cases.size() % 2 == 0)
{
const char last = pinyin_with_cases.back();
state.should_query = last >= 'a' && last <= 'z';
}
if (state.should_query)
{
state.query_text = request().normalized_input;
}
state.cache_key = request().raw_input;
state.committed_pinyin = request().normalized_input;
return state;
}
state.should_query = !request().normalized_input.empty();
state.query_text = request().normalized_input;
state.cache_key = request().raw_input;