diff options
author | 2012-06-27 18:17:28 +0900 | |
---|---|---|
committer | 2012-06-27 18:17:28 +0900 | |
commit | 24eec0fa680f97e64d1fa0df754acbad95ed9a76 (patch) | |
tree | ff0a76566c158be238ab175ba2671c2af240c6d8 /java/src/com/android/inputmethod/latin/SuggestedWords.java | |
parent | d8f0caa406a0ca1df488baeb3af05528085755b7 (diff) | |
download | latinime-24eec0fa680f97e64d1fa0df754acbad95ed9a76.tar.gz latinime-24eec0fa680f97e64d1fa0df754acbad95ed9a76.tar.xz latinime-24eec0fa680f97e64d1fa0df754acbad95ed9a76.zip |
Remember the source dictionary for each suggestion.
Change-Id: I3c63372bd5572a479a67eaecfe8c8ea1cabc70d9
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestedWords.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/SuggestedWords.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index 9883cd6bc..f6926f3bb 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -92,7 +92,7 @@ public class SuggestedWords { for (CompletionInfo info : infos) { if (null != info && info.getText() != null) { result.add(new SuggestedWordInfo(info.getText(), SuggestedWordInfo.MAX_SCORE, - SuggestedWordInfo.KIND_APP_DEFINED)); + SuggestedWordInfo.KIND_APP_DEFINED, Dictionary.TYPE_APPLICATION_DEFINED)); } } return result; @@ -105,7 +105,7 @@ public class SuggestedWords { final ArrayList<SuggestedWordInfo> suggestionsList = new ArrayList<SuggestedWordInfo>(); final HashSet<String> alreadySeen = new HashSet<String>(); suggestionsList.add(new SuggestedWordInfo(typedWord, SuggestedWordInfo.MAX_SCORE, - SuggestedWordInfo.KIND_TYPED)); + SuggestedWordInfo.KIND_TYPED, Dictionary.TYPE_USER_TYPED)); alreadySeen.add(typedWord.toString()); final int previousSize = previousSuggestions.size(); for (int pos = 1; pos < previousSize; pos++) { @@ -135,13 +135,16 @@ public class SuggestedWords { public final int mScore; public final int mKind; // one of the KIND_* constants above public final int mCodePointCount; + public final String mSourceDict; private String mDebugString = ""; - public SuggestedWordInfo(final CharSequence word, final int score, final int kind) { + public SuggestedWordInfo(final CharSequence word, final int score, final int kind, + final String sourceDict) { mWordStr = word.toString(); mWord = word; mScore = score; mKind = kind; + mSourceDict = sourceDict; mCodePointCount = StringUtils.codePointCount(mWordStr); } |