Quit suggest words that do not include proximity chars.

Bug: 10416722

Change-Id: I74d27c6a22b4ca47d02eb238b2fbcc49f5dee99c
diff --git a/native/jni/src/suggest/core/dicnode/dic_node.h b/native/jni/src/suggest/core/dicnode/dic_node.h
index 0b2b4a9..069852d 100644
--- a/native/jni/src/suggest/core/dicnode/dic_node.h
+++ b/native/jni/src/suggest/core/dicnode/dic_node.h
@@ -280,6 +280,13 @@
         return !(currentDepth > 0 && (currentDepth != 1 || prevWordLen != 1));
     }
 
+    bool hasMatchedOrProximityCodePoints() const {
+        // This DicNode does not have matched or proximity code points when all code points have
+        // been handled as edit corrections so far.
+        return mDicNodeState.mDicNodeStateScoring.getEditCorrectionCount()
+                < getNodeCodePointCount();
+    }
+
     bool isTotalInputSizeExceedingLimit() const {
         const int prevWordsLen = mDicNodeState.mDicNodeStatePrevWord.getPrevWordLength();
         const int currentWordDepth = getNodeCodePointCount();
diff --git a/native/jni/src/suggest/core/suggest.cpp b/native/jni/src/suggest/core/suggest.cpp
index f84c841..5377ec4 100644
--- a/native/jni/src/suggest/core/suggest.cpp
+++ b/native/jni/src/suggest/core/suggest.cpp
@@ -459,6 +459,9 @@
         Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TERMINAL_INSERTION, traverseSession, 0,
                 &terminalDicNode, traverseSession->getMultiBigramMap());
     }
+    if (!dicNode->hasMatchedOrProximityCodePoints()) {
+        return;
+    }
     Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TERMINAL, traverseSession, 0,
             &terminalDicNode, traverseSession->getMultiBigramMap());
     traverseSession->getDicTraverseCache()->copyPushTerminal(&terminalDicNode);