aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-07-11 18:47:35 +0900
committerJean Chalard <jchalard@google.com>2012-07-12 15:58:16 +0900
commit1343d27de30c4010c54576d6c8bbb052c7630cbe (patch)
tree058f030ae00a9568ee211269a9bf277c78318652 /java/src
parent24a63b5537ea4872ec10676d147ddccabda6a1f6 (diff)
downloadlatinime-1343d27de30c4010c54576d6c8bbb052c7630cbe.tar.gz
latinime-1343d27de30c4010c54576d6c8bbb052c7630cbe.tar.xz
latinime-1343d27de30c4010c54576d6c8bbb052c7630cbe.zip
Readability improvement (A117)
Change-Id: I6f8bb05a23edb40a079da60b7136170ec9043282
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 7dbba9454..31566bf13 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -219,6 +219,7 @@ public class Suggest {
// the current settings. It may also be useful to know, when the setting is off, whether
// the word *would* have been auto-corrected.
if (!isCorrectionEnabled || !allowsToBeAutoCorrected || !wordComposer.isComposingWord()
+ || suggestionsSet.isEmpty()
|| wordComposer.isMostlyCaps() || wordComposer.isResumed()
|| !hasMainDictionary()) {
// If we don't have a main dictionary, we never want to auto-correct. The reason for
@@ -228,13 +229,9 @@ public class Suggest {
// would always auto-correct to "Will" which is unwanted. Hence, no main dict => no
// auto-correct.
hasAutoCorrection = false;
- } else if (suggestionsSet.isEmpty()) {
- hasAutoCorrection = false;
- } else if (AutoCorrection.suggestionExceedsAutoCorrectionThreshold(suggestionsSet.first(),
- consideredWord, mAutoCorrectionThreshold)) {
- hasAutoCorrection = true;
} else {
- hasAutoCorrection = false;
+ hasAutoCorrection = AutoCorrection.suggestionExceedsAutoCorrectionThreshold(
+ suggestionsSet.first(), consideredWord, mAutoCorrectionThreshold);
}
final ArrayList<SuggestedWordInfo> suggestionsContainer =