am 5b63c38d: Fix 2306814: Too aggressive suggesting names from my contacts list.
Merge commit '5b63c38d1fc9e42348a8a90edf8dce6103f72864' into eclair-plus-aosp
* commit '5b63c38d1fc9e42348a8a90edf8dce6103f72864':
Fix 2306814: Too aggressive suggesting names from my contacts list.
diff --git a/src/com/android/inputmethod/latin/ExpandableDictionary.java b/src/com/android/inputmethod/latin/ExpandableDictionary.java
index a136ee7..1589168 100644
--- a/src/com/android/inputmethod/latin/ExpandableDictionary.java
+++ b/src/com/android/inputmethod/latin/ExpandableDictionary.java
@@ -105,8 +105,8 @@
if (wordLength == depth + 1) {
// Terminate this word
childNode.terminal = true;
- childNode.frequency += frequency; // If there are multiple similar words
- if (childNode.frequency > 256) childNode.frequency = 256;
+ childNode.frequency = Math.max(frequency, childNode.frequency);
+ if (childNode.frequency > 255) childNode.frequency = 255;
return;
}
if (childNode.children == null) {