Remove doesAutoCorrectValidWord().

Possibly offensive words are wrongly demoted when input by
gesture.

Change-Id: Ibb2eb73d4191dea6cb767643341fe96465c1f70c
This commit is contained in:
Keisuke Kuroyanagi 2014-07-31 14:48:16 +09:00
parent d3d7c31ca9
commit 5b69472d56
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;
}