diff options
author | 2012-07-05 16:53:56 +0900 | |
---|---|---|
committer | 2012-07-05 16:53:56 +0900 | |
commit | 3d2f5f848764252ecd2f15c2d0d857c1fe7f7eaf (patch) | |
tree | 9d3db512a4541c8728545aa474647216d44765cb /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | 1930f194c2f3b3a6182906c4378388025dff5686 (diff) | |
parent | 0726f466f7789ca112697adf6505870bb821ea17 (diff) | |
download | latinime-3d2f5f848764252ecd2f15c2d0d857c1fe7f7eaf.tar.gz latinime-3d2f5f848764252ecd2f15c2d0d857c1fe7f7eaf.tar.xz latinime-3d2f5f848764252ecd2f15c2d0d857c1fe7f7eaf.zip |
Merge remote-tracking branch 'goog/master' into mergescript
Conflicts:
java/src/com/android/inputmethod/keyboard/Keyboard.java
java/src/com/android/inputmethod/latin/LatinIME.java
java/src/com/android/inputmethod/latin/Suggest.java
Change-Id: I73c1cec1f4bca5139372392e93d55081d814fa6c
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 892245402..5aecc1371 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -272,31 +272,9 @@ public class Suggest implements Dictionary.WordCallback { mBigramSuggestions = new ArrayList<SuggestedWordInfo>(PREF_MAX_BIGRAMS); if (!TextUtils.isEmpty(prevWordForBigram)) { - getAllBigrams(prevWordForBigram, wordComposer); - if (TextUtils.isEmpty(consideredWord)) { - // Nothing entered: return all bigrams for the previous word - int insertCount = Math.min(mBigramSuggestions.size(), MAX_SUGGESTIONS); - for (int i = 0; i < insertCount; ++i) { - addBigramToSuggestions(mBigramSuggestions.get(i)); - } - } else { - // Word entered: return only bigrams that match the first char of the typed word - final char currentChar = consideredWord.charAt(0); - // TODO: Must pay attention to locale when changing case. - // TODO: Use codepoint instead of char - final char currentCharUpper = Character.toUpperCase(currentChar); - int count = 0; - final int bigramSuggestionSize = mBigramSuggestions.size(); - for (int i = 0; i < bigramSuggestionSize; i++) { - final SuggestedWordInfo bigramSuggestion = mBigramSuggestions.get(i); - final char bigramSuggestionFirstChar = - (char)bigramSuggestion.codePointAt(0); - if (bigramSuggestionFirstChar == currentChar - || bigramSuggestionFirstChar == currentCharUpper) { - addBigramToSuggestions(bigramSuggestion); - if (++count > MAX_SUGGESTIONS) break; - } - } + for (final String key : mDictionaries.keySet()) { + final Dictionary dictionary = mDictionaries.get(key); + suggestionsSet.addAll(dictionary.getBigrams(wordComposer, prevWordForBigram)); } } |