aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/correction.cpp
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-10-05 21:16:23 +0900
committerSatoshi Kataoka <satok@google.com>2012-10-05 21:39:28 +0900
commit448e732272bb3e55d649d2d5dd6a0acb9efdaec3 (patch)
tree2b2ac303f43960e4b0aa2e2c82aaa9cd4854bbb2 /native/jni/src/correction.cpp
parent78fe885fb3fcea85e5522ae7a09d12febaca9ba7 (diff)
downloadlatinime-448e732272bb3e55d649d2d5dd6a0acb9efdaec3.tar.gz
latinime-448e732272bb3e55d649d2d5dd6a0acb9efdaec3.tar.xz
latinime-448e732272bb3e55d649d2d5dd6a0acb9efdaec3.zip
Follow up change for I5f166a738f6e84a1b807be
Bug: 7283955 Change-Id: Iec716d75e7c8a727b198688f44ef4a8cd1255ec1
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);
}