aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammadinamul Sheik <inamul@google.com>2015-03-18 18:49:34 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-18 18:49:34 +0000
commitc17cc42c027bf6acc1b74b0e1effc2c9bd246248 (patch)
tree5cc8eb06ac16fffec3d4cf1b9f39feadf750f31c
parentadd004983a548063368cf7dc91728ec137940a1f (diff)
parentd5335d939a5551326206afb684d0c40ef352eea5 (diff)
downloadlatinime-c17cc42c027bf6acc1b74b0e1effc2c9bd246248.tar.gz
latinime-c17cc42c027bf6acc1b74b0e1effc2c9bd246248.tar.xz
latinime-c17cc42c027bf6acc1b74b0e1effc2c9bd246248.zip
am d5335d93: Merge "Fix the RichInputConnectionAndTextRangeTests"
* commit 'd5335d939a5551326206afb684d0c40ef352eea5': Fix the RichInputConnectionAndTextRangeTests
-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);
}