diff options
author | 2013-08-01 00:39:39 -0700 | |
---|---|---|
committer | 2013-08-01 00:39:39 -0700 | |
commit | 3f30c09d889fd5cfde471e1cfb284dce77e3b44a (patch) | |
tree | dc4e7b5ff67830839d8347efda6eaedf19507c7e /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 5bd60162009843842200c62b0573275bfb037ec0 (diff) | |
parent | 503b79029a41d672f6a4c22e2d4f24709a1dfc80 (diff) | |
download | latinime-3f30c09d889fd5cfde471e1cfb284dce77e3b44a.tar.gz latinime-3f30c09d889fd5cfde471e1cfb284dce77e3b44a.tar.xz latinime-3f30c09d889fd5cfde471e1cfb284dce77e3b44a.zip |
am 503b7902: Merge "Connect the personalization dictionary"
* commit '503b79029a41d672f6a4c22e2d4f24709a1dfc80':
Connect the personalization dictionary
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 614c14308..719c7c81f 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -76,6 +76,7 @@ import com.android.inputmethod.keyboard.MainKeyboardView; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.personalization.PersonalizationDictionaryHelper; +import com.android.inputmethod.latin.personalization.PersonalizationPredictionDictionary; import com.android.inputmethod.latin.personalization.UserHistoryPredictionDictionary; import com.android.inputmethod.latin.settings.Settings; import com.android.inputmethod.latin.settings.SettingsActivity; @@ -170,6 +171,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private boolean mIsMainDictionaryAvailable; private UserBinaryDictionary mUserDictionary; private UserHistoryPredictionDictionary mUserHistoryPredictionDictionary; + private PersonalizationPredictionDictionary mPersonalizationPredictionDictionary; private boolean mIsUserDictionaryAvailable; private LastComposedWord mLastComposedWord = LastComposedWord.NOT_A_COMPOSED_WORD; @@ -560,6 +562,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mUserHistoryPredictionDictionary = PersonalizationDictionaryHelper .getUserHistoryPredictionDictionary(this, localeStr, prefs); newSuggest.setUserHistoryPredictionDictionary(mUserHistoryPredictionDictionary); + mPersonalizationPredictionDictionary = PersonalizationDictionaryHelper + .getPersonalizationPredictionDictionary(this, localeStr, prefs); + newSuggest.setPersonalizationPredictionDictionary(mPersonalizationPredictionDictionary); final Suggest oldSuggest = mSuggest; resetContactsDictionary(null != oldSuggest ? oldSuggest.getContactsDictionary() : null); @@ -2509,9 +2514,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final SettingsValues currentSettings = mSettings.getCurrent(); if (!currentSettings.mCorrectionEnabled) return null; - final UserHistoryPredictionDictionary userHistoryDictionary = + final UserHistoryPredictionDictionary userHistoryPredictionDictionary = mUserHistoryPredictionDictionary; - if (userHistoryDictionary == null) return null; + if (userHistoryPredictionDictionary == null) return null; final String prevWord = mConnection.getNthPreviousWord(currentSettings.mWordSeparators, 2); final String secondWord; @@ -2525,7 +2530,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final int maxFreq = AutoCorrectionUtils.getMaxFrequency( suggest.getUnigramDictionaries(), suggestion); if (maxFreq == 0) return null; - userHistoryDictionary.addToUserHistory(prevWord, secondWord, maxFreq > 0); + userHistoryPredictionDictionary.addToUserHistory(prevWord, secondWord, maxFreq > 0); return prevWord; } |