Merge "Remove doesAutoCorrectValidWord()." into lmp-dev

This commit is contained in:
Keisuke Kuroyanagi 2014-07-31 07:25:21 +00:00 committed by Android (Google) Code Review
commit 57574b98c2
3 changed files with 2 additions and 13 deletions

View File

@ -37,7 +37,6 @@ class Scoring {
DicNode *const terminals, const int size) const = 0;
virtual float getDoubleLetterDemotionDistanceCost(
const DicNode *const terminalDicNode) const = 0;
virtual bool doesAutoCorrectValidWord() const = 0;
virtual bool autoCorrectsToMultiWordSuggestionIfTop() const = 0;
virtual bool sameAsTyped(const DicTraverseSession *const traverseSession,
const DicNode *const dicNode) const = 0;

View File

@ -117,8 +117,7 @@ const int SuggestionsOutputUtils::MIN_LEN_FOR_MULTI_WORD_AUTOCORRECT = 16;
const int finalScore = scoringPolicy->calculateFinalScore(
compoundDistance, traverseSession->getInputSize(),
terminalDicNode->getContainedErrorTypes(),
(forceCommitMultiWords && terminalDicNode->hasMultipleWords())
|| (isValidWord && scoringPolicy->doesAutoCorrectValidWord()),
(forceCommitMultiWords && terminalDicNode->hasMultipleWords()),
boostExactMatches);
// Don't output invalid or blocked offensive words. However, we still need to submit their
@ -145,12 +144,7 @@ const int SuggestionsOutputUtils::MIN_LEN_FOR_MULTI_WORD_AUTOCORRECT = 16;
traverseSession->getDictionaryStructurePolicy()
->getShortcutPositionOfPtNode(terminalDicNode->getPtNodePos()));
const bool sameAsTyped = scoringPolicy->sameAsTyped(traverseSession, terminalDicNode);
const int shortcutBaseScore = scoringPolicy->doesAutoCorrectValidWord() ?
scoringPolicy->calculateFinalScore(compoundDistance,
traverseSession->getInputSize(),
terminalDicNode->getContainedErrorTypes(),
true /* forceCommit */, boostExactMatches) : finalScore;
outputShortcuts(&shortcutIt, shortcutBaseScore, sameAsTyped, outSuggestionResults);
outputShortcuts(&shortcutIt, finalScore, sameAsTyped, outSuggestionResults);
}
}

View File

@ -69,10 +69,6 @@ class TypingScoring : public Scoring {
return 0.0f;
}
AK_FORCE_INLINE bool doesAutoCorrectValidWord() const {
return false;
}
AK_FORCE_INLINE bool autoCorrectsToMultiWordSuggestionIfTop() const {
return true;
}