From 88e079ae6bbff1093b28f60e81d2befce1030495 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 31 Jan 2012 17:15:24 +0900 Subject: Cleanup redundant methods of KeyboardSet Change-Id: I69fa1b5661695d0323222c2969679f4792b6ef0d --- .../com/android/inputmethod/latin/SuggestHelper.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'tests/src') diff --git a/tests/src/com/android/inputmethod/latin/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/SuggestHelper.java index 2e362458b..0c023bd78 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestHelper.java +++ b/tests/src/com/android/inputmethod/latin/SuggestHelper.java @@ -21,6 +21,7 @@ import android.text.TextUtils; import com.android.inputmethod.keyboard.KeyDetector; import com.android.inputmethod.keyboard.Keyboard; +import com.android.inputmethod.keyboard.KeyboardId; import com.android.inputmethod.keyboard.KeyboardSet; import java.io.File; @@ -35,22 +36,20 @@ public class SuggestHelper { public SuggestHelper(Context context, int dictionaryId, KeyboardSet keyboardSet) { // 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 = keyboardSet.getMainKeyboard(); - mKeyDetector = new KeyDetector(0); - init(); + this(new Suggest(context, dictionaryId, null), keyboardSet); } protected SuggestHelper(final Context context, final File dictionaryPath, final long startOffset, final long length, final KeyboardSet keyboardSet, final Locale locale) { - mSuggest = new Suggest(context, dictionaryPath, startOffset, length, null, locale); - mKeyboard = keyboardSet.getMainKeyboard(); - mKeyDetector = new KeyDetector(0); - init(); + this(new Suggest(context, dictionaryPath, startOffset, length, null, locale), keyboardSet); } - private void init() { + private SuggestHelper(final Suggest suggest, final KeyboardSet keyboardSet) { + mSuggest = suggest; + mKeyboard = keyboardSet.getKeyboard(KeyboardId.ELEMENT_ALPHABET); + mKeyDetector = new KeyDetector(0); + setCorrectionMode(Suggest.CORRECTION_FULL); mKeyDetector.setKeyboard(mKeyboard, 0, 0); mKeyDetector.setProximityCorrectionEnabled(true); -- cgit v1.2.3-83-g751a