aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-06-08 01:22:31 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-06-08 01:22:31 -0700
commitc33a5428bed2f64b2a52ad118f5869df6a7e7ba9 (patch)
treeab156c36b43db07b81ce414ec13a9a932b4f94b4 /java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
parent67fd0c240d7c37b06e05333347fd17acf59fadf8 (diff)
parentd10c473347c7e21c383c56786c9eb96fd6513a5c (diff)
downloadlatinime-c33a5428bed2f64b2a52ad118f5869df6a7e7ba9.tar.gz
latinime-c33a5428bed2f64b2a52ad118f5869df6a7e7ba9.tar.xz
latinime-c33a5428bed2f64b2a52ad118f5869df6a7e7ba9.zip
Merge "Small performance tweak"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
index 0c5d41a5c..2c3eee74c 100644
--- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
+++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
@@ -787,9 +787,9 @@ public class BinaryDictInputOutput {
// (discretizedFrequency + 0.5) times this value to get the median value of the step,
// which is the best approximation. This is how we get the most precise result with
// only four bits.
- final double stepSize =
- (MAX_TERMINAL_FREQUENCY - unigramFrequency) / (1.5 + MAX_BIGRAM_FREQUENCY);
- final double firstStepStart = 1 + unigramFrequency + (stepSize / 2.0);
+ final float stepSize =
+ (MAX_TERMINAL_FREQUENCY - unigramFrequency) / (1.5f + MAX_BIGRAM_FREQUENCY);
+ final float firstStepStart = 1 + unigramFrequency + (stepSize / 2.0f);
final int discretizedFrequency = (int)((bigramFrequency - firstStepStart) / stepSize);
// If the bigram freq is less than half-a-step higher than the unigram freq, we get -1
// here. The best approximation would be the unigram freq itself, so we should not