Simplification
Change-Id: Ibced83da2398f1e9ab6a0d6a22c2ad7c8f25cb7b
This commit is contained in:
parent
0f1efae262
commit
2bb29c4674
1 changed files with 1 additions and 6 deletions
|
@ -25,18 +25,16 @@ import java.util.Map;
|
||||||
public class AutoCorrection {
|
public class AutoCorrection {
|
||||||
private static final boolean DBG = LatinImeLogger.sDBG;
|
private static final boolean DBG = LatinImeLogger.sDBG;
|
||||||
private static final String TAG = AutoCorrection.class.getSimpleName();
|
private static final String TAG = AutoCorrection.class.getSimpleName();
|
||||||
private boolean mHasAutoCorrection;
|
|
||||||
private CharSequence mAutoCorrectionWord;
|
private CharSequence mAutoCorrectionWord;
|
||||||
private double mNormalizedScore;
|
private double mNormalizedScore;
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
mHasAutoCorrection = false;
|
|
||||||
mAutoCorrectionWord = null;
|
mAutoCorrectionWord = null;
|
||||||
mNormalizedScore = Integer.MIN_VALUE;
|
mNormalizedScore = Integer.MIN_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasAutoCorrection() {
|
public boolean hasAutoCorrection() {
|
||||||
return mHasAutoCorrection;
|
return null != mAutoCorrectionWord;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CharSequence getAutoCorrectionWord() {
|
public CharSequence getAutoCorrectionWord() {
|
||||||
|
@ -52,15 +50,12 @@ public class AutoCorrection {
|
||||||
CharSequence typedWord, double autoCorrectionThreshold, int correctionMode,
|
CharSequence typedWord, double autoCorrectionThreshold, int correctionMode,
|
||||||
CharSequence whitelistedWord) {
|
CharSequence whitelistedWord) {
|
||||||
if (hasAutoCorrectionForWhitelistedWord(whitelistedWord)) {
|
if (hasAutoCorrectionForWhitelistedWord(whitelistedWord)) {
|
||||||
mHasAutoCorrection = true;
|
|
||||||
mAutoCorrectionWord = whitelistedWord;
|
mAutoCorrectionWord = whitelistedWord;
|
||||||
} else if (hasAutoCorrectionForTypedWord(
|
} else if (hasAutoCorrectionForTypedWord(
|
||||||
dictionaries, wordComposer, suggestions, typedWord, correctionMode)) {
|
dictionaries, wordComposer, suggestions, typedWord, correctionMode)) {
|
||||||
mHasAutoCorrection = true;
|
|
||||||
mAutoCorrectionWord = typedWord;
|
mAutoCorrectionWord = typedWord;
|
||||||
} else if (hasAutoCorrectionForBinaryDictionary(wordComposer, suggestions, correctionMode,
|
} else if (hasAutoCorrectionForBinaryDictionary(wordComposer, suggestions, correctionMode,
|
||||||
sortedScores, typedWord, autoCorrectionThreshold)) {
|
sortedScores, typedWord, autoCorrectionThreshold)) {
|
||||||
mHasAutoCorrection = true;
|
|
||||||
mAutoCorrectionWord = suggestions.get(0);
|
mAutoCorrectionWord = suggestions.get(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue