aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-08-01 15:38:40 +0900
committerSatoshi Kataoka <satok@google.com>2013-08-01 16:33:20 +0900
commit60586b57cf4ca4af16cf9a9261aaba9490f128bc (patch)
tree12b1a509970a278af8246572dc40f832a291b6fa /java/src/com/android/inputmethod/latin/LatinIME.java
parent932aeb9d22a9e612dbeff7e45629bcdd6b99486c (diff)
downloadlatinime-60586b57cf4ca4af16cf9a9261aaba9490f128bc.tar.gz
latinime-60586b57cf4ca4af16cf9a9261aaba9490f128bc.tar.xz
latinime-60586b57cf4ca4af16cf9a9261aaba9490f128bc.zip
Connect the personalization dictionary
Bug: 9429906 Bug: 4192129 Change-Id: I9c9f3ed7699f74339ad92be6dcddb8a52c377545
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java11
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;
}