aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Dictionary.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Dictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Dictionary.java32
1 files changed, 22 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/Dictionary.java b/java/src/com/android/inputmethod/latin/Dictionary.java
index e66847b56..7d7ed77e7 100644
--- a/java/src/com/android/inputmethod/latin/Dictionary.java
+++ b/java/src/com/android/inputmethod/latin/Dictionary.java
@@ -17,8 +17,8 @@
package com.android.inputmethod.latin;
import com.android.inputmethod.annotations.UsedForTesting;
-import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
+import com.android.inputmethod.latin.common.ComposedData;
import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import java.util.ArrayList;
@@ -72,9 +72,13 @@ public abstract class Dictionary {
* Set out of the dictionary types listed above that are based on data specific to the user,
* e.g., the user's contacts.
*/
- private static final HashSet<String> sUserSpecificDictionaryTypes =
- new HashSet(Arrays.asList(new String[] { TYPE_USER_TYPED, TYPE_USER, TYPE_CONTACTS,
- TYPE_USER_HISTORY, TYPE_PERSONALIZATION, TYPE_CONTEXTUAL }));
+ private static final HashSet<String> sUserSpecificDictionaryTypes = new HashSet<>(Arrays.asList(
+ TYPE_USER_TYPED,
+ TYPE_USER,
+ TYPE_CONTACTS,
+ TYPE_USER_HISTORY,
+ TYPE_PERSONALIZATION,
+ TYPE_CONTEXTUAL));
public Dictionary(final String dictType, final Locale locale) {
mDictType = dictType;
@@ -83,9 +87,9 @@ public abstract class Dictionary {
/**
* Searches for suggestions for a given context.
- * @param composer the key sequence to match with coordinate info, as a WordComposer
+ * @param composedData the key sequence to match with coordinate info
* @param ngramContext the context for n-gram.
- * @param proximityInfo the object for key proximity. May be ignored by some implementations.
+ * @param proximityInfoHandle the handle for key proximity. Is ignored by some implementations.
* @param settingsValuesForSuggestion the settings values used for the suggestion.
* @param sessionId the session id.
* @param weightForLocale the weight given to this locale, to multiply the output scores for
@@ -95,8 +99,8 @@ public abstract class Dictionary {
* a float array that has only one element. This can be updated when a different value is used.
* @return the list of suggestions (possibly null if none)
*/
- abstract public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer,
- final NgramContext ngramContext, final ProximityInfo proximityInfo,
+ abstract public ArrayList<SuggestedWordInfo> getSuggestions(final ComposedData composedData,
+ final NgramContext ngramContext, final long proximityInfoHandle,
final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final float weightForLocale,
final float[] inOutWeightOfLangModelVsSpatialModel);
@@ -116,10 +120,18 @@ public abstract class Dictionary {
*/
abstract public boolean isInDictionary(final String word);
+ /**
+ * Get the frequency of the word.
+ * @param word the word to get the frequency of.
+ */
public int getFrequency(final String word) {
return NOT_A_PROBABILITY;
}
+ /**
+ * Get the maximum frequency of the word.
+ * @param word the word to get the maximum frequency of.
+ */
public int getMaxFrequencyOfExactMatches(final String word) {
return NOT_A_PROBABILITY;
}
@@ -191,8 +203,8 @@ public abstract class Dictionary {
}
@Override
- public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer,
- final NgramContext ngramContext, final ProximityInfo proximityInfo,
+ public ArrayList<SuggestedWordInfo> getSuggestions(final ComposedData composedData,
+ final NgramContext ngramContext, final long proximityInfoHandle,
final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final float weightForLocale,
final float[] inOutWeightOfLangModelVsSpatialModel) {