Fix a bug that 2 length words were demoted.
Change-Id: I4a3558d0f1f1b0a9d6a36c3f75db3089b0566d7fmain
parent
0aae85fb67
commit
9674f654a7
|
@ -574,7 +574,7 @@ inline int UnigramDictionary::calculateFinalFreq(const int inputIndex, const int
|
||||||
* (10 * mInputLength - WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X)
|
* (10 * mInputLength - WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X)
|
||||||
/ (10 * mInputLength
|
/ (10 * mInputLength
|
||||||
- WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X + 10);
|
- WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X + 10);
|
||||||
if (DEBUG_DICT) {
|
if (DEBUG_DICT_FULL) {
|
||||||
LOGI("Demotion rate for missing character is %d.", demotionRate);
|
LOGI("Demotion rate for missing character is %d.", demotionRate);
|
||||||
}
|
}
|
||||||
multiplyRate(demotionRate, &finalFreq);
|
multiplyRate(demotionRate, &finalFreq);
|
||||||
|
@ -603,7 +603,7 @@ inline int UnigramDictionary::calculateFinalFreq(const int inputIndex, const int
|
||||||
if (sameLength && transposedPos < 0 && skipPos < 0 && excessivePos < 0) {
|
if (sameLength && transposedPos < 0 && skipPos < 0 && excessivePos < 0) {
|
||||||
finalFreq = capped255MultForFullMatchAccentsOrCapitalizationDifference(finalFreq);
|
finalFreq = capped255MultForFullMatchAccentsOrCapitalizationDifference(finalFreq);
|
||||||
}
|
}
|
||||||
} else if (sameLength && transposedPos < 0 && skipPos < 0 && excessivePos < 0 && depth > 1) {
|
} else if (sameLength && transposedPos < 0 && skipPos < 0 && excessivePos < 0 && depth > 0) {
|
||||||
// A word with proximity corrections
|
// A word with proximity corrections
|
||||||
if (DEBUG_DICT) {
|
if (DEBUG_DICT) {
|
||||||
LOGI("Found one proximity correction.");
|
LOGI("Found one proximity correction.");
|
||||||
|
@ -611,6 +611,9 @@ inline int UnigramDictionary::calculateFinalFreq(const int inputIndex, const int
|
||||||
finalFreq *= 2;
|
finalFreq *= 2;
|
||||||
multiplyRate(WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE, &finalFreq);
|
multiplyRate(WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE, &finalFreq);
|
||||||
}
|
}
|
||||||
|
if (DEBUG_DICT) {
|
||||||
|
LOGI("calc: %d, %d", depth, sameLength);
|
||||||
|
}
|
||||||
if (sameLength) finalFreq *= FULL_WORD_MULTIPLIER;
|
if (sameLength) finalFreq *= FULL_WORD_MULTIPLIER;
|
||||||
return finalFreq;
|
return finalFreq;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue