aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-06-13 01:10:18 +0900
committerJean Chalard <jchalard@google.com>2012-06-16 03:10:36 +0900
commite7d2ee3ec310a3991f07d20994871bb0dc84941a (patch)
tree21c17257b7af082186472e1ea9f28330729b1306 /java/src/com/android/inputmethod/latin/Suggest.java
parente21a092beca888a56912b57154d5b3c21591d5e7 (diff)
downloadlatinime-e7d2ee3ec310a3991f07d20994871bb0dc84941a.tar.gz
latinime-e7d2ee3ec310a3991f07d20994871bb0dc84941a.tar.xz
latinime-e7d2ee3ec310a3991f07d20994871bb0dc84941a.zip
Add a kind to the suggestion for bookkeeping (A1)
This will help for debug as well as serve as groundwork for Bug: 6252660 Bug: 6166228 Bug: 2704000 Bug: 6225530 Change-Id: I74d0a7b943fb22c514ad79dc064d69ddf336d3ef
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 68b7b913f..5b9d4a949 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -335,15 +335,16 @@ public class Suggest implements Dictionary.WordCallback {
for (int i = mTrailingSingleQuotesCount - 1; i >= 0; --i) {
sb.appendCodePoint(Keyboard.CODE_SINGLE_QUOTE);
}
- mSuggestions.add(0, new SuggestedWordInfo(
- sb.toString(), SuggestedWordInfo.MAX_SCORE));
+ mSuggestions.add(0, new SuggestedWordInfo(sb.toString(),
+ SuggestedWordInfo.MAX_SCORE, SuggestedWordInfo.KIND_WHITELIST));
} else {
- mSuggestions.add(0, new SuggestedWordInfo(
- whitelistedWord, SuggestedWordInfo.MAX_SCORE));
+ mSuggestions.add(0, new SuggestedWordInfo(whitelistedWord,
+ SuggestedWordInfo.MAX_SCORE, SuggestedWordInfo.KIND_WHITELIST));
}
}
- mSuggestions.add(0, new SuggestedWordInfo(typedWord, SuggestedWordInfo.MAX_SCORE));
+ mSuggestions.add(0, new SuggestedWordInfo(typedWord, SuggestedWordInfo.MAX_SCORE,
+ SuggestedWordInfo.KIND_TYPED));
SuggestedWordInfo.removeDups(mSuggestions);
final ArrayList<SuggestedWordInfo> suggestionsList;
@@ -495,7 +496,8 @@ public class Suggest implements Dictionary.WordCallback {
for (int i = mTrailingSingleQuotesCount - 1; i >= 0; --i) {
sb.appendCodePoint(Keyboard.CODE_SINGLE_QUOTE);
}
- suggestions.add(pos, new SuggestedWordInfo(sb, score));
+ // TODO: figure out what type of suggestion this is
+ suggestions.add(pos, new SuggestedWordInfo(sb, score, SuggestedWordInfo.KIND_CORRECTION));
if (suggestions.size() > prefMaxSuggestions) {
suggestions.remove(prefMaxSuggestions);
} else {