summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMohammadinamul Sheik <inamul@google.com>2015-03-18 11:33:57 -0700
committerMohammadinamul Sheik <inamul@google.com>2015-03-18 11:33:57 -0700
commit25433d7a0b9ed9a60dc70e5dd34ad329ef21b036 (patch)
tree5ca293775538dc9fe5fa78b3673faf87cc1f0f70 /tests
parente2da4c6ab8455459429fe8b5922b7bba41b4da6e (diff)
downloadandroid_packages_inputmethods_LatinIME-25433d7a0b9ed9a60dc70e5dd34ad329ef21b036.tar.gz
android_packages_inputmethods_LatinIME-25433d7a0b9ed9a60dc70e5dd34ad329ef21b036.tar.bz2
android_packages_inputmethods_LatinIME-25433d7a0b9ed9a60dc70e5dd34ad329ef21b036.zip
Fix the RichInputConnectionAndTextRangeTests
Change from sentence seperator to sentence terminator has broken this tests. Change-Id: I303a2e703c46191b481b7d32213f165bd00aaaa2
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java b/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
index 8614ccc0e..08779b9d3 100644
--- a/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
+++ b/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
@@ -206,10 +206,14 @@ public class RichInputConnectionAndTextRangeTests extends AndroidTestCase {
"abc def .", mSpacingAndPunctuations, 1), NgramContext.BEGINNING_OF_SENTENCE);
assertEquals(NgramContextUtils.getNgramContextFromNthPreviousWord(
"abc, def", mSpacingAndPunctuations, 2), NgramContext.EMPTY_PREV_WORDS_INFO);
+ // question mark is treated as the end of the sentence. Hence, beginning of the
+ // sentence is expected.
assertEquals(NgramContextUtils.getNgramContextFromNthPreviousWord(
- "abc? def", mSpacingAndPunctuations, 2), NgramContext.EMPTY_PREV_WORDS_INFO);
+ "abc? def", mSpacingAndPunctuations, 2), NgramContext.BEGINNING_OF_SENTENCE);
+ // Exclamation mark is treated as the end of the sentence. Hence, beginning of the
+ // sentence is expected.
assertEquals(NgramContextUtils.getNgramContextFromNthPreviousWord(
- "abc! def", mSpacingAndPunctuations, 2), NgramContext.EMPTY_PREV_WORDS_INFO);
+ "abc! def", mSpacingAndPunctuations, 2), NgramContext.BEGINNING_OF_SENTENCE);
assertEquals(NgramContextUtils.getNgramContextFromNthPreviousWord(
"abc 'def", mSpacingAndPunctuations, 2), NgramContext.EMPTY_PREV_WORDS_INFO);
}