From 5cad89493d11e94c1368faaf9b52fb3051ea7084 Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Mon, 2 Dec 2013 14:25:44 +0900 Subject: [PATCH] Make forceCommit true for gesture shortcut score. Bug: 11951198 Change-Id: I18e450378d8a21b51eb02ab31b57467c8a9b1ac8 --- native/jni/src/suggest/core/suggest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/native/jni/src/suggest/core/suggest.cpp b/native/jni/src/suggest/core/suggest.cpp index 2eda414f4..f84c84181 100644 --- a/native/jni/src/suggest/core/suggest.cpp +++ b/native/jni/src/suggest/core/suggest.cpp @@ -235,8 +235,11 @@ int Suggest::outputSuggestions(DicTraverseSession *traverseSession, int *frequen // Shortcut is not supported for multiple words suggestions. // TODO: Check shortcuts during traversal for multiple words suggestions. const bool sameAsTyped = TRAVERSAL->sameAsTyped(traverseSession, terminalDicNode); + const int shortcutBaseScore = SCORING->doesAutoCorrectValidWord() ? + SCORING->calculateFinalScore(compoundDistance, traverseSession->getInputSize(), + true /* forceCommit */) : finalScore; const int updatedOutputWordIndex = ShortcutUtils::outputShortcuts(&shortcutIt, - outputWordIndex, finalScore, outputCodePoints, frequencies, outputTypes, + outputWordIndex, shortcutBaseScore, outputCodePoints, frequencies, outputTypes, sameAsTyped); const int secondWordFirstInputIndex = terminalDicNode->getSecondWordFirstInputIndex( traverseSession->getProximityInfoState(0));