am 57574b98: Merge "Remove doesAutoCorrectValidWord()." into lmp-dev
* commit '57574b98c2576602e5597f3bd576fe62f723c813': Remove doesAutoCorrectValidWord().main
commit
959070d3bb
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue