aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/correction.cpp
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-10-05 06:06:49 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-10-05 06:06:49 -0700
commitb3ef79b6cc80019bb6ac41b1990fcb971b77488e (patch)
treeb8b897772d352ebb7ced2f63602840d9b3e38208 /native/jni/src/correction.cpp
parentc5965ffe62b50c2ec7947f1bc6c505eca144fc39 (diff)
parent595b9ea54a21988ae4209779ac2dae9898aa43e2 (diff)
downloadlatinime-b3ef79b6cc80019bb6ac41b1990fcb971b77488e.tar.gz
latinime-b3ef79b6cc80019bb6ac41b1990fcb971b77488e.tar.xz
latinime-b3ef79b6cc80019bb6ac41b1990fcb971b77488e.zip
am 595b9ea5: am 478605ba: am 448e7322: Follow up change for I5f166a738f6e84a1b807be
* commit '595b9ea54a21988ae4209779ac2dae9898aa43e2': Follow up change for I5f166a738f6e84a1b807be
Diffstat (limited to 'native/jni/src/correction.cpp')
-rw-r--r--native/jni/src/correction.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/native/jni/src/correction.cpp b/native/jni/src/correction.cpp
index 26d8ed715..524abe9a1 100644
--- a/native/jni/src/correction.cpp
+++ b/native/jni/src/correction.cpp
@@ -799,9 +799,9 @@ int Correction::RankingAlgorithm::calculateFinalProbability(const int inputIndex
const float x = static_cast<float>(squaredDistance)
/ ProximityInfoState::NORMALIZED_SQUARED_DISTANCE_SCALING_FACTOR;
const float factor = max((x < R1)
- ? (A * (R1 - x) + B * x) / R1
- : (B * (R2 - x) + C * (x - R1)) / (R2 - R1), MIN);
- // factor is piecewise linear function like:
+ ? (A * (R1 - x) + B * x) / R1
+ : (B * (R2 - x) + C * (x - R1)) / (R2 - R1), MIN);
+ // factor is a piecewise linear function like:
// A -_ .
// ^-_ .
// B \ .
@@ -809,7 +809,7 @@ int Correction::RankingAlgorithm::calculateFinalProbability(const int inputIndex
// C ------------.
// .
// 0 R1 R2 .
- multiplyRate((int)(factor * 100), &finalFreq);
+ multiplyRate((int)(factor * 100.0f), &finalFreq);
} else if (squaredDistance == PROXIMITY_CHAR_WITHOUT_DISTANCE_INFO) {
multiplyRate(WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE, &finalFreq);
}