Inline a method (A17)
This will allow us to remove unnecessary processing Change-Id: I251dfdaffb077906186686ebe65fd82e1e360bd2
This commit is contained in:
parent
42dde06782
commit
b01cdb975a
2 changed files with 2 additions and 8 deletions
|
@ -88,13 +88,6 @@ public class AutoCorrection {
|
||||||
return !isValidWord(dictionaries, word, ignoreCase);
|
return !isValidWord(dictionaries, word, ignoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean shouldAutoCorrectToSelf(
|
|
||||||
final ConcurrentHashMap<String, Dictionary> dictionaries,
|
|
||||||
final CharSequence consideredWord) {
|
|
||||||
return (!TextUtils.isEmpty(consideredWord) && !allowsToBeAutoCorrected(dictionaries,
|
|
||||||
consideredWord, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean hasAutoCorrectionForBinaryDictionary(SuggestedWordInfo suggestion,
|
public static boolean hasAutoCorrectionForBinaryDictionary(SuggestedWordInfo suggestion,
|
||||||
CharSequence consideredWord, float autoCorrectionThreshold) {
|
CharSequence consideredWord, float autoCorrectionThreshold) {
|
||||||
if (null != suggestion) {
|
if (null != suggestion) {
|
||||||
|
|
|
@ -233,7 +233,8 @@ public class Suggest {
|
||||||
final CharSequence autoCorrection;
|
final CharSequence autoCorrection;
|
||||||
if (null != whitelistedWord) {
|
if (null != whitelistedWord) {
|
||||||
autoCorrection = whitelistedWord;
|
autoCorrection = whitelistedWord;
|
||||||
} else if (AutoCorrection.shouldAutoCorrectToSelf(mDictionaries, consideredWord)) {
|
} else if (!TextUtils.isEmpty(consideredWord) &&
|
||||||
|
!AutoCorrection.allowsToBeAutoCorrected(mDictionaries, consideredWord, false)) {
|
||||||
autoCorrection = consideredWord;
|
autoCorrection = consideredWord;
|
||||||
} else if (AutoCorrection.hasAutoCorrectionForBinaryDictionary(bestSuggestion,
|
} else if (AutoCorrection.hasAutoCorrectionForBinaryDictionary(bestSuggestion,
|
||||||
consideredWord, mAutoCorrectionThreshold)) {
|
consideredWord, mAutoCorrectionThreshold)) {
|
||||||
|
|
Loading…
Reference in a new issue