Simplification

Change-Id: Ibced83da2398f1e9ab6a0d6a22c2ad7c8f25cb7b
main
Jean Chalard 2012-03-08 19:50:47 +09:00
parent 0f1efae262
commit 2bb29c4674
1 changed files with 1 additions and 6 deletions

View File

@ -25,18 +25,16 @@ import java.util.Map;
public class AutoCorrection {
private static final boolean DBG = LatinImeLogger.sDBG;
private static final String TAG = AutoCorrection.class.getSimpleName();
private boolean mHasAutoCorrection;
private CharSequence mAutoCorrectionWord;
private double mNormalizedScore;
public void init() {
mHasAutoCorrection = false;
mAutoCorrectionWord = null;
mNormalizedScore = Integer.MIN_VALUE;
}
public boolean hasAutoCorrection() {
return mHasAutoCorrection;
return null != mAutoCorrectionWord;
}
public CharSequence getAutoCorrectionWord() {
@ -52,15 +50,12 @@ public class AutoCorrection {
CharSequence typedWord, double autoCorrectionThreshold, int correctionMode,
CharSequence whitelistedWord) {
if (hasAutoCorrectionForWhitelistedWord(whitelistedWord)) {
mHasAutoCorrection = true;
mAutoCorrectionWord = whitelistedWord;
} else if (hasAutoCorrectionForTypedWord(
dictionaries, wordComposer, suggestions, typedWord, correctionMode)) {
mHasAutoCorrection = true;
mAutoCorrectionWord = typedWord;
} else if (hasAutoCorrectionForBinaryDictionary(wordComposer, suggestions, correctionMode,
sortedScores, typedWord, autoCorrectionThreshold)) {
mHasAutoCorrection = true;
mAutoCorrectionWord = suggestions.get(0);
}
}