am 437fa64a: Merge "Improve the double letter word promotion logic."
* commit '437fa64af3dfe4785b217177c0c357a75584efbd': Improve the double letter word promotion logic.main
commit
633b79260d
|
@ -58,12 +58,6 @@ const int SuggestionsOutputUtils::MIN_LEN_FOR_MULTI_WORD_AUTOCORRECT = 16;
|
|||
++outputWordIndex;
|
||||
}
|
||||
|
||||
// Initial value of the loop index for terminal nodes (words)
|
||||
int doubleLetterTerminalIndex = -1;
|
||||
DoubleLetterLevel doubleLetterLevel = NOT_A_DOUBLE_LETTER;
|
||||
scoringPolicy->searchWordWithDoubleLetter(terminals, terminalSize,
|
||||
&doubleLetterTerminalIndex, &doubleLetterLevel);
|
||||
|
||||
int maxScore = S_INT_MIN;
|
||||
// Force autocorrection for obvious long multi-word suggestions when the top suggestion is
|
||||
// a long multiple words suggestion.
|
||||
|
@ -92,8 +86,8 @@ const int SuggestionsOutputUtils::MIN_LEN_FOR_MULTI_WORD_AUTOCORRECT = 16;
|
|||
if (DEBUG_GEO_FULL) {
|
||||
terminalDicNode->dump("OUT:");
|
||||
}
|
||||
const float doubleLetterCost = scoringPolicy->getDoubleLetterDemotionDistanceCost(
|
||||
terminalIndex, doubleLetterTerminalIndex, doubleLetterLevel);
|
||||
const float doubleLetterCost =
|
||||
scoringPolicy->getDoubleLetterDemotionDistanceCost(terminalDicNode);
|
||||
const float compoundDistance = terminalDicNode->getCompoundDistance(languageWeight)
|
||||
+ doubleLetterCost;
|
||||
const bool isPossiblyOffensiveWord =
|
||||
|
|
|
@ -34,14 +34,10 @@ class Scoring {
|
|||
int *const type, int *const freq) const = 0;
|
||||
virtual void safetyNetForMostProbableString(const int terminalSize,
|
||||
const int maxScore, int *const outputCodePoints, int *const frequencies) const = 0;
|
||||
// TODO: Make more generic
|
||||
virtual void searchWordWithDoubleLetter(DicNode *terminals, const int terminalSize,
|
||||
int *doubleLetterTerminalIndex, DoubleLetterLevel *doubleLetterLevel) const = 0;
|
||||
virtual float getAdjustedLanguageWeight(DicTraverseSession *const traverseSession,
|
||||
DicNode *const terminals, const int size) const = 0;
|
||||
virtual float getDoubleLetterDemotionDistanceCost(const int terminalIndex,
|
||||
const int doubleLetterTerminalIndex,
|
||||
const DoubleLetterLevel doubleLetterLevel) 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,
|
||||
|
|
|
@ -43,11 +43,6 @@ class TypingScoring : public Scoring {
|
|||
const int maxScore, int *const outputCodePoints, int *const frequencies) const {
|
||||
}
|
||||
|
||||
AK_FORCE_INLINE void searchWordWithDoubleLetter(DicNode *terminals,
|
||||
const int terminalSize, int *doubleLetterTerminalIndex,
|
||||
DoubleLetterLevel *doubleLetterLevel) const {
|
||||
}
|
||||
|
||||
AK_FORCE_INLINE float getAdjustedLanguageWeight(DicTraverseSession *const traverseSession,
|
||||
DicNode *const terminals, const int size) const {
|
||||
return 1.0f;
|
||||
|
@ -77,9 +72,8 @@ class TypingScoring : public Scoring {
|
|||
return static_cast<int>(score * SUGGEST_INTERFACE_OUTPUT_SCALE);
|
||||
}
|
||||
|
||||
AK_FORCE_INLINE float getDoubleLetterDemotionDistanceCost(const int terminalIndex,
|
||||
const int doubleLetterTerminalIndex,
|
||||
const DoubleLetterLevel doubleLetterLevel) const {
|
||||
AK_FORCE_INLINE float getDoubleLetterDemotionDistanceCost(
|
||||
const DicNode *const terminalDicNode) const {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue