diff options
author | 2014-05-26 13:53:19 +0000 | |
---|---|---|
committer | 2014-05-26 13:53:19 +0000 | |
commit | 0088d1f6683fce0175266b90c3ec04f15ad8daeb (patch) | |
tree | a95613d6030b1a54458307e074f872f71bf87b97 /tests/src | |
parent | 67e02a6aaa2b693f92f0f3f7948c3f8dadfc17e6 (diff) | |
parent | a6278eb9c1fbe102259cba392b1459f712ca46e7 (diff) | |
download | latinime-0088d1f6683fce0175266b90c3ec04f15ad8daeb.tar.gz latinime-0088d1f6683fce0175266b90c3ec04f15ad8daeb.tar.xz latinime-0088d1f6683fce0175266b90c3ec04f15ad8daeb.zip |
Merge "Use whether it's exact match to detect distracters."
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/DistracterFilterTest.java | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java b/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java index 33f379467..a4dbfaa6b 100644 --- a/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java +++ b/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java @@ -40,34 +40,31 @@ public class DistracterFilterTest extends InputTestsBase { final PrevWordsInfo EMPTY_PREV_WORDS_INFO = PrevWordsInfo.EMPTY_PREV_WORDS_INFO; final Locale localeEnUs = new Locale("en", "US"); - String typedWord = "alot"; - // For this test case, we consider "alot" is a distracter to "a lot". - assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries( - EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs)); + String typedWord; - typedWord = "mot"; - // For this test case, we consider "mot" is a distracter to "not". + typedWord = "google"; + // For this test case, we consider "google" is a distracter to "Google". assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries( EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs)); - typedWord = "wierd"; - // For this test case, we consider "wierd" is a distracter to "weird". + typedWord = "Bill"; + // For this test case, we consider "Bill" is a distracter to "bill". assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries( EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs)); - typedWord = "hoe"; - // For this test case, we consider "hoe" is a distracter to "how". + typedWord = "nOt"; + // For this test case, we consider "nOt" is a distracter to "not". assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries( EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs)); - typedWord = "nit"; - // For this test case, we consider "nit" is a distracter to "not". + typedWord = "were"; + // For this test case, we consider "were" is a distracter to "we're". assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries( EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs)); typedWord = "ill"; - // For this test case, we consider "ill" is a distracter to "I'll". - assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries( + // For this test case, we consider "ill" is not a distracter to any word in dictionaries. + assertFalse(mDistracterFilter.isDistracterToWordsInDictionaries( EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs)); typedWord = "asdfd"; |