diff options
author | 2014-05-26 13:56:18 +0000 | |
---|---|---|
committer | 2014-05-26 13:56:18 +0000 | |
commit | 1dab0693d2d993168beae6a3b696297811e959e0 (patch) | |
tree | a95613d6030b1a54458307e074f872f71bf87b97 /tests/src | |
parent | c96a7901941732e3b2f814d1a3a68ba9116b2172 (diff) | |
parent | 0088d1f6683fce0175266b90c3ec04f15ad8daeb (diff) | |
download | latinime-1dab0693d2d993168beae6a3b696297811e959e0.tar.gz latinime-1dab0693d2d993168beae6a3b696297811e959e0.tar.xz latinime-1dab0693d2d993168beae6a3b696297811e959e0.zip |
am 0088d1f6: Merge "Use whether it\'s exact match to detect distracters."
* commit '0088d1f6683fce0175266b90c3ec04f15ad8daeb':
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"; |