aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMohammadinamul Sheik <inamul@google.com>2015-03-18 18:44:56 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-18 18:44:57 +0000
commitd5335d939a5551326206afb684d0c40ef352eea5 (patch)
tree1c470f5df8086b4558265b0cd964a840db4b5b89 /tests
parentd4ce5e944b849cbae65aa62f99bf2ee0796fbff3 (diff)
parent25433d7a0b9ed9a60dc70e5dd34ad329ef21b036 (diff)
downloadlatinime-d5335d939a5551326206afb684d0c40ef352eea5.tar.gz
latinime-d5335d939a5551326206afb684d0c40ef352eea5.tar.xz
latinime-d5335d939a5551326206afb684d0c40ef352eea5.zip
Merge "Fix the RichInputConnectionAndTextRangeTests"
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);
}