diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java index 222e0c5a2..4113d9b2c 100644 --- a/src/com/android/inputmethod/latin/LatinIME.java +++ b/src/com/android/inputmethod/latin/LatinIME.java @@ -1169,6 +1169,9 @@ public class LatinIME extends InputMethodService @Override public void addWord(String word, int addFrequency) { + final int length = word.length(); + // Don't add very short or very long words. + if (length < 2 || length > getMaxWordLength()) return; super.addWord(word, addFrequency); final int freq = getWordFrequency(word); if (freq > PROMOTION_THRESHOLD) {