am d5f5dd74: Quit suggest words that do not include proximity chars.
* commit 'd5f5dd74c2e0946d4686a4f22cda1591b34b6729': Quit suggest words that do not include proximity chars.main
commit
43afae3a48
|
@ -280,6 +280,13 @@ class DicNode {
|
||||||
return !(currentDepth > 0 && (currentDepth != 1 || prevWordLen != 1));
|
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 {
|
bool isTotalInputSizeExceedingLimit() const {
|
||||||
const int prevWordsLen = mDicNodeState.mDicNodeStatePrevWord.getPrevWordLength();
|
const int prevWordsLen = mDicNodeState.mDicNodeStatePrevWord.getPrevWordLength();
|
||||||
const int currentWordDepth = getNodeCodePointCount();
|
const int currentWordDepth = getNodeCodePointCount();
|
||||||
|
|
|
@ -459,6 +459,9 @@ void Suggest::processTerminalDicNode(
|
||||||
Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TERMINAL_INSERTION, traverseSession, 0,
|
Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TERMINAL_INSERTION, traverseSession, 0,
|
||||||
&terminalDicNode, traverseSession->getMultiBigramMap());
|
&terminalDicNode, traverseSession->getMultiBigramMap());
|
||||||
}
|
}
|
||||||
|
if (!dicNode->hasMatchedOrProximityCodePoints()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TERMINAL, traverseSession, 0,
|
Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TERMINAL, traverseSession, 0,
|
||||||
&terminalDicNode, traverseSession->getMultiBigramMap());
|
&terminalDicNode, traverseSession->getMultiBigramMap());
|
||||||
traverseSession->getDicTraverseCache()->copyPushTerminal(&terminalDicNode);
|
traverseSession->getDicTraverseCache()->copyPushTerminal(&terminalDicNode);
|
||||||
|
|
Loading…
Reference in New Issue