From 6d88b959ba38be7af86dee15c39584e44e2045e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=85=E6=88=8E=E6=B0=8F?= Date: Sun, 3 Mar 2024 19:19:51 +0800 Subject: [PATCH] chore(script_translator): predict word if enable_completion --- src/rime/gear/script_translator.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rime/gear/script_translator.cc b/src/rime/gear/script_translator.cc index f8a94f1fee..5f3799e58e 100644 --- a/src/rime/gear/script_translator.cc +++ b/src/rime/gear/script_translator.cc @@ -352,7 +352,8 @@ static bool is_exact_match_phrase(const an& entry) { bool ScriptTranslation::Evaluate(Dictionary* dict, UserDictionary* user_dict) { size_t consumed = syllabifier_->BuildSyllableGraph(*dict->prism()); const auto& syllable_graph = syllabifier_->syllable_graph(); - bool predict_word = start_ + consumed == end_of_input_; + bool predict_word = translator_->enable_completion() && + start_ + consumed == end_of_input_; phrase_ = dict->Lookup(syllable_graph, 0, predict_word); if (user_dict) {