diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h index eb59744f6..dd7437f24 100644 --- a/native/jni/src/defines.h +++ b/native/jni/src/defines.h @@ -289,7 +289,6 @@ static inline void prof_out(void) { #define CALIBRATE_SCORE_BY_TOUCH_COORDINATES true #define SUGGEST_MULTIPLE_WORDS true -#define USE_SUGGEST_INTERFACE_FOR_TYPING true #define SUGGEST_INTERFACE_OUTPUT_SCALE 1000000.0f // The following "rate"s are used as a multiplier before dividing by 100, so they are in percent. diff --git a/native/jni/src/obsolete/correction.cpp b/native/jni/src/obsolete/correction.cpp index e6c577f85..e583dfa81 100644 --- a/native/jni/src/obsolete/correction.cpp +++ b/native/jni/src/obsolete/correction.cpp @@ -918,11 +918,15 @@ inline static bool isUpperCase(unsigned short c) { // In dictionary.cpp, getSuggestion() method, // When USE_SUGGEST_INTERFACE_FOR_TYPING is true: +// +// // TODO: Revise the following logic thoroughly by referring to the logic +// // marked as "Otherwise" below. // SUGGEST_INTERFACE_OUTPUT_SCALE was multiplied to the original suggestion scores to convert // them to integers. // score = (int)((original score) * SUGGEST_INTERFACE_OUTPUT_SCALE) // Undo the scaling here to recover the original score. // normalizedScore = ((float)score) / SUGGEST_INTERFACE_OUTPUT_SCALE +// // Otherwise: suggestion scores are computed using the below formula. // original score // := powf(mTypedLetterMultiplier (this is defined 2), @@ -965,9 +969,11 @@ inline static bool isUpperCase(unsigned short c) { // so, 0 <= distance / afterLength <= 1 const float weight = 1.0f - static_cast(distance) / static_cast(afterLength); - if (USE_SUGGEST_INTERFACE_FOR_TYPING) { + // TODO: Revise the following logic thoroughly by referring to... + if (true /* USE_SUGGEST_INTERFACE_FOR_TYPING */) { return (static_cast(score) / SUGGEST_INTERFACE_OUTPUT_SCALE) * weight; } + // ...this logic. const float maxScore = score >= S_INT_MAX ? static_cast(S_INT_MAX) : static_cast(MAX_INITIAL_SCORE) * powf(static_cast(TYPED_LETTER_MULTIPLIER),