aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-05-27 07:14:15 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-27 07:14:16 +0000
commit6a546147ebe343fb2a75ef5b9407bbd60124650d (patch)
tree1df1d80ec89be4f897966b698a6997fceda56746 /tests
parent01748cde4e692c970617e4478368f83b710a86b6 (diff)
parent00da83ed75265b4bd6b39fb53de663cbbdae3928 (diff)
downloadlatinime-6a546147ebe343fb2a75ef5b9407bbd60124650d.tar.gz
latinime-6a546147ebe343fb2a75ef5b9407bbd60124650d.tar.xz
latinime-6a546147ebe343fb2a75ef5b9407bbd60124650d.zip
Merge "Stop filtering out when perfect freq > top non-perfect freq."
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/inputmethod/latin/DistracterFilterTest.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java b/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java
index a4dbfaa6b..406e9a9b8 100644
--- a/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java
+++ b/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java
@@ -57,11 +57,36 @@ public class DistracterFilterTest extends InputTestsBase {
assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
- typedWord = "were";
- // For this test case, we consider "were" is a distracter to "we're".
+ typedWord = "youre";
+ // For this test case, we consider "youre" is a distracter to "you're".
assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
+ typedWord = "Banana";
+ // For this test case, we consider "Banana" is a distracter to "banana".
+ assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
+ EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
+
+ typedWord = "orange";
+ // For this test case, we consider "orange" is not a distracter to any word in dictionaries.
+ assertFalse(mDistracterFilter.isDistracterToWordsInDictionaries(
+ EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
+
+ typedWord = "Orange";
+ // For this test case, we consider "Orange" is a distracter to "orange".
+ assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
+ EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
+
+ typedWord = "café";
+ // For this test case, we consider "café" is a distracter to "cafe".
+ assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
+ EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
+
+ typedWord = "cafe";
+ // For this test case, we consider "café" is not a distracter to any word in dictionaries.
+ assertFalse(mDistracterFilter.isDistracterToWordsInDictionaries(
+ EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
+
typedWord = "ill";
// For this test case, we consider "ill" is not a distracter to any word in dictionaries.
assertFalse(mDistracterFilter.isDistracterToWordsInDictionaries(