Refactoring (A82)

The user history dictionary should be the one knowing it does not suggest words
beyond 2 characters, not Suggest.

Change-Id: Ie85ec6116eb495e0c7f51108e4620c5ae536f4bf
main
Jean Chalard 2012-07-09 15:14:19 +09:00
parent 966efe4889
commit fb6eeeb35a
2 changed files with 13 additions and 3 deletions

View File

@ -194,9 +194,8 @@ public class Suggest {
}
// At second character typed, search the unigrams (scores being affected by bigrams)
for (final String key : mDictionaries.keySet()) {
// Skip UserUnigramDictionary and WhitelistDictionary to lookup
if (key.equals(Dictionary.TYPE_USER_HISTORY)
|| key.equals(Dictionary.TYPE_WHITELIST))
// Skip WhitelistDictionary to lookup
if (key.equals(Dictionary.TYPE_WHITELIST))
continue;
final Dictionary dictionary = mDictionaries.get(key);
suggestionsSet.addAll(dictionary.getWords(

View File

@ -27,9 +27,12 @@ import android.os.AsyncTask;
import android.provider.BaseColumns;
import android.util.Log;
import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import com.android.inputmethod.latin.UserHistoryForgettingCurveUtils.ForgettingCurveParams;
import java.lang.ref.SoftReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;
@ -157,6 +160,14 @@ public class UserHistoryDictionary extends ExpandableDictionary {
// super.close();
}
@Override
public ArrayList<SuggestedWordInfo> getWords(final WordComposer composer,
final CharSequence prevWord, final ProximityInfo proximityInfo) {
// User history unigrams are not used at this moment. Implement this method to make them
// useful.
return null;
}
/**
* Return whether the passed charsequence is in the dictionary.
*/