aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-07-26 12:35:11 +0900
committerSatoshi Kataoka <satok@google.com>2013-07-26 13:00:19 +0900
commitffcbbaf12788a9fc9398607a548e552d7d2bf05e (patch)
treec23ebc379805b788089594b7423c80f321457f16 /java/src/com/android/inputmethod/latin/ExpandableDictionary.java
parentadc91027d2466ef9539e79874230b3eb4502dee4 (diff)
downloadlatinime-ffcbbaf12788a9fc9398607a548e552d7d2bf05e.tar.gz
latinime-ffcbbaf12788a9fc9398607a548e552d7d2bf05e.tar.xz
latinime-ffcbbaf12788a9fc9398607a548e552d7d2bf05e.zip
Refactor on UserHistoryDictionary
Bug: 9429906 Change-Id: I576a91643bdaf5017cc826ac2e07a74a9a275d60
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ExpandableDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/ExpandableDictionary.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
index 2666573bb..bd2d70365 100644
--- a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
@@ -43,7 +43,7 @@ public class ExpandableDictionary extends Dictionary {
protected static final int BIGRAM_MAX_FREQUENCY = 255;
private Context mContext;
- private char[] mWordBuilder = new char[Constants.Dictionary.MAX_WORD_LENGTH];
+ private char[] mWordBuilder = new char[Constants.DICTIONARY_MAX_WORD_LENGTH];
private int mMaxDepth;
private int mInputLength;
@@ -87,7 +87,7 @@ public class ExpandableDictionary extends Dictionary {
}
}
- protected interface NextWord {
+ public interface NextWord {
public Node getWordNode();
public int getFrequency();
public ForgettingCurveParams getFcParams();
@@ -161,7 +161,7 @@ public class ExpandableDictionary extends Dictionary {
super(dictType);
mContext = context;
clearDictionary();
- mCodes = new int[Constants.Dictionary.MAX_WORD_LENGTH][];
+ mCodes = new int[Constants.DICTIONARY_MAX_WORD_LENGTH][];
}
public void loadDictionary() {
@@ -198,11 +198,11 @@ public class ExpandableDictionary extends Dictionary {
}
public int getMaxWordLength() {
- return Constants.Dictionary.MAX_WORD_LENGTH;
+ return Constants.DICTIONARY_MAX_WORD_LENGTH;
}
public void addWord(final String word, final String shortcutTarget, final int frequency) {
- if (word.length() >= Constants.Dictionary.MAX_WORD_LENGTH) {
+ if (word.length() >= Constants.DICTIONARY_MAX_WORD_LENGTH) {
return;
}
addWordRec(mRoots, word, 0, shortcutTarget, frequency, null);
@@ -258,7 +258,7 @@ public class ExpandableDictionary extends Dictionary {
final boolean blockOffensiveWords) {
if (reloadDictionaryIfRequired()) return null;
if (composer.size() > 1) {
- if (composer.size() >= Constants.Dictionary.MAX_WORD_LENGTH) {
+ if (composer.size() >= Constants.DICTIONARY_MAX_WORD_LENGTH) {
return null;
}
final ArrayList<SuggestedWordInfo> suggestions =
@@ -629,7 +629,7 @@ public class ExpandableDictionary extends Dictionary {
}
// Local to reverseLookUp, but do not allocate each time.
- private final char[] mLookedUpString = new char[Constants.Dictionary.MAX_WORD_LENGTH];
+ private final char[] mLookedUpString = new char[Constants.DICTIONARY_MAX_WORD_LENGTH];
/**
* reverseLookUp retrieves the full word given a list of terminal nodes and adds those words
@@ -644,7 +644,7 @@ public class ExpandableDictionary extends Dictionary {
for (NextWord nextWord : terminalNodes) {
node = nextWord.getWordNode();
freq = nextWord.getFrequency();
- int index = Constants.Dictionary.MAX_WORD_LENGTH;
+ int index = Constants.DICTIONARY_MAX_WORD_LENGTH;
do {
--index;
mLookedUpString[index] = node.mCode;
@@ -656,7 +656,7 @@ public class ExpandableDictionary extends Dictionary {
// to ignore the word in this case.
if (freq >= 0 && node == null) {
suggestions.add(new SuggestedWordInfo(new String(mLookedUpString, index,
- Constants.Dictionary.MAX_WORD_LENGTH - index),
+ Constants.DICTIONARY_MAX_WORD_LENGTH - index),
freq, SuggestedWordInfo.KIND_CORRECTION, mDictType));
}
}