aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SuggestedWords.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-02-05 23:35:20 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-02-05 23:35:20 -0800
commitcf398ac4f5fa3a145261663d9b04fab65ec357f1 (patch)
treed0139ea488de7c179e600116b95aa1982e610237 /java/src/com/android/inputmethod/latin/SuggestedWords.java
parente02805d90a4fbe0288932d127c127da8a70fdc6e (diff)
parenta9e1930a6a9ce2e53cf9b47e8b0033b763416183 (diff)
downloadlatinime-cf398ac4f5fa3a145261663d9b04fab65ec357f1.tar.gz
latinime-cf398ac4f5fa3a145261663d9b04fab65ec357f1.tar.xz
latinime-cf398ac4f5fa3a145261663d9b04fab65ec357f1.zip
am a9e1930a: Merge "Conditionally store the raw suggestions."
* commit 'a9e1930a6a9ce2e53cf9b47e8b0033b763416183': Conditionally store the raw suggestions.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestedWords.java')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestedWords.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index dbaf822e4..b2efc4a86 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -37,7 +37,7 @@ public final class SuggestedWords {
private static final ArrayList<SuggestedWordInfo> EMPTY_WORD_INFO_LIST =
CollectionUtils.newArrayList(0);
public static final SuggestedWords EMPTY = new SuggestedWords(
- EMPTY_WORD_INFO_LIST, false, false, false, false, false);
+ EMPTY_WORD_INFO_LIST, null /* rawSuggestions */, false, false, false, false, false);
public final String mTypedWord;
public final boolean mTypedWordValid;
@@ -50,25 +50,29 @@ public final class SuggestedWords {
public final boolean mIsPrediction;
public final int mSequenceNumber; // Sequence number for auto-commit.
private final ArrayList<SuggestedWordInfo> mSuggestedWordInfoList;
+ public final ArrayList<SuggestedWordInfo> mRawSuggestions;
public SuggestedWords(final ArrayList<SuggestedWordInfo> suggestedWordInfoList,
+ final ArrayList<SuggestedWordInfo> rawSuggestions,
final boolean typedWordValid,
final boolean willAutoCorrect,
final boolean isPunctuationSuggestions,
final boolean isObsoleteSuggestions,
final boolean isPrediction) {
- this(suggestedWordInfoList, typedWordValid, willAutoCorrect, isPunctuationSuggestions,
- isObsoleteSuggestions, isPrediction, NOT_A_SEQUENCE_NUMBER);
+ this(suggestedWordInfoList, rawSuggestions, typedWordValid, willAutoCorrect,
+ isPunctuationSuggestions, isObsoleteSuggestions, isPrediction,
+ NOT_A_SEQUENCE_NUMBER);
}
public SuggestedWords(final ArrayList<SuggestedWordInfo> suggestedWordInfoList,
+ final ArrayList<SuggestedWordInfo> rawSuggestions,
final boolean typedWordValid,
final boolean willAutoCorrect,
final boolean isPunctuationSuggestions,
final boolean isObsoleteSuggestions,
final boolean isPrediction,
final int sequenceNumber) {
- this(suggestedWordInfoList,
+ this(suggestedWordInfoList, rawSuggestions,
suggestedWordInfoList.isEmpty() ? null
: suggestedWordInfoList.get(INDEX_OF_TYPED_WORD).mWord,
typedWordValid, willAutoCorrect, isPunctuationSuggestions,
@@ -76,6 +80,7 @@ public final class SuggestedWords {
}
public SuggestedWords(final ArrayList<SuggestedWordInfo> suggestedWordInfoList,
+ final ArrayList<SuggestedWordInfo> rawSuggestions,
final String typedWord,
final boolean typedWordValid,
final boolean willAutoCorrect,
@@ -84,6 +89,7 @@ public final class SuggestedWords {
final boolean isPrediction,
final int sequenceNumber) {
mSuggestedWordInfoList = suggestedWordInfoList;
+ mRawSuggestions = rawSuggestions;
mTypedWordValid = typedWordValid;
mWillAutoCorrect = willAutoCorrect;
mIsPunctuationSuggestions = isPunctuationSuggestions;
@@ -306,9 +312,9 @@ public final class SuggestedWords {
}
// We should never autocorrect, so we say the typed word is valid. Also, in this case,
// no auto-correction should take place hence willAutoCorrect = false.
- return new SuggestedWords(newSuggestions, typedWord, true /* typedWordValid */,
- false /* willAutoCorrect */, mIsPunctuationSuggestions, mIsObsoleteSuggestions,
- mIsPrediction, NOT_A_SEQUENCE_NUMBER);
+ return new SuggestedWords(newSuggestions, null /* rawSuggestions */, typedWord,
+ true /* typedWordValid */, false /* willAutoCorrect */, mIsPunctuationSuggestions,
+ mIsObsoleteSuggestions, mIsPrediction, NOT_A_SEQUENCE_NUMBER);
}
// Creates a new SuggestedWordInfo from the currently suggested words that removes all but the
@@ -326,7 +332,7 @@ public final class SuggestedWords {
info.mSourceDict, SuggestedWordInfo.NOT_AN_INDEX,
SuggestedWordInfo.NOT_A_CONFIDENCE));
}
- return new SuggestedWords(newSuggestions, mTypedWordValid,
+ return new SuggestedWords(newSuggestions, null /* rawSuggestions */, mTypedWordValid,
mWillAutoCorrect, mIsPunctuationSuggestions, mIsObsoleteSuggestions,
mIsPrediction);
}