diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index 0aa34e8..c986eb2 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -244,7 +244,7 @@
         // TODO: toLowerCase in the native code
         final int[] prevWordCodePointArray = (null == prevWord)
                 ? null : StringUtils.toCodePointArray(prevWord);
-        final int composerSize = composer.size();
+        final int composerSize = composer.sizeWithoutTrailingSingleQuotes();
 
         final boolean isGesture = composer.isBatchMode();
         if (composerSize <= 1 || !isGesture) {
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 6985d9a..db0a8a8 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -101,19 +101,6 @@
                 : typedWord;
         LatinImeLogger.onAddSuggestedWord(typedWord, Dictionary.TYPE_USER_TYPED);
 
-        final WordComposer wordComposerForLookup;
-        if (trailingSingleQuotesCount > 0) {
-            wordComposerForLookup = new WordComposer(wordComposer);
-            for (int i = trailingSingleQuotesCount - 1; i >= 0; --i) {
-                // TODO: do not create a fake event for this. Ideally the word composer should know
-                // how to give out the word without trailing quotes and we can remove this entirely
-                wordComposerForLookup.deleteLast(Event.createSoftwareKeypressEvent(
-                        Event.NOT_A_CODE_POINT, Constants.CODE_DELETE,
-                        Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE));
-            }
-        } else {
-            wordComposerForLookup = wordComposer;
-        }
         final ArrayList<SuggestedWordInfo> rawSuggestions;
         if (ProductionFlag.INCLUDE_RAW_SUGGESTIONS) {
             rawSuggestions = CollectionUtils.newArrayList();
@@ -121,7 +108,7 @@
             rawSuggestions = null;
         }
         final SuggestionResults suggestionResults = mDictionaryFacilitator.getSuggestionResults(
-                wordComposerForLookup, prevWordForBigram, proximityInfo, blockOffensiveWords,
+                wordComposer, prevWordForBigram, proximityInfo, blockOffensiveWords,
                 additionalFeaturesOptions, SESSION_TYPING, rawSuggestions);
 
         final boolean isFirstCharCapitalized = wordComposer.isFirstCharCapitalized();
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index a955f37..324683c 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -104,25 +104,6 @@
         refreshSize();
     }
 
-    public WordComposer(final WordComposer source) {
-        mCombinerChain = source.mCombinerChain;
-        mPrimaryKeyCodes = Arrays.copyOf(source.mPrimaryKeyCodes, source.mPrimaryKeyCodes.length);
-        mEvents = new ArrayList<Event>(source.mEvents);
-        mTypedWord = new StringBuilder(source.mTypedWord);
-        mInputPointers.copy(source.mInputPointers);
-        mCapsCount = source.mCapsCount;
-        mDigitsCount = source.mDigitsCount;
-        mIsFirstCharCapitalized = source.mIsFirstCharCapitalized;
-        mCapitalizedMode = source.mCapitalizedMode;
-        mTrailingSingleQuotesCount = source.mTrailingSingleQuotesCount;
-        mIsResumed = source.mIsResumed;
-        mIsBatchMode = source.mIsBatchMode;
-        mCursorPositionWithinWord = source.mCursorPositionWithinWord;
-        mRejectedBatchModeSuggestion = source.mRejectedBatchModeSuggestion;
-        mPreviousWordForSuggestion = source.mPreviousWordForSuggestion;
-        refreshSize();
-    }
-
     /**
      * Clear out the keys registered so far.
      */
@@ -155,6 +136,13 @@
         return mCodePointSize;
     }
 
+    // When the composition contains trailing quotes, we don't pass them to the suggestion engine.
+    // This is because "'tgis'" should be corrected to "'this'", but we can't afford to consider
+    // single quotes as separators because of their very common use as apostrophes.
+    public int sizeWithoutTrailingSingleQuotes() {
+        return size() - mTrailingSingleQuotesCount;
+    }
+
     public final boolean isComposingWord() {
         return size() > 0;
     }
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
index d4e6ad8..b366452 100644
--- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java
+++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
@@ -474,4 +474,43 @@
                 WORD_TO_TYPE.length() * TIMES_TO_TYPE - TIMES_TO_BACKSPACE,
                 mEditText.getText().length());
     }
+
+    public void testManySingleQuotes() {
+        final String WORD_TO_AUTOCORRECT = "i";
+        final String WORD_AUTOCORRECTED = "I";
+        final String QUOTES = "''''''''''''''''''''";
+        final String WORD_TO_TYPE = WORD_TO_AUTOCORRECT + QUOTES + " ";
+        final String EXPECTED_RESULT = WORD_AUTOCORRECTED + QUOTES + " ";
+        type(WORD_TO_TYPE);
+        assertEquals("auto-correct with many trailing single quotes", EXPECTED_RESULT,
+                mEditText.getText().toString());
+    }
+
+    public void testManySingleQuotesOneByOne() {
+        final String WORD_TO_AUTOCORRECT = "i";
+        final String WORD_AUTOCORRECTED = "I";
+        final String QUOTES = "''''''''''''''''''''";
+        final String WORD_TO_TYPE = WORD_TO_AUTOCORRECT + QUOTES + " ";
+        final String EXPECTED_RESULT = WORD_AUTOCORRECTED + QUOTES + " ";
+
+        for (int i = 0; i < WORD_TO_TYPE.length(); ++i) {
+            type(WORD_TO_TYPE.substring(i, i+1));
+            sleep(DELAY_TO_WAIT_FOR_PREDICTIONS);
+            runMessages();
+        }
+        assertEquals("type many trailing single quotes one by one", EXPECTED_RESULT,
+                mEditText.getText().toString());
+    }
+
+    public void testTypingSingleQuotesOneByOne() {
+        final String WORD_TO_TYPE = "it's ";
+        final String EXPECTED_RESULT = WORD_TO_TYPE;
+        for (int i = 0; i < WORD_TO_TYPE.length(); ++i) {
+            type(WORD_TO_TYPE.substring(i, i+1));
+            sleep(DELAY_TO_WAIT_FOR_PREDICTIONS);
+            runMessages();
+        }
+        assertEquals("type words letter by letter", EXPECTED_RESULT,
+                mEditText.getText().toString());
+    }
 }
