mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Refactoring (A82)
The user history dictionary should be the one knowing it does not suggest words beyond 2 characters, not Suggest. Change-Id: Ie85ec6116eb495e0c7f51108e4620c5ae536f4bf
This commit is contained in:
parent
966efe4889
commit
fb6eeeb35a
@ -194,9 +194,8 @@ public class Suggest {
|
|||||||
}
|
}
|
||||||
// At second character typed, search the unigrams (scores being affected by bigrams)
|
// At second character typed, search the unigrams (scores being affected by bigrams)
|
||||||
for (final String key : mDictionaries.keySet()) {
|
for (final String key : mDictionaries.keySet()) {
|
||||||
// Skip UserUnigramDictionary and WhitelistDictionary to lookup
|
// Skip WhitelistDictionary to lookup
|
||||||
if (key.equals(Dictionary.TYPE_USER_HISTORY)
|
if (key.equals(Dictionary.TYPE_WHITELIST))
|
||||||
|| key.equals(Dictionary.TYPE_WHITELIST))
|
|
||||||
continue;
|
continue;
|
||||||
final Dictionary dictionary = mDictionaries.get(key);
|
final Dictionary dictionary = mDictionaries.get(key);
|
||||||
suggestionsSet.addAll(dictionary.getWords(
|
suggestionsSet.addAll(dictionary.getWords(
|
||||||
|
@ -27,9 +27,12 @@ import android.os.AsyncTask;
|
|||||||
import android.provider.BaseColumns;
|
import android.provider.BaseColumns;
|
||||||
import android.util.Log;
|
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 com.android.inputmethod.latin.UserHistoryForgettingCurveUtils.ForgettingCurveParams;
|
||||||
|
|
||||||
import java.lang.ref.SoftReference;
|
import java.lang.ref.SoftReference;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
@ -157,6 +160,14 @@ public class UserHistoryDictionary extends ExpandableDictionary {
|
|||||||
// super.close();
|
// 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.
|
* Return whether the passed charsequence is in the dictionary.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user