Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25433d7a authored by Mohammadinamul Sheik's avatar Mohammadinamul Sheik
Browse files

Fix the RichInputConnectionAndTextRangeTests

Change from sentence seperator to sentence terminator has broken
this tests.

Change-Id: I303a2e703c46191b481b7d32213f165bd00aaaa2
parent e2da4c6a
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -206,10 +206,14 @@ public class RichInputConnectionAndTextRangeTests extends AndroidTestCase {
                "abc def .", mSpacingAndPunctuations, 1), NgramContext.BEGINNING_OF_SENTENCE);
                "abc def .", mSpacingAndPunctuations, 1), NgramContext.BEGINNING_OF_SENTENCE);
        assertEquals(NgramContextUtils.getNgramContextFromNthPreviousWord(
        assertEquals(NgramContextUtils.getNgramContextFromNthPreviousWord(
                "abc, def", mSpacingAndPunctuations, 2), NgramContext.EMPTY_PREV_WORDS_INFO);
                "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(
        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(
        assertEquals(NgramContextUtils.getNgramContextFromNthPreviousWord(
                "abc! def", mSpacingAndPunctuations, 2), NgramContext.EMPTY_PREV_WORDS_INFO);
                "abc! def", mSpacingAndPunctuations, 2), NgramContext.BEGINNING_OF_SENTENCE);
        assertEquals(NgramContextUtils.getNgramContextFromNthPreviousWord(
        assertEquals(NgramContextUtils.getNgramContextFromNthPreviousWord(
                "abc 'def", mSpacingAndPunctuations, 2), NgramContext.EMPTY_PREV_WORDS_INFO);
                "abc 'def", mSpacingAndPunctuations, 2), NgramContext.EMPTY_PREV_WORDS_INFO);
    }
    }