diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 2e5bb19..d14066c 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -2541,7 +2541,7 @@
         if (currentSettings.mCurrentLanguageHasSpaces) {
             // If we are typing in a language with spaces we can just look up the previous
             // word from textview.
-            return mConnection.getNthPreviousWord(currentSettings.mWordSeparators,
+            return mConnection.getNthPreviousWord(currentSettings,
                     mWordComposer.isComposingWord() ? 2 : 1);
         } else {
             return LastComposedWord.NOT_A_COMPOSED_WORD == mLastComposedWord ? null
@@ -2832,7 +2832,7 @@
         final UserHistoryDictionary userHistoryDictionary = mUserHistoryDictionary;
         if (userHistoryDictionary == null) return null;
 
-        final String prevWord = mConnection.getNthPreviousWord(currentSettings.mWordSeparators, 2);
+        final String prevWord = mConnection.getNthPreviousWord(currentSettings, 2);
         final String secondWord;
         if (mWordComposer.wasAutoCapitalized() && !mWordComposer.isMostlyCaps()) {
             secondWord = suggestion.toLowerCase(mSubtypeSwitcher.getCurrentSubtypeLocale());
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java
index b5ea0de..37311ac 100644
--- a/java/src/com/android/inputmethod/latin/RichInputConnection.java
+++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java
@@ -538,7 +538,7 @@
     }
 
     @SuppressWarnings("unused")
-    public String getNthPreviousWord(final String sentenceSeperators, final int n) {
+    public String getNthPreviousWord(final SettingsValues currentSettingsValues, final int n) {
         mIC = mParent.getCurrentInputConnection();
         if (null == mIC) return null;
         final CharSequence prev = getTextBeforeCursor(LOOKBACK_CHARACTER_NUM, 0);
@@ -557,7 +557,7 @@
                 }
             }
         }
-        return getNthPreviousWord(prev, sentenceSeperators, n);
+        return getNthPreviousWord(prev, currentSettingsValues, n);
     }
 
     private static boolean isSeparator(int code, String sep) {
@@ -581,7 +581,7 @@
     // (n = 2) "abc |" -> null
     // (n = 2) "abc. def|" -> null
     public static String getNthPreviousWord(final CharSequence prev,
-            final String sentenceSeperators, final int n) {
+            final SettingsValues currentSettingsValues, final int n) {
         if (prev == null) return null;
         final String[] w = spaceRegex.split(prev);
 
@@ -593,7 +593,8 @@
 
         // If ends in a separator, return null
         final char lastChar = nthPrevWord.charAt(length - 1);
-        if (sentenceSeperators.contains(String.valueOf(lastChar))) return null;
+        if (currentSettingsValues.isWordSeparator(lastChar)
+                || currentSettingsValues.isWordConnector(lastChar)) return null;
 
         return nthPrevWord;
     }
diff --git a/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java b/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
index c0dd993..6ad1250 100644
--- a/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
+++ b/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
@@ -16,6 +16,7 @@
 
 package com.android.inputmethod.latin;
 
+import com.android.inputmethod.latin.settings.SettingsValues;
 import com.android.inputmethod.latin.utils.TextRange;
 
 import android.inputmethodservice.InputMethodService;
@@ -39,7 +40,8 @@
 
     // The following is meant to be a reasonable default for
     // the "word_separators" resource.
-    private static final String sSeparators = ".,:;!?-";
+    private static final SettingsValues sSettings =
+            SettingsValues.makeDummySettingsValuesForTest(Locale.ENGLISH);
 
     @Override
     protected void setUp() throws Exception {
@@ -137,9 +139,9 @@
      */
     public void testGetPreviousWord() {
         // If one of the following cases breaks, the bigram suggestions won't work.
-        assertEquals(RichInputConnection.getNthPreviousWord("abc def", sSeparators, 2), "abc");
-        assertNull(RichInputConnection.getNthPreviousWord("abc", sSeparators, 2));
-        assertNull(RichInputConnection.getNthPreviousWord("abc. def", sSeparators, 2));
+        assertEquals(RichInputConnection.getNthPreviousWord("abc def", sSettings, 2), "abc");
+        assertNull(RichInputConnection.getNthPreviousWord("abc", sSettings, 2));
+        assertNull(RichInputConnection.getNthPreviousWord("abc. def", sSettings, 2));
 
         // The following tests reflect the current behavior of the function
         // RichInputConnection#getNthPreviousWord.
@@ -148,15 +150,15 @@
         // this function if needed - especially since it does not seem very
         // logical. These tests are just there to catch any unintentional
         // changes in the behavior of the RichInputConnection#getPreviousWord method.
-        assertEquals(RichInputConnection.getNthPreviousWord("abc def ", sSeparators, 2), "abc");
-        assertEquals(RichInputConnection.getNthPreviousWord("abc def.", sSeparators, 2), "abc");
-        assertEquals(RichInputConnection.getNthPreviousWord("abc def .", sSeparators, 2), "def");
-        assertNull(RichInputConnection.getNthPreviousWord("abc ", sSeparators, 2));
+        assertEquals(RichInputConnection.getNthPreviousWord("abc def ", sSettings, 2), "abc");
+        assertEquals(RichInputConnection.getNthPreviousWord("abc def.", sSettings, 2), "abc");
+        assertEquals(RichInputConnection.getNthPreviousWord("abc def .", sSettings, 2), "def");
+        assertNull(RichInputConnection.getNthPreviousWord("abc ", sSettings, 2));
 
-        assertEquals(RichInputConnection.getNthPreviousWord("abc def", sSeparators, 1), "def");
-        assertEquals(RichInputConnection.getNthPreviousWord("abc def ", sSeparators, 1), "def");
-        assertNull(RichInputConnection.getNthPreviousWord("abc def.", sSeparators, 1));
-        assertNull(RichInputConnection.getNthPreviousWord("abc def .", sSeparators, 1));
+        assertEquals(RichInputConnection.getNthPreviousWord("abc def", sSettings, 1), "def");
+        assertEquals(RichInputConnection.getNthPreviousWord("abc def ", sSettings, 1), "def");
+        assertNull(RichInputConnection.getNthPreviousWord("abc def.", sSettings, 1));
+        assertNull(RichInputConnection.getNthPreviousWord("abc def .", sSettings, 1));
     }
 
     /**
