aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2009-07-17 12:51:45 -0700
committerJean-Baptiste Queru <jbq@google.com>2009-08-13 17:17:58 -0700
commit34386e698876c0f29b2d5b54b44db1e32b562c47 (patch)
tree054b8415450bffe5c6872ce010e42aa6f5a47265 /src/com/android/inputmethod/latin/Suggest.java
parent322dc3d3f3b3ab5b1eacc8ef8cc0fcd7cbed97e3 (diff)
downloadlatinime-34386e698876c0f29b2d5b54b44db1e32b562c47.tar.gz
latinime-34386e698876c0f29b2d5b54b44db1e32b562c47.tar.xz
latinime-34386e698876c0f29b2d5b54b44db1e32b562c47.zip
Auto add new words to the user dictionary.
First pass at automatically adding new words that the user types and deliberately accepts. After typing the word 4 times, the word gets promoted to being valid. After typing the word 7 times, the word gets added into the UserDictionary and can be removed from the UserDictionary Settings UI. Also add a second row of symbols to the period popup.
Diffstat (limited to 'src/com/android/inputmethod/latin/Suggest.java')
-rwxr-xr-xsrc/com/android/inputmethod/latin/Suggest.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/android/inputmethod/latin/Suggest.java b/src/com/android/inputmethod/latin/Suggest.java
index 91decd66a..9926c2c1c 100755
--- a/src/com/android/inputmethod/latin/Suggest.java
+++ b/src/com/android/inputmethod/latin/Suggest.java
@@ -36,13 +36,15 @@ public class Suggest implements Dictionary.WordCallback {
public static final int CORRECTION_NONE = 0;
public static final int CORRECTION_BASIC = 1;
public static final int CORRECTION_FULL = 2;
-
+
private Dictionary mMainDict;
-
+
private Dictionary mUserDictionary;
-
+
+ private Dictionary mAutoDictionary;
+
private int mPrefMaxSuggestions = 12;
-
+
private int[] mPriorities = new int[mPrefMaxSuggestions];
private List<CharSequence> mSuggestions = new ArrayList<CharSequence>();
private boolean mIncludeTypedWordIfValid;
@@ -63,11 +65,11 @@ public class Suggest implements Dictionary.WordCallback {
mStringPool.add(sb);
}
}
-
+
public int getCorrectionMode() {
return mCorrectionMode;
}
-
+
public void setCorrectionMode(int mode) {
mCorrectionMode = mode;
}
@@ -79,6 +81,10 @@ public class Suggest implements Dictionary.WordCallback {
public void setUserDictionary(Dictionary userDictionary) {
mUserDictionary = userDictionary;
}
+
+ public void setAutoDictionary(Dictionary autoDictionary) {
+ mAutoDictionary = autoDictionary;
+ }
/**
* Number of suggestions to generate from the input key sequence. This has
@@ -256,7 +262,8 @@ public class Suggest implements Dictionary.WordCallback {
}
return (mCorrectionMode == CORRECTION_FULL && mMainDict.isValidWord(word))
|| (mCorrectionMode > CORRECTION_NONE &&
- (mUserDictionary != null && mUserDictionary.isValidWord(word)));
+ ((mUserDictionary != null && mUserDictionary.isValidWord(word)))
+ || (mAutoDictionary != null && mAutoDictionary.isValidWord(word)));
}
private void collectGarbage() {