aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-05-07 13:43:11 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-05-07 13:43:11 -0700
commit7e615228dedcdf2b390297e2cdfd04ecf9d6ba71 (patch)
treeedb01d555ed689f5d02ceae3191f5281e20843d4 /java/src/com/android/inputmethod/latin/Suggest.java
parent4c3ff1a76022b1abab86f3fe42e3f7bbd0a341f3 (diff)
parente4e1130d003a75e3b5cbea1678755d2b71d7cb1d (diff)
downloadlatinime-7e615228dedcdf2b390297e2cdfd04ecf9d6ba71.tar.gz
latinime-7e615228dedcdf2b390297e2cdfd04ecf9d6ba71.tar.xz
latinime-7e615228dedcdf2b390297e2cdfd04ecf9d6ba71.zip
Merge "Tests and some new constructors to help in testing."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rwxr-xr-xjava/src/com/android/inputmethod/latin/Suggest.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index a70bea003..010913d6d 100755
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -16,18 +16,17 @@
package com.android.inputmethod.latin;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
import android.content.Context;
import android.text.AutoText;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import com.android.inputmethod.latin.WordComposer;
-
/**
* This class loads a dictionary and provides a list of suggestions for a given sequence of
* characters. This includes corrections and completions.
@@ -69,9 +68,17 @@ public class Suggest implements Dictionary.WordCallback {
private int mCorrectionMode = CORRECTION_BASIC;
-
public Suggest(Context context, int dictionaryResId) {
mMainDict = new BinaryDictionary(context, dictionaryResId);
+ initPool();
+ }
+
+ public Suggest(Context context, ByteBuffer byteBuffer) {
+ mMainDict = new BinaryDictionary(context, byteBuffer);
+ initPool();
+ }
+
+ private void initPool() {
for (int i = 0; i < mPrefMaxSuggestions; i++) {
StringBuilder sb = new StringBuilder(32);
mStringPool.add(sb);