diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java
index 63064ba..c7115c9 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java
@@ -27,6 +27,7 @@
 import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
 import com.android.inputmethod.latin.common.ComposedData;
 import com.android.inputmethod.latin.common.Constants;
+import com.android.inputmethod.latin.common.StringUtils;
 import com.android.inputmethod.latin.personalization.UserHistoryDictionary;
 import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
 import com.android.inputmethod.latin.utils.ExecutorUtils;
@@ -509,10 +510,27 @@
         }
     }
 
-    private void putWordIntoValidSpellingWordCache(final String caller, final String word) {
-        final String spellingWord = word.toLowerCase(getLocale());
-        final boolean isValid = isValidSpellingWord(spellingWord);
-        mValidSpellingWordWriteCache.put(spellingWord, isValid);
+    private void putWordIntoValidSpellingWordCache(
+            @Nonnull final String caller,
+            @Nonnull final String originalWord) {
+        if (mValidSpellingWordWriteCache == null) {
+            return;
+        }
+
+        final String lowerCaseWord = originalWord.toLowerCase(getLocale());
+        final boolean lowerCaseValid = isValidSpellingWord(lowerCaseWord);
+        mValidSpellingWordWriteCache.put(lowerCaseWord, lowerCaseValid);
+
+        final String capitalWord =
+                StringUtils.capitalizeFirstAndDowncaseRest(originalWord, getLocale());
+        final boolean capitalValid;
+        if (lowerCaseValid) {
+            // The lower case form of the word is valid, so the upper case must be valid.
+            capitalValid = true;
+        } else {
+            capitalValid = isValidSpellingWord(capitalWord);
+        }
+        mValidSpellingWordWriteCache.put(capitalWord, capitalValid);
     }
 
     private void addWordToUserHistory(final DictionaryGroup dictionaryGroup,
@@ -620,8 +638,7 @@
 
     public boolean isValidSpellingWord(final String word) {
         if (mValidSpellingWordReadCache != null) {
-            final String spellingWord = word.toLowerCase(getLocale());
-            final Boolean cachedValue = mValidSpellingWordReadCache.get(spellingWord);
+            final Boolean cachedValue = mValidSpellingWordReadCache.get(word);
             if (cachedValue != null) {
                 return cachedValue;
             }
