mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Remove doesAutoCorrectValidWord().
Possibly offensive words are wrongly demoted when input by gesture. Change-Id: Ibb2eb73d4191dea6cb767643341fe96465c1f70c
This commit is contained in:
parent
d3d7c31ca9
commit
5b69472d56
@ -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
Block a user