aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-03-09 12:33:23 +0900
committerJean Chalard <jchalard@google.com>2012-03-09 12:33:23 +0900
commitdc5dfe37e06eb1d550d7aa5156cff226334d4e1e (patch)
treec5d2d5c3f55f9ff17b8aa6a77c5db9fba475523d /java/src
parent23a5e9d1a78f42e76996e756fd1d6a37fc2ac679 (diff)
downloadlatinime-dc5dfe37e06eb1d550d7aa5156cff226334d4e1e.tar.gz
latinime-dc5dfe37e06eb1d550d7aa5156cff226334d4e1e.tar.xz
latinime-dc5dfe37e06eb1d550d7aa5156cff226334d4e1e.zip
Move some code around (B1)
The goal is to make the creation of the Builder closer to the #build() call Change-Id: I48d76d4efdc180479829016582edd9de47e7332c
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 73a96895f..1a164c6f8 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1816,20 +1816,21 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
} else {
prevWord = EditingUtils.getPreviousWord(ic, mSettingsValues.mWordSeparators);
}
+
+ final CharSequence typedWord = mWordComposer.getTypedWord();
+ final int quotesCount = mWordComposer.trailingSingleQuotesCount();
// getSuggestedWordBuilder handles gracefully a null value of prevWord
final SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(mWordComposer,
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCorrectionMode);
boolean autoCorrectionAvailable = !mInputAttributes.mInputTypeNoAutoCorrect
&& mSuggest.hasAutoCorrection();
- final CharSequence typedWord = mWordComposer.getTypedWord();
// Here, we want to promote a whitelisted word if exists.
// TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid"
// but still autocorrected from - in the case the whitelist only capitalizes the word.
// The whitelist should be case-insensitive, so it's not possible to be consistent with
// a boolean flag. Right now this is handled with a slight hack in
// WhitelistDictionary#shouldForciblyAutoCorrectFrom.
- final int quotesCount = mWordComposer.trailingSingleQuotesCount();
final boolean allowsToBeAutoCorrected = AutoCorrection.allowsToBeAutoCorrected(
mSuggest.getUnigramDictionaries(),
// If the typed string ends with a single quote, for dictionary lookup purposes