aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-02-10 20:53:58 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-02-17 13:59:41 +0900
commit887f11ee43ad621aa6ad93d535ab7f48dec73fc7 (patch)
tree87d898cdf40cb1f5483bc87c4ad427aa98bd46a5 /java/src/com/android/inputmethod/latin/Suggest.java
parenta7b2ac26ee2b9aef6f8cd95849c7d8edbff5082b (diff)
downloadlatinime-887f11ee43ad621aa6ad93d535ab7f48dec73fc7.tar.gz
latinime-887f11ee43ad621aa6ad93d535ab7f48dec73fc7.tar.xz
latinime-887f11ee43ad621aa6ad93d535ab7f48dec73fc7.zip
Remove next letters frequency handling
Bug: 3428942 Change-Id: Id62f467ce4e50c60a56d59bf96770e799a4659e2
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java26
1 files changed, 6 insertions, 20 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index c9e57d0a5..6466f7980 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -87,12 +87,6 @@ public class Suggest implements Dictionary.WordCallback {
private int[] mPriorities = new int[mPrefMaxSuggestions];
private int[] mBigramPriorities = new int[PREF_MAX_BIGRAMS];
- // Handle predictive correction for only the first 1280 characters for performance reasons
- // If we support scripts that need latin characters beyond that, we should probably use some
- // kind of a sparse array or language specific list with a mapping lookup table.
- // 1280 is the size of the BASE_CHARS array in ExpandableDictionary, which is a basic set of
- // latin characters.
- private int[] mNextLettersFrequencies = new int[1280];
private ArrayList<CharSequence> mSuggestions = new ArrayList<CharSequence>();
ArrayList<CharSequence> mBigramSuggestions = new ArrayList<CharSequence>();
private ArrayList<CharSequence> mStringPool = new ArrayList<CharSequence>();
@@ -216,7 +210,6 @@ public class Suggest implements Dictionary.WordCallback {
mIsAllUpperCase = wordComposer.isAllUpperCase();
collectGarbage(mSuggestions, mPrefMaxSuggestions);
Arrays.fill(mPriorities, 0);
- Arrays.fill(mNextLettersFrequencies, 0);
// Save a lowercase version of the original word
CharSequence typedWord = wordComposer.getTypedWord();
@@ -244,16 +237,13 @@ public class Suggest implements Dictionary.WordCallback {
prevWordForBigram = lowerPrevWord;
}
if (mUserBigramDictionary != null) {
- mUserBigramDictionary.getBigrams(wordComposer, prevWordForBigram, this,
- mNextLettersFrequencies);
+ mUserBigramDictionary.getBigrams(wordComposer, prevWordForBigram, this);
}
if (mContactsDictionary != null) {
- mContactsDictionary.getBigrams(wordComposer, prevWordForBigram, this,
- mNextLettersFrequencies);
+ mContactsDictionary.getBigrams(wordComposer, prevWordForBigram, this);
}
if (mMainDict != null) {
- mMainDict.getBigrams(wordComposer, prevWordForBigram, this,
- mNextLettersFrequencies);
+ mMainDict.getBigrams(wordComposer, prevWordForBigram, this);
}
char currentChar = wordComposer.getTypedWord().charAt(0);
char currentCharUpper = Character.toUpperCase(currentChar);
@@ -278,10 +268,10 @@ public class Suggest implements Dictionary.WordCallback {
// At second character typed, search the unigrams (scores being affected by bigrams)
if (mUserDictionary != null || mContactsDictionary != null) {
if (mUserDictionary != null) {
- mUserDictionary.getWords(wordComposer, this, mNextLettersFrequencies);
+ mUserDictionary.getWords(wordComposer, this);
}
if (mContactsDictionary != null) {
- mContactsDictionary.getWords(wordComposer, this, mNextLettersFrequencies);
+ mContactsDictionary.getWords(wordComposer, this);
}
if (mSuggestions.size() > 0 && isValidWord(typedWord)
@@ -293,7 +283,7 @@ public class Suggest implements Dictionary.WordCallback {
mHasAutoCorrection = true;
}
}
- if (mMainDict != null) mMainDict.getWords(wordComposer, this, mNextLettersFrequencies);
+ if (mMainDict != null) mMainDict.getWords(wordComposer, this);
if ((mCorrectionMode == CORRECTION_FULL || mCorrectionMode == CORRECTION_FULL_BIGRAM)
&& mSuggestions.size() > 0 && mPriorities.length > 0) {
// TODO: when the normalized score of the first suggestion is nearly equals to
@@ -388,10 +378,6 @@ public class Suggest implements Dictionary.WordCallback {
}
}
- public int[] getNextLettersFrequencies() {
- return mNextLettersFrequencies;
- }
-
private void removeDupes() {
final ArrayList<CharSequence> suggestions = mSuggestions;
if (suggestions.size() < 2) return;