Loading java/src/com/android/inputmethod/latin/UserHistoryDictionary.java +3 −1 Original line number Diff line number Diff line Loading @@ -229,6 +229,7 @@ public class UserHistoryDictionary extends ExpandableDictionary { public void loadDictionaryAsync() { synchronized(mBigramList) { final long last = SettingsValues.getLastUserHistoryWriteTime(mPrefs, mLocale); final boolean initializing = last == 0; final long now = System.currentTimeMillis(); // Load the words that correspond to the current input locale final Cursor cursor = query(MAIN_COLUMN_LOCALE + "=?", new String[] { mLocale }); Loading @@ -253,7 +254,8 @@ public class UserHistoryDictionary extends ExpandableDictionary { } else if (word1.length() < BinaryDictionary.MAX_WORD_LENGTH && word2.length() < BinaryDictionary.MAX_WORD_LENGTH) { super.setBigramAndGetFrequency( word1, word2, new ForgettingCurveParams(fc, now, last)); word1, word2, initializing ? new ForgettingCurveParams(true) : new ForgettingCurveParams(fc, now, last)); } mBigramList.addBigram(word1, word2, (byte)fc); cursor.moveToNext(); Loading java/src/com/android/inputmethod/latin/UserHistoryForgettingCurveUtils.java +6 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ public class UserHistoryForgettingCurveUtils { private static final long ELAPSED_TIME_INTERVAL_MILLIS = ELAPSED_TIME_INTERVAL_HOURS * DateUtils.HOUR_IN_MILLIS; private static final int HALF_LIFE_HOURS = 48; private static final int MAX_PUSH_ELAPSED = (FC_LEVEL_MAX + 1) * (ELAPSED_TIME_MAX + 1); private UserHistoryForgettingCurveUtils() { // This utility class is not publicly instantiable. Loading Loading @@ -94,6 +95,11 @@ public class UserHistoryForgettingCurveUtils { if (elapsedTimeCount <= 0) { return; } if (elapsedTimeCount >= MAX_PUSH_ELAPSED) { mLastTouchedTime = now; mFc = 0; return; } for (int i = 0; i < elapsedTimeCount; ++i) { mLastTouchedTime += ELAPSED_TIME_INTERVAL_MILLIS; mFc = pushElapsedTime(mFc); Loading Loading
java/src/com/android/inputmethod/latin/UserHistoryDictionary.java +3 −1 Original line number Diff line number Diff line Loading @@ -229,6 +229,7 @@ public class UserHistoryDictionary extends ExpandableDictionary { public void loadDictionaryAsync() { synchronized(mBigramList) { final long last = SettingsValues.getLastUserHistoryWriteTime(mPrefs, mLocale); final boolean initializing = last == 0; final long now = System.currentTimeMillis(); // Load the words that correspond to the current input locale final Cursor cursor = query(MAIN_COLUMN_LOCALE + "=?", new String[] { mLocale }); Loading @@ -253,7 +254,8 @@ public class UserHistoryDictionary extends ExpandableDictionary { } else if (word1.length() < BinaryDictionary.MAX_WORD_LENGTH && word2.length() < BinaryDictionary.MAX_WORD_LENGTH) { super.setBigramAndGetFrequency( word1, word2, new ForgettingCurveParams(fc, now, last)); word1, word2, initializing ? new ForgettingCurveParams(true) : new ForgettingCurveParams(fc, now, last)); } mBigramList.addBigram(word1, word2, (byte)fc); cursor.moveToNext(); Loading
java/src/com/android/inputmethod/latin/UserHistoryForgettingCurveUtils.java +6 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ public class UserHistoryForgettingCurveUtils { private static final long ELAPSED_TIME_INTERVAL_MILLIS = ELAPSED_TIME_INTERVAL_HOURS * DateUtils.HOUR_IN_MILLIS; private static final int HALF_LIFE_HOURS = 48; private static final int MAX_PUSH_ELAPSED = (FC_LEVEL_MAX + 1) * (ELAPSED_TIME_MAX + 1); private UserHistoryForgettingCurveUtils() { // This utility class is not publicly instantiable. Loading Loading @@ -94,6 +95,11 @@ public class UserHistoryForgettingCurveUtils { if (elapsedTimeCount <= 0) { return; } if (elapsedTimeCount >= MAX_PUSH_ELAPSED) { mLastTouchedTime = now; mFc = 0; return; } for (int i = 0; i < elapsedTimeCount; ++i) { mLastTouchedTime += ELAPSED_TIME_INTERVAL_MILLIS; mFc = pushElapsedTime(mFc); Loading