diff --git a/tests/res/raw/testtext.txt b/tests/res/raw/testtext.txt
new file mode 100644
index 0000000..eca20c0
--- /dev/null
+++ b/tests/res/raw/testtext.txt
@@ -0,0 +1,24 @@
+This text is used as test text for measuring performance of dictionary prediction. Any text can be put into this file to test the performance (total keystroke savings).
+When you think about “information,” what probably comes to mind are streams of words and numbers. Google’s pretty good at organizing these types of information, but consider all the things you can’t express with words: what does it look like in the middle of a sandstorm? What are some great examples of Art Nouveau architecture? Should I consider wedding cupcakes instead of a traditional cake?
+This is why we built Google Images in 2001. We realized that for many searches, the best answer wasn’t text—it was an image or a set of images. The service has grown quite a bit since then. In 2001, we indexed around 250 million images. By 2005, we had indexed over 1 billion. And today, we have an index of over 10 billion images.
+It’s not just about quantity, though. Over the past decade we’ve been baking deep computer science into Google Images to make it even faster and easier for you to find precisely the right images. We not only find images for pretty much anything you type in; we can also instantly pull out images of clip art, line drawings, faces and even colors.
+There’s even more sophisticated computer vision technology powering our “Similar images” tool. For example, did you know there are nine subspecies of leopards, each with a distinct pattern of spots? Google Images can recognize the difference, returning just leopards of a particular subspecies. It can tell you the name of the subspecies in a particular image—even if that image isn’t labeled—because other similar leopard images on the web are labeled with that subspecies’s name.
+And our “Similar colors” refinement doesn’t just return images based on the overall color of an image. If it did, lots of images would simply be classified as “white.” If you’re looking for [tulips] and you refine results to “white,” you really want images in which the tulips themselves are white—not the surrounding image. It takes some heavy-duty algorithmic wizardry and processing power for a search engine to understand what the items of interest are in all the images out there.
+Those are just a few of the technologies we’ve built to make Google Images more useful. Meanwhile, the quantity and variety of images on the web has ballooned since 2001, and images have become one of the most popular types of content people search for. So over the next few days we’re rolling out an update to Google Images to match the scope and beauty of this fast-growing visual web, and to bring to the surface some of the powerful technology behind Images.
+Here’s what’s new in this refreshed design of Google Images:
+Dense tiled layout designed to make it easy to look at lots of images at once. We want to get the app out of the way so you can find what you’re really looking for.
+Instant scrolling between pages, without letting you get lost in the images. You can now get up to 1,000 images, all in one scrolling page. And we’ll show small, unobtrusive page numbers so you don’t lose track of where you are.
+Larger thumbnail previews on the results page, designed for modern browsers and high-res screens.
+A hover pane that appears when you mouse over a given thumbnail image, giving you a larger preview, more info about the image and other image-specific features such as “Similar images.”
+Once you click on an image, you’re taken to a new landing page that displays a large image in context, with the website it’s hosted on visible right behind it. Click anywhere outside the image, and you’re right in the original page where you can learn more about the source and context.
+Optimized keyboard navigation for faster scrolling through many pages, taking advantage of standard web keyboard shortcuts such as Page Up / Page Down. It’s all about getting you to the info you need quickly, so you can get on with actually building that treehouse or buying those flowers.
+Apple's not really ready to say it's sorry about the iPhone 4 antenna design, but it is willing to give all you darn squeaky wheels free cases for your trouble. Since Apple can't build its own Bumpers fast enough, it will give you a few options and let you decide, then send it your way for free as long as you purchased the phone before September 30th. Not good enough for you? Well, if you already bought a bumper from Apple you'll get a refund, and you can also return your phone for a full refund within 30 days as long as it's unharmed.
+This solution comes at the end of 22 days of Apple engineers "working their butts off," according to Steve, with "physics" ultimately being pinned as the main culprit. Apple claims you can replicate the left-handed "death grip" bar-dropping problem on the BlackBerry Bold 9700, HTC Droid Eris, and Samsung Omnia II, and that "phones aren't perfect." Steve also claims that only 0.55% of people who bought the iPhone 4 have called into AppleCare to complain about the antenna, and the phone has a 1.7% return rate at AT&T, compared to 6% with the 3GS, though he would cop to a slight increase in dropped calls over the iPhone 3GS. For this Steve has what he confesses to be a pet theory: that 3GS users were using the case they had from the 3G, and therefore weren't met with the horrible reality of a naked, call dropping handset. Hence the free case solution, which will probably satisfy some, infuriate others, and never even blip onto the radar of many of the massive horde of consumers that's devoured this product in unprecedented numbers.
+Update: Our own Richard Lai just waltzed down to the Regent Street Apple Store in London with his iPhone Bumper receipt in hand. A few minutes later he left with cold, hard cash, and kept the Bumper to boot. Seems as if the refund effort is a go, at least over in the UK.
+Update 2: We've heard from several tipsters saying Apple no longer does Bumper refunds at its stores; customers will now have to make an online claim instead. Looks like we got super lucky.
+If you have ever received an instant message, text message, or any text-based chat message that seemed to be written in a foreign language, this Webopedia Quick Reference will help you decipher the text chat lingo by providing the definitions to more than 1,300 chat, text message, and Twitter abbreviations.
+With the popularity and rise in real-time text-based communications, such as Facebook, Twitter, instant messaging, e-mail, Internet and online gaming services, chat rooms, discussion boards and mobile phone text messaging (SMS), came the emergence of a new language tailored to the immediacy and compactness of these new communication media.
+While it does seem incredible that there are so many chat abbreviations, remember that different chat abbreviations are used by different groups of people when communicating online. Some of the following chat abbreviations may be familiar to you, while others may be foreign because they are used by a group of people with different online interests and hobbies than your own. For example, people playing online games are likely to use chat abbreviations that are different than those used by someone running a financial blog updating their Twitter status.
+Twitter is a free microblog, or social messaging tool that lets people stay connected through brief text message updates up to 140 characters in length. Twitter is based on you answering the question "What are you doing?" You then post thoughts, observations and goings-on during the day in answer to that question. Your update is posted on your Twitter profile page through SMS text messaging, the Twitter Web site, instant messaging, RSS, e-mail or through other social applications and sites, such as Facebook.
+As with any new social medium, there is an entire vocabulary that users of the Twitter service adopt. Many of the new lingo Twitter-based terms and phrases are used to describe the collection of people who use the service, while other terms are used in reference to describe specific functions and features of the service itself. Also, there are a number of "chat terms," which are basically shorthand abbreviations that users often include in their tweets. Lastly, our guide also provides descriptions to a number of Twitter tools and applications that you can use to enhance your Twitter experience.
+Here are definitions to more than 100 Twitter-related abbreviations, words, phrases, and tools that are associated with the Twitter microblogging service. If you know of a Twitter slang term or application name that is not included in our Twitter Dictionary, please let us know.
diff --git a/tests/src/com/android/inputmethod/latin/tests/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/tests/SuggestHelper.java
new file mode 100644
index 0000000..e3e995a
--- /dev/null
+++ b/tests/src/com/android/inputmethod/latin/tests/SuggestHelper.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.android.inputmethod.latin.tests;
+
+import android.content.Context;
+import android.test.AndroidTestCase;
+import android.text.TextUtils;
+import android.util.Log;
+import com.android.inputmethod.latin.Suggest;
+import com.android.inputmethod.latin.WordComposer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.channels.Channels;
+import java.util.List;
+
+public class SuggestHelper {
+    private Suggest mSuggest;
+    private final String TAG;
+
+    public SuggestHelper(String tag, Context context, int[] resId) {
+        TAG = tag;
+        try {
+            // merging separated dictionary into one if dictionary is separated
+            int total = 0;
+            InputStream[] res = new InputStream[resId.length];
+            for (int i = 0; i < resId.length; i++) {
+                res[i] = context.getResources().openRawResource(resId[i]);
+                total += res[i].available();
+            }
+
+            ByteBuffer byteBuffer =
+                ByteBuffer.allocateDirect(total).order(ByteOrder.nativeOrder());
+            int got = 0;
+            for (int i = 0; i < resId.length; i++) {
+                 got += Channels.newChannel(res[i]).read(byteBuffer);
+            }
+            if (got != total) {
+                Log.w(TAG, "Read " + got + " bytes, expected " + total);
+            } else {
+                mSuggest = new Suggest(context, byteBuffer);
+                Log.i(TAG, "Created mSuggest " + total + " bytes");
+            }
+        } catch (IOException e) {
+            Log.w(TAG, "No available memory for binary dictionary");
+        } finally {
+            try {
+                for (int i = 0;i < is.length; i++) {
+                    res[i].close();
+                }
+            } catch (IOException e) {
+                Log.w(TAG, "Failed to close input stream");
+            }
+        }
+        mSuggest.setAutoTextEnabled(false);
+        mSuggest.setCorrectionMode(Suggest.CORRECTION_FULL_BIGRAM);
+    }
+
+    private WordComposer createWordComposer(CharSequence s) {
+        WordComposer word = new WordComposer();
+        for (int i = 0; i < s.length(); i++) {
+            final char c = s.charAt(i);
+            int[] codes;
+            // If it's not a lowercase letter, don't find adjacent letters
+            if (c < 'a' || c > 'z') {
+                codes = new int[] { c };
+            } else {
+                codes = adjacents[c - 'a'];
+            }
+            word.add(c, codes);
+        }
+        return word;
+    }
+
+    private void showList(String title, List<CharSequence> suggestions) {
+        Log.i(TAG, title);
+        for (int i = 0; i < suggestions.size(); i++) {
+            Log.i(title, suggestions.get(i) + ", ");
+        }
+    }
+
+    private boolean isDefaultSuggestion(List<CharSequence> suggestions, CharSequence word) {
+        // Check if either the word is what you typed or the first alternative
+        return suggestions.size() > 0 &&
+                (/*TextUtils.equals(suggestions.get(0), word) || */
+                  (suggestions.size() > 1 && TextUtils.equals(suggestions.get(1), word)));
+    }
+
+    boolean isDefaultSuggestion(CharSequence typed, CharSequence expected) {
+        WordComposer word = createWordComposer(typed);
+        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, null);
+        return isDefaultSuggestion(suggestions, expected);
+    }
+
+    boolean isDefaultCorrection(CharSequence typed, CharSequence expected) {
+        WordComposer word = createWordComposer(typed);
+        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, null);
+        return isDefaultSuggestion(suggestions, expected) && mSuggest.hasMinimalCorrection();
+    }
+
+    boolean isASuggestion(CharSequence typed, CharSequence expected) {
+        WordComposer word = createWordComposer(typed);
+        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, null);
+        for (int i = 1; i < suggestions.size(); i++) {
+            if (TextUtils.equals(suggestions.get(i), expected)) return true;
+        }
+        return false;
+    }
+
+    private void getBigramSuggestions(CharSequence previous, CharSequence typed) {
+        if(!TextUtils.isEmpty(previous) && (typed.length() > 1)) {
+            WordComposer firstChar = createWordComposer(typed.charAt(0) + "");
+            mSuggest.getSuggestions(null, firstChar, false, previous);
+        }
+    }
+
+    boolean isDefaultNextSuggestion(CharSequence previous, CharSequence typed,
+            CharSequence expected) {
+        WordComposer word = createWordComposer(typed);
+        getBigramSuggestions(previous, typed);
+        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, previous);
+        return isDefaultSuggestion(suggestions, expected);
+    }
+
+    boolean isDefaultNextCorrection(CharSequence previous, CharSequence typed,
+            CharSequence expected) {
+        WordComposer word = createWordComposer(typed);
+        getBigramSuggestions(previous, typed);
+        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, previous);
+        return isDefaultSuggestion(suggestions, expected) && mSuggest.hasMinimalCorrection();
+    }
+
+    boolean isASuggestion(CharSequence previous, CharSequence typed,
+            CharSequence expected) {
+        WordComposer word = createWordComposer(typed);
+        getBigramSuggestions(previous, typed);
+        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, previous);
+        for (int i = 1; i < suggestions.size(); i++) {
+            if (TextUtils.equals(suggestions.get(i), expected)) return true;
+        }
+        return false;
+    }
+
+    boolean isValid(CharSequence typed) {
+        return mSuggest.isValidWord(typed);
+    }
+
+    final int[][] adjacents = {
+                               {'a','s','w','q',-1},
+                               {'b','h','v','n','g','j',-1},
+                               {'c','v','f','x','g',},
+                               {'d','f','r','e','s','x',-1},
+                               {'e','w','r','s','d',-1},
+                               {'f','g','d','c','t','r',-1},
+                               {'g','h','f','y','t','v',-1},
+                               {'h','j','u','g','b','y',-1},
+                               {'i','o','u','k',-1},
+                               {'j','k','i','h','u','n',-1},
+                               {'k','l','o','j','i','m',-1},
+                               {'l','k','o','p',-1},
+                               {'m','k','n','l',-1},
+                               {'n','m','j','k','b',-1},
+                               {'o','p','i','l',-1},
+                               {'p','o',-1},
+                               {'q','w',-1},
+                               {'r','t','e','f',-1},
+                               {'s','d','e','w','a','z',-1},
+                               {'t','y','r',-1},
+                               {'u','y','i','h','j',-1},
+                               {'v','b','g','c','h',-1},
+                               {'w','e','q',-1},
+                               {'x','c','d','z','f',-1},
+                               {'y','u','t','h','g',-1},
+                               {'z','s','x','a','d',-1},
+                              };
+}
diff --git a/tests/src/com/android/inputmethod/latin/tests/SuggestPerformanceTests.java b/tests/src/com/android/inputmethod/latin/tests/SuggestPerformanceTests.java
new file mode 100644
index 0000000..473c440
--- /dev/null
+++ b/tests/src/com/android/inputmethod/latin/tests/SuggestPerformanceTests.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.android.inputmethod.latin.tests;
+
+import android.test.AndroidTestCase;
+import android.util.Log;
+
+import java.io.InputStreamReader;
+import java.io.InputStream;
+import java.io.BufferedReader;
+import java.util.StringTokenizer;
+import java.util.regex.Pattern;
+
+public class SuggestPerformanceTests extends AndroidTestCase {
+    private static final String TAG = "SuggestPerformanceTests";
+
+    private String mTestText;
+    private SuggestHelper sh;
+
+    @Override
+    protected void setUp() {
+        // TODO Figure out a way to directly using the dictionary rather than copying it over
+
+        // For testing with real dictionary, TEMPORARILY COPY main dictionary into test directory.
+        // DO NOT SUBMIT real dictionary under test directory.
+        //int[] resId = new int[] { R.raw.main0, R.raw.main1, R.raw.main2 };
+
+        int[] resId = new int[] { R.raw.test };
+
+        sh = new SuggestHelper(TAG, getTestContext(), resId);
+        loadString();
+    }
+
+    private void loadString() {
+        try {
+            InputStream is = getTestContext().getResources().openRawResource(R.raw.testtext);
+            BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+            StringBuilder sb = new StringBuilder();
+            String line = reader.readLine();
+            while (line != null) {
+                sb.append(line + " ");
+                line = reader.readLine();
+            }
+            mTestText = sb.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /************************** Helper functions ************************/
+    private int lookForSuggestion(String prevWord, String currentWord) {
+        for (int i = 1; i < currentWord.length(); i++) {
+            if (i == 1) {
+                if (sh.isDefaultNextSuggestion(prevWord, currentWord.substring(0, i),
+                        currentWord)) {
+                    return i;
+                }
+            } else {
+                if (sh.isDefaultNextCorrection(prevWord, currentWord.substring(0, i),
+                        currentWord)) {
+                    return i;
+                }
+            }
+        }
+        return currentWord.length();
+    }
+
+    private double runText(boolean withBigrams) {
+        StringTokenizer st = new StringTokenizer(mTestText);
+        String prevWord = null;
+        int typeCount = 0;
+        int characterCount = 0; // without space
+        int wordCount = 0;
+        while (st.hasMoreTokens()) {
+            String currentWord = st.nextToken();
+            boolean endCheck = false;
+            if (currentWord.matches("[\\w]*[\\.|?|!|*|@|&|/|:|;]")) {
+                currentWord = currentWord.substring(0, currentWord.length() - 1);
+                endCheck = true;
+            }
+            if (withBigrams && prevWord != null) {
+                typeCount += lookForSuggestion(prevWord, currentWord);
+            } else {
+                typeCount += lookForSuggestion(null, currentWord);
+            }
+            characterCount += currentWord.length();
+            if (!endCheck) prevWord = currentWord;
+            wordCount++;
+        }
+
+        double result = (double) (characterCount - typeCount) / characterCount * 100;
+        if (withBigrams) {
+            Log.i(TAG, "with bigrams -> "  + result + " % saved!");
+        } else {
+            Log.i(TAG, "without bigrams  -> "  + result + " % saved!");
+        }
+        Log.i(TAG, "\ttotal number of words: " + wordCount);
+        Log.i(TAG, "\ttotal number of characters: " + mTestText.length());
+        Log.i(TAG, "\ttotal number of characters without space: " + characterCount);
+        Log.i(TAG, "\ttotal number of characters typed: " + typeCount);
+        return result;
+    }
+
+
+    /************************** Performance Tests ************************/
+    /**
+     * Compare the Suggest with and without bigram
+     * Check the log for detail
+     */
+    public void testSuggestPerformance() {
+        assertTrue(runText(false) < runText(true));
+    }
+}
diff --git a/tests/src/com/android/inputmethod/latin/tests/SuggestTests.java b/tests/src/com/android/inputmethod/latin/tests/SuggestTests.java
index 318cc7c..a42422b 100644
--- a/tests/src/com/android/inputmethod/latin/tests/SuggestTests.java
+++ b/tests/src/com/android/inputmethod/latin/tests/SuggestTests.java
@@ -1,171 +1,33 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
 package com.android.inputmethod.latin.tests;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.channels.Channels;
-import java.util.List;
-
-import android.content.Context;
 import android.test.AndroidTestCase;
-import android.text.TextUtils;
 import android.util.Log;
 
-import com.android.inputmethod.latin.Suggest;
-import com.android.inputmethod.latin.WordComposer;
-
 public class SuggestTests extends AndroidTestCase {
     private static final String TAG = "SuggestTests";
 
-    private Suggest mSuggest;
-
-    int[][] adjacents = {
-        {'a','s','w','q',-1},
-        {'b','h','v','n','g','j',-1},
-        {'c','v','f','x','g',},
-        {'d','f','r','e','s','x',-1},
-        {'e','w','r','s','d',-1},
-        {'f','g','d','c','t','r',-1},
-        {'g','h','f','y','t','v',-1},
-        {'h','j','u','g','b','y',-1},
-        {'i','o','u','k',-1},
-        {'j','k','i','h','u','n',-1},
-        {'k','l','o','j','i','m',-1},
-        {'l','k','o','p',-1},
-        {'m','k','n','l',-1},
-        {'n','m','j','k','b',-1},
-        {'o','p','i','l',-1},
-        {'p','o',-1},
-        {'q','w',-1},
-        {'r','t','e','f',-1},
-        {'s','d','e','w','a','z',-1},
-        {'t','y','r',-1},
-        {'u','y','i','h','j',-1},
-        {'v','b','g','c','h',-1},
-        {'w','e','q',-1},
-        {'x','c','d','z','f',-1},
-        {'y','u','t','h','g',-1},
-        {'z','s','x','a','d',-1},
-    };
+    private SuggestHelper sh;
 
     @Override
     protected void setUp() {
-        final Context context = getTestContext();
-        InputStream is = context.getResources().openRawResource(R.raw.test);
-        Log.i(TAG, "Stream type is " + is);
-        try {
-            int avail = is.available();
-            if (avail > 0) {
-                ByteBuffer byteBuffer =
-                    ByteBuffer.allocateDirect(avail).order(ByteOrder.nativeOrder());
-                int got = Channels.newChannel(is).read(byteBuffer);
-                if (got != avail) {
-                    Log.e(TAG, "Read " + got + " bytes, expected " + avail);
-                } else {
-                    mSuggest = new Suggest(context, byteBuffer);
-                    Log.i(TAG, "Created mSuggest " + avail + " bytes");
-                }
-            }
-        } catch (IOException ioe) {
-            Log.w(TAG, "No available size for binary dictionary");
-        }
-        mSuggest.setAutoTextEnabled(false);
-        mSuggest.setCorrectionMode(Suggest.CORRECTION_FULL_BIGRAM);
-    }
-
-    /************************** Helper functions ************************/
-
-    private WordComposer createWordComposer(CharSequence s) {
-        WordComposer word = new WordComposer();
-        for (int i = 0; i < s.length(); i++) {
-            final char c = s.charAt(i);
-            int[] codes;
-            // If it's not a lowercase letter, don't find adjacent letters
-            if (c < 'a' || c > 'z') {
-                codes = new int[] { c };
-            } else {
-                codes = adjacents[c - 'a'];
-            }
-            word.add(c, codes);
-        }
-        return word;
-    }
-
-    private void showList(String title, List<CharSequence> suggestions) {
-        Log.i(TAG, title);
-        for (int i = 0; i < suggestions.size(); i++) {
-            Log.i(title, suggestions.get(i) + ", ");
-        }
-    }
-
-    private boolean isDefaultSuggestion(List<CharSequence> suggestions, CharSequence word) {
-        // Check if either the word is what you typed or the first alternative
-        return suggestions.size() > 0 &&
-                (/*TextUtils.equals(suggestions.get(0), word) || */
-                  (suggestions.size() > 1 && TextUtils.equals(suggestions.get(1), word)));
-    }
-
-    private boolean isDefaultSuggestion(CharSequence typed, CharSequence expected) {
-        WordComposer word = createWordComposer(typed);
-        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, null);
-        return isDefaultSuggestion(suggestions, expected);
-    }
-
-    private void getBigramSuggestions(CharSequence previous, CharSequence typed) {
-        if(!TextUtils.isEmpty(previous) && (typed.length() > 1)) {
-            WordComposer firstChar = createWordComposer(typed.charAt(0) + "");
-            mSuggest.getSuggestions(null, firstChar, false, previous);
-        }
-    }
-
-    private boolean isDefaultNextSuggestion(CharSequence previous, CharSequence typed,
-            CharSequence expected) {
-        WordComposer word = createWordComposer(typed);
-        getBigramSuggestions(previous, typed);
-        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, previous);
-        return isDefaultSuggestion(suggestions, expected);
-    }
-
-    private boolean isDefaultCorrection(CharSequence typed, CharSequence expected) {
-        WordComposer word = createWordComposer(typed);
-        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, null);
-        return isDefaultSuggestion(suggestions, expected) && mSuggest.hasMinimalCorrection();
-    }
-
-    private boolean isDefaultNextCorrection(CharSequence previous, CharSequence typed,
-            CharSequence expected) {
-        WordComposer word = createWordComposer(typed);
-        getBigramSuggestions(previous, typed);
-        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, previous);
-        for(int i=0;i<suggestions.size();i++) {
-            Log.i(TAG,i+" "+suggestions.get(i));
-        }
-        return isDefaultSuggestion(suggestions, expected) && mSuggest.hasMinimalCorrection();
-    }
-
-    private boolean isASuggestion(CharSequence typed, CharSequence expected) {
-        WordComposer word = createWordComposer(typed);
-        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, null);
-        for (int i = 1; i < suggestions.size(); i++) {
-            if (TextUtils.equals(suggestions.get(i), expected)) return true;
-        }
-        return false;
-    }
-
-    private boolean isASuggestion(CharSequence previous, CharSequence typed,
-            CharSequence expected) {
-        WordComposer word = createWordComposer(typed);
-        getBigramSuggestions(previous, typed);
-        List<CharSequence> suggestions = mSuggest.getSuggestions(null, word, false, previous);
-        for (int i = 1; i < suggestions.size(); i++) {
-            if (TextUtils.equals(suggestions.get(i), expected)) return true;
-        }
-        return false;
-    }
-
-    private boolean isValid(CharSequence typed) {
-        return mSuggest.isValidWord(typed);
+        int[] resId = new int[] { R.raw.test };
+        sh = new SuggestHelper(TAG, getTestContext(), resId);
     }
 
     /************************** Tests ************************/
@@ -174,87 +36,87 @@
      * Tests for simple completions of one character.
      */
     public void testCompletion1char() {
-        assertTrue(isDefaultSuggestion("peopl", "people"));
-        assertTrue(isDefaultSuggestion("abou", "about"));
-        assertTrue(isDefaultSuggestion("thei", "their"));
+        assertTrue(sh.isDefaultSuggestion("peopl", "people"));
+        assertTrue(sh.isDefaultSuggestion("abou", "about"));
+        assertTrue(sh.isDefaultSuggestion("thei", "their"));
     }
 
     /**
      * Tests for simple completions of two characters.
      */
     public void testCompletion2char() {
-        assertTrue(isDefaultSuggestion("peop", "people"));
-        assertTrue(isDefaultSuggestion("calli", "calling"));
-        assertTrue(isDefaultSuggestion("busine", "business"));
+        assertTrue(sh.isDefaultSuggestion("peop", "people"));
+        assertTrue(sh.isDefaultSuggestion("calli", "calling"));
+        assertTrue(sh.isDefaultSuggestion("busine", "business"));
     }
 
     /**
      * Tests for proximity errors.
      */
     public void testProximityPositive() {
-        assertTrue(isDefaultSuggestion("peiple", "people"));
-        assertTrue(isDefaultSuggestion("peoole", "people"));
-        assertTrue(isDefaultSuggestion("pwpple", "people"));
+        assertTrue(sh.isDefaultSuggestion("peiple", "people"));
+        assertTrue(sh.isDefaultSuggestion("peoole", "people"));
+        assertTrue(sh.isDefaultSuggestion("pwpple", "people"));
     }
 
     /**
      * Tests for proximity errors - negative, when the error key is not near.
      */
     public void testProximityNegative() {
-        assertFalse(isDefaultSuggestion("arout", "about"));
-        assertFalse(isDefaultSuggestion("ire", "are"));
+        assertFalse(sh.isDefaultSuggestion("arout", "about"));
+        assertFalse(sh.isDefaultSuggestion("ire", "are"));
     }
 
     /**
      * Tests for checking if apostrophes are added automatically.
      */
     public void testApostropheInsertion() {
-        assertTrue(isDefaultSuggestion("im", "I'm"));
-        assertTrue(isDefaultSuggestion("dont", "don't"));
+        assertTrue(sh.isDefaultSuggestion("im", "I'm"));
+        assertTrue(sh.isDefaultSuggestion("dont", "don't"));
     }
 
     /**
      * Test to make sure apostrophed word is not suggested for an apostrophed word.
      */
     public void testApostrophe() {
-        assertFalse(isDefaultSuggestion("don't", "don't"));
+        assertFalse(sh.isDefaultSuggestion("don't", "don't"));
     }
 
     /**
      * Tests for suggestion of capitalized version of a word.
      */
     public void testCapitalization() {
-        assertTrue(isDefaultSuggestion("i'm", "I'm"));
-        assertTrue(isDefaultSuggestion("sunday", "Sunday"));
-        assertTrue(isDefaultSuggestion("sundat", "Sunday"));
+        assertTrue(sh.isDefaultSuggestion("i'm", "I'm"));
+        assertTrue(sh.isDefaultSuggestion("sunday", "Sunday"));
+        assertTrue(sh.isDefaultSuggestion("sundat", "Sunday"));
     }
 
     /**
      * Tests to see if more than one completion is provided for certain prefixes.
      */
     public void testMultipleCompletions() {
-        assertTrue(isASuggestion("com", "come"));
-        assertTrue(isASuggestion("com", "company"));
-        assertTrue(isASuggestion("th", "the"));
-        assertTrue(isASuggestion("th", "that"));
-        assertTrue(isASuggestion("th", "this"));
-        assertTrue(isASuggestion("th", "they"));
+        assertTrue(sh.isASuggestion("com", "come"));
+        assertTrue(sh.isASuggestion("com", "company"));
+        assertTrue(sh.isASuggestion("th", "the"));
+        assertTrue(sh.isASuggestion("th", "that"));
+        assertTrue(sh.isASuggestion("th", "this"));
+        assertTrue(sh.isASuggestion("th", "they"));
     }
 
     /**
      * Does the suggestion engine recognize zero frequency words as valid words.
      */
     public void testZeroFrequencyAccepted() {
-        assertTrue(isValid("yikes"));
-        assertFalse(isValid("yike"));
+        assertTrue(sh.isValid("yikes"));
+        assertFalse(sh.isValid("yike"));
     }
 
     /**
      * Tests to make sure that zero frequency words are not suggested as completions.
      */
     public void testZeroFrequencySuggestionsNegative() {
-        assertFalse(isASuggestion("yike", "yikes"));
-        assertFalse(isASuggestion("what", "whatcha"));
+        assertFalse(sh.isASuggestion("yike", "yikes"));
+        assertFalse(sh.isASuggestion("what", "whatcha"));
     }
 
     /**
@@ -262,16 +124,16 @@
      * and not considered corrections, in some cases.
      */
     public void testTooLargeEditDistance() {
-        assertFalse(isASuggestion("sniyr", "about"));
-        assertFalse(isDefaultCorrection("rjw", "the"));
+        assertFalse(sh.isASuggestion("sniyr", "about"));
+        assertFalse(sh.isDefaultCorrection("rjw", "the"));
     }
 
     /**
-     * Make sure isValid is case-sensitive.
+     * Make sure sh.isValid is case-sensitive.
      */
     public void testValidityCaseSensitivity() {
-        assertTrue(isValid("Sunday"));
-        assertFalse(isValid("sunday"));
+        assertTrue(sh.isValid("Sunday"));
+        assertFalse(sh.isValid("sunday"));
     }
 
     /**
@@ -279,11 +141,11 @@
      */
     public void testAccents() {
         // ni<LATIN SMALL LETTER N WITH TILDE>o
-        assertTrue(isDefaultCorrection("nino", "ni\u00F1o"));
+        assertTrue(sh.isDefaultCorrection("nino", "ni\u00F1o"));
         // ni<LATIN SMALL LETTER N WITH TILDE>o
-        assertTrue(isDefaultCorrection("nimo", "ni\u00F1o"));
+        assertTrue(sh.isDefaultCorrection("nimo", "ni\u00F1o"));
         // Mar<LATIN SMALL LETTER I WITH ACUTE>a
-        assertTrue(isDefaultCorrection("maria", "Mar\u00EDa"));
+        assertTrue(sh.isDefaultCorrection("maria", "Mar\u00EDa"));
     }
 
     /**
@@ -291,20 +153,20 @@
      *  and don't show any when there aren't any
      */
     public void testBigramsAtFirstChar() {
-        assertTrue(isDefaultNextCorrection("about", "p", "part"));
-        assertTrue(isDefaultNextCorrection("I'm", "a", "about"));
-        assertTrue(isDefaultNextCorrection("about", "b", "business"));
-        assertTrue(isASuggestion("about", "b", "being"));
-        assertFalse(isDefaultNextSuggestion("about", "p", "business"));
+        assertTrue(sh.isDefaultNextSuggestion("about", "p", "part"));
+        assertTrue(sh.isDefaultNextSuggestion("I'm", "a", "about"));
+        assertTrue(sh.isDefaultNextSuggestion("about", "b", "business"));
+        assertTrue(sh.isASuggestion("about", "b", "being"));
+        assertFalse(sh.isDefaultNextSuggestion("about", "p", "business"));
     }
 
     /**
      * Make sure bigrams score affects the original score
      */
     public void testBigramsScoreEffect() {
-       assertTrue(isDefaultCorrection("pa", "page"));
-       assertTrue(isDefaultNextCorrection("about", "pa", "part"));
-       assertTrue(isDefaultCorrection("sa", "said"));
-       assertTrue(isDefaultNextCorrection("from", "sa", "same"));
+        assertTrue(sh.isDefaultCorrection("pa", "page"));
+        assertTrue(sh.isDefaultNextCorrection("about", "pa", "part"));
+        assertTrue(sh.isDefaultCorrection("sa", "said"));
+        assertTrue(sh.isDefaultNextCorrection("from", "sa", "same"));
     }
 }
