diff options
author | 2012-07-06 12:34:41 +0900 | |
---|---|---|
committer | 2012-07-09 15:06:16 +0900 | |
commit | d579f1aefc8d02254db297ffd6d8f9dbdcab0637 (patch) | |
tree | 5155aa54e99b83d9fae09e74a03b678576b3316a /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 347a80f793c2b3e132b48d87918e331352b142f4 (diff) | |
download | latinime-d579f1aefc8d02254db297ffd6d8f9dbdcab0637.tar.gz latinime-d579f1aefc8d02254db297ffd6d8f9dbdcab0637.tar.xz latinime-d579f1aefc8d02254db297ffd6d8f9dbdcab0637.zip |
Consolidate methods that do the same thing (A74)
Change-Id: I6e7c3aba2b40ecefa483c9680978bc806368e96e
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 62d477839..ae0923182 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1695,7 +1695,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private SuggestedWords updateSuggestions(final CharSequence typedWord) { // TODO: May need a better way of retrieving previous word - final CharSequence prevWord = mConnection.getPreviousWord(mCurrentSettings.mWordSeparators); + final CharSequence prevWord = + mConnection.getNthPreviousWord(mCurrentSettings.mWordSeparators, 2); // getSuggestedWords handles gracefully a null value of prevWord final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer, prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), @@ -1889,7 +1890,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } private SuggestedWords updateBigramPredictions() { - final CharSequence prevWord = mConnection.getThisWord(mCurrentSettings.mWordSeparators); + final CharSequence prevWord = + mConnection.getNthPreviousWord(mCurrentSettings.mWordSeparators, 1); return mSuggest.getSuggestedWords(mWordComposer, prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCurrentSettings.mCorrectionEnabled, true); @@ -1916,7 +1918,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final UserHistoryDictionary userHistoryDictionary = mUserHistoryDictionary; if (userHistoryDictionary != null) { final CharSequence prevWord - = mConnection.getPreviousWord(mCurrentSettings.mWordSeparators); + = mConnection.getNthPreviousWord(mCurrentSettings.mWordSeparators, 2); final String secondWord; if (mWordComposer.isAutoCapitalized() && !mWordComposer.isMostlyCaps()) { secondWord = suggestion.toString().toLowerCase( |