diff --git a/src/rime_api.cc b/src/rime_api.cc index 2f75e7e3e..19f048265 100644 --- a/src/rime_api.cc +++ b/src/rime_api.cc @@ -239,6 +239,7 @@ static void rime_candidate_copy(RimeCandidate* dest, const an& src) { } else { dest->comment = nullptr; } + dest->quality = src->quality(); dest->reserved = nullptr; } diff --git a/src/rime_api.h b/src/rime_api.h index a44f7b53c..c94ed8b83 100644 --- a/src/rime_api.h +++ b/src/rime_api.h @@ -114,6 +114,7 @@ typedef struct { typedef struct rime_candidate_t { char* text; char* comment; + double quality; void* reserved; } RimeCandidate; diff --git a/tools/rime_api_console.cc b/tools/rime_api_console.cc index 5cd73167e..d5b0c8819 100644 --- a/tools/rime_api_console.cc +++ b/tools/rime_api_console.cc @@ -78,6 +78,7 @@ void print_menu(RimeMenu* menu) { bool highlighted = i == menu->highlighted_candidate_index; printf("%d. %c%s%c ", (i + 1) % 10, highlighted ? '[' : ' ', menu->candidates[i].text, highlighted ? ']' : ' '); + printf("%f ", menu->candidates[i].quality); print_comment(menu->candidates[i].comment); putchar('\n'); }