From c5e911c06b2ab21d3fd2026a307727dccdca911c Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 28 Jun 2012 20:34:06 +0900 Subject: Consolidate a method inside another (A45) It's simpler to check the safety net directly inside the function that checks for auto-correction threshold. This introduces one very slight change in behavior. The value checked by the safety net is not any more the "typed word" but the "considered word", the difference being any possibly appended single quotes. E.g. the user types "this'''" : the typed word is "this'''" but the considered word is "this". This change in behavior can be considered a bugfix. Change-Id: Ia7ab4bc933183dfbd41bb00328e4c0b5ab76bc63 --- java/src/com/android/inputmethod/latin/AutoCorrection.java | 3 ++- java/src/com/android/inputmethod/latin/Suggest.java | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/AutoCorrection.java b/java/src/com/android/inputmethod/latin/AutoCorrection.java index 8fa346953..c78974dac 100644 --- a/java/src/com/android/inputmethod/latin/AutoCorrection.java +++ b/java/src/com/android/inputmethod/latin/AutoCorrection.java @@ -108,7 +108,8 @@ public class AutoCorrection { if (DBG) { Log.d(TAG, "Auto corrected by S-threshold."); } - return true; + return !shouldBlockAutoCorrectionBySafetyNet(consideredWord.toString(), + suggestion.mWord); } } return false; diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index ccbb84f35..dcfda86ea 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -241,8 +241,7 @@ public class Suggest { hasAutoCorrection = false; } else if (AutoCorrection.suggestionExceedsAutoCorrectionThreshold(suggestionsSet.first(), consideredWord, mAutoCorrectionThreshold)) { - hasAutoCorrection = !AutoCorrection.shouldBlockAutoCorrectionBySafetyNet(typedWord, - suggestionsSet.first().mWord); + hasAutoCorrection = true; } else { hasAutoCorrection = false; } -- cgit v1.2.3-83-g751a