aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-01-09 19:51:15 +0900
committerJean Chalard <jchalard@google.com>2014-01-16 03:22:51 +0900
commite22e67e37a4a9b493db7c29078d9d63667413e5f (patch)
treeefc2716e062ab390ab35322c708f5404dd1fb48e /java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
parent4752b68f5a62ede099677bdea0514ba1d5082606 (diff)
downloadlatinime-e22e67e37a4a9b493db7c29078d9d63667413e5f.tar.gz
latinime-e22e67e37a4a9b493db7c29078d9d63667413e5f.tar.xz
latinime-e22e67e37a4a9b493db7c29078d9d63667413e5f.zip
[IL57] Don't require a main dict suggestion.
This is bad for recorrection (it will ignore recorrection suggestions). But if you think about it well, if you didn't have a main dict, then you probably will compute the same stuff anyway. It's not useful to make this check at all. Bug: 12297051 Change-Id: I6d6cf4d9353b7c668c5413c67701563b243e585c
Diffstat (limited to 'java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java')
-rw-r--r--java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java12
1 files changed, 0 insertions, 12 deletions
diff --git a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
index b8d1651dc..a32d76c30 100644
--- a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
+++ b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
@@ -74,7 +74,6 @@ public final class SuggestionSpanUtils {
return pickedWord;
}
- boolean hasSuggestionFromMainDictionary = false;
final ArrayList<String> suggestionsList = CollectionUtils.newArrayList();
for (int i = 0; i < suggestedWords.size(); ++i) {
if (suggestionsList.size() >= SuggestionSpan.SUGGESTIONS_MAX_SIZE) {
@@ -84,22 +83,11 @@ public final class SuggestionSpanUtils {
if (info.mKind == SuggestedWordInfo.KIND_PREDICTION) {
continue;
}
- if (info.mSourceDict.mDictType == Dictionary.TYPE_MAIN) {
- hasSuggestionFromMainDictionary = true;
- }
final String word = suggestedWords.getWord(i);
if (!TextUtils.equals(pickedWord, word)) {
suggestionsList.add(word.toString());
}
}
- if (!hasSuggestionFromMainDictionary) {
- // If we don't have any suggestions from the dictionary, it probably looks bad
- // enough as it is already because suggestions come pretty much only from contacts.
- // Let's not embed these bad suggestions in the text view so as to avoid using
- // them with recorrection.
- return pickedWord;
- }
-
final SuggestionSpan suggestionSpan = new SuggestionSpan(context, null /* locale */,
suggestionsList.toArray(new String[suggestionsList.size()]), 0 /* flags */,
SuggestionSpanPickedNotificationReceiver.class);