aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SuggestedWords.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-06-30 10:09:21 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-07-01 00:46:34 +0900
commit74b6897a12ec603ef835aaa77a01f0c32f49aa1c (patch)
tree22978a376ab93eb69c3e2ae7ee145f414287754b /java/src/com/android/inputmethod/latin/SuggestedWords.java
parenta65d84ce81725a77a4864be18d2ca14ac095d4c8 (diff)
downloadlatinime-74b6897a12ec603ef835aaa77a01f0c32f49aa1c.tar.gz
latinime-74b6897a12ec603ef835aaa77a01f0c32f49aa1c.tar.xz
latinime-74b6897a12ec603ef835aaa77a01f0c32f49aa1c.zip
Adaptive suggestions strip
Bug: 4903845 Change-Id: I9e2e17a9eee72df5c92414dcd4796ed7fe1655e1
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestedWords.java')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestedWords.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index a8cdfc02e..84db17504 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -24,15 +24,17 @@ import java.util.HashSet;
import java.util.List;
public class SuggestedWords {
- public static final SuggestedWords EMPTY = new SuggestedWords(null, false, false, null);
+ public static final SuggestedWords EMPTY = new SuggestedWords(null, false, false, false, null);
public final List<CharSequence> mWords;
public final boolean mTypedWordValid;
public final boolean mHasMinimalSuggestion;
+ public final boolean mIsPunctuationSuggestions;
public final List<SuggestedWordInfo> mSuggestedWordInfoList;
private SuggestedWords(List<CharSequence> words, boolean typedWordValid,
- boolean hasMinimalSuggestion, List<SuggestedWordInfo> suggestedWordInfoList) {
+ boolean hasMinimalSuggestion, boolean isPunctuationSuggestions,
+ List<SuggestedWordInfo> suggestedWordInfoList) {
if (words != null) {
mWords = words;
} else {
@@ -40,6 +42,7 @@ public class SuggestedWords {
}
mTypedWordValid = typedWordValid;
mHasMinimalSuggestion = hasMinimalSuggestion;
+ mIsPunctuationSuggestions = isPunctuationSuggestions;
mSuggestedWordInfoList = suggestedWordInfoList;
}
@@ -59,10 +62,15 @@ public class SuggestedWords {
return mHasMinimalSuggestion && ((size() > 1 && !mTypedWordValid) || mTypedWordValid);
}
+ public boolean isPunctuationSuggestions() {
+ return mIsPunctuationSuggestions;
+ }
+
public static class Builder {
private List<CharSequence> mWords = new ArrayList<CharSequence>();
private boolean mTypedWordValid;
private boolean mHasMinimalSuggestion;
+ private boolean mIsPunctuationSuggestions;
private List<SuggestedWordInfo> mSuggestedWordInfoList =
new ArrayList<SuggestedWordInfo>();
@@ -118,6 +126,11 @@ public class SuggestedWords {
return this;
}
+ public Builder setIsPunctuationSuggestions() {
+ mIsPunctuationSuggestions = true;
+ return this;
+ }
+
// Should get rid of the first one (what the user typed previously) from suggestions
// and replace it with what the user currently typed.
public Builder addTypedWordAndPreviousSuggestions(CharSequence typedWord,
@@ -143,7 +156,7 @@ public class SuggestedWords {
public SuggestedWords build() {
return new SuggestedWords(mWords, mTypedWordValid, mHasMinimalSuggestion,
- mSuggestedWordInfoList);
+ mIsPunctuationSuggestions, mSuggestedWordInfoList);
}
public int size() {