Quit suggest words that do not include proximity chars.

Bug: 10416722

Change-Id: I74d27c6a22b4ca47d02eb238b2fbcc49f5dee99c
This commit is contained in:
Keisuke Kuroyanagi 2013-12-18 14:31:10 +09:00
parent 5edae8cea0
commit d5f5dd74c2
2 changed files with 10 additions and 0 deletions

View file

@ -280,6 +280,13 @@ class DicNode {
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();

View file

@ -459,6 +459,9 @@ void Suggest::processTerminalDicNode(
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);