aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/SuggestHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/SuggestHelper.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/SuggestHelper.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/src/com/android/inputmethod/latin/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/SuggestHelper.java
index 5930ea36e..87ea011fa 100644
--- a/tests/src/com/android/inputmethod/latin/SuggestHelper.java
+++ b/tests/src/com/android/inputmethod/latin/SuggestHelper.java
@@ -20,7 +20,6 @@ import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.KeyDetector;
import com.android.inputmethod.keyboard.KeyboardId;
import com.android.inputmethod.keyboard.LatinKeyboard;
-import com.android.inputmethod.keyboard.ProximityKeyDetector;
import android.content.Context;
import android.text.TextUtils;
@@ -34,17 +33,19 @@ public class SuggestHelper {
private final KeyDetector mKeyDetector;
public SuggestHelper(Context context, int dictionaryId, KeyboardId keyboardId) {
- mSuggest = new Suggest(context, dictionaryId);
- mKeyboard = new LatinKeyboard(context, keyboardId);
- mKeyDetector = new ProximityKeyDetector();
+ // Use null as the locale for Suggest so as to force it to use the internal dictionary
+ // (and not try to find a dictionary provider for a specified locale)
+ mSuggest = new Suggest(context, dictionaryId, null);
+ mKeyboard = new LatinKeyboard(context, keyboardId, keyboardId.mWidth);
+ mKeyDetector = new KeyDetector();
init();
}
protected SuggestHelper(Context context, File dictionaryPath, long startOffset, long length,
KeyboardId keyboardId) {
- mSuggest = new Suggest(dictionaryPath, startOffset, length);
- mKeyboard = new LatinKeyboard(context, keyboardId);
- mKeyDetector = new ProximityKeyDetector();
+ mSuggest = new Suggest(context, dictionaryPath, startOffset, length, null);
+ mKeyboard = new LatinKeyboard(context, keyboardId, keyboardId.mWidth);
+ mKeyDetector = new KeyDetector();
init();
}
@@ -53,7 +54,7 @@ public class SuggestHelper {
mSuggest.setCorrectionMode(Suggest.CORRECTION_FULL);
mKeyDetector.setKeyboard(mKeyboard, 0, 0);
mKeyDetector.setProximityCorrectionEnabled(true);
- mKeyDetector.setProximityThreshold(KeyDetector.getMostCommonKeyWidth(mKeyboard));
+ mKeyDetector.setProximityThreshold(mKeyboard.getMostCommonKeyWidth());
}
public void setCorrectionMode(int correctionMode) {