Calibrate score by touch coordinates
Change-Id: I9fc066eb1a455243536e72405922fcb7e26d7dc6
This commit is contained in:
parent
da9f556a15
commit
9ee8c9c45c
2 changed files with 18 additions and 0 deletions
|
@ -555,6 +555,8 @@ int Correction::RankingAlgorithm::calculateFinalFreq(const int inputIndex, const
|
||||||
const int transposedCount = correction->mTransposedCount / 2;
|
const int transposedCount = correction->mTransposedCount / 2;
|
||||||
const int excessiveCount = correction->mExcessiveCount + correction->mTransposedCount % 2;
|
const int excessiveCount = correction->mExcessiveCount + correction->mTransposedCount % 2;
|
||||||
const int proximityMatchedCount = correction->mProximityCount;
|
const int proximityMatchedCount = correction->mProximityCount;
|
||||||
|
const int equivalentCharStrongCount = correction->mEquivalentCharStrongCount;
|
||||||
|
const int equivalentCharWeakCount = correction->mEquivalentCharWeakCount;
|
||||||
const bool lastCharExceeded = correction->mLastCharExceeded;
|
const bool lastCharExceeded = correction->mLastCharExceeded;
|
||||||
const bool useFullEditDistance = correction->mUseFullEditDistance;
|
const bool useFullEditDistance = correction->mUseFullEditDistance;
|
||||||
const int outputLength = outputIndex + 1;
|
const int outputLength = outputIndex + 1;
|
||||||
|
@ -664,6 +666,20 @@ int Correction::RankingAlgorithm::calculateFinalFreq(const int inputIndex, const
|
||||||
multiplyRate(WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE, &finalFreq);
|
multiplyRate(WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE, &finalFreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < equivalentCharStrongCount; ++i) {
|
||||||
|
if (DEBUG_DICT_FULL) {
|
||||||
|
LOGI("equivalent char strong");
|
||||||
|
}
|
||||||
|
multiplyRate(WORDS_WITH_EQUIVALENT_CHAR_STRONG_PROMOTION_RATE, &finalFreq);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < equivalentCharWeakCount; ++i) {
|
||||||
|
if (DEBUG_DICT_FULL) {
|
||||||
|
LOGI("equivalent char weak");
|
||||||
|
}
|
||||||
|
multiplyRate(WORDS_WITH_EQUIVALENT_CHAR_WEAK_DEMOTION_RATE, &finalFreq);
|
||||||
|
}
|
||||||
|
|
||||||
const int errorCount = adjustedProximityMatchedCount > 0
|
const int errorCount = adjustedProximityMatchedCount > 0
|
||||||
? adjustedProximityMatchedCount
|
? adjustedProximityMatchedCount
|
||||||
: (proximityMatchedCount + transposedCount);
|
: (proximityMatchedCount + transposedCount);
|
||||||
|
|
|
@ -180,6 +180,8 @@ static void dumpWord(const unsigned short* word, const int length) {
|
||||||
#define WORDS_WITH_EXCESSIVE_CHARACTER_DEMOTION_RATE 75
|
#define WORDS_WITH_EXCESSIVE_CHARACTER_DEMOTION_RATE 75
|
||||||
#define WORDS_WITH_EXCESSIVE_CHARACTER_OUT_OF_PROXIMITY_DEMOTION_RATE 75
|
#define WORDS_WITH_EXCESSIVE_CHARACTER_OUT_OF_PROXIMITY_DEMOTION_RATE 75
|
||||||
#define WORDS_WITH_TRANSPOSED_CHARACTERS_DEMOTION_RATE 60
|
#define WORDS_WITH_TRANSPOSED_CHARACTERS_DEMOTION_RATE 60
|
||||||
|
#define WORDS_WITH_EQUIVALENT_CHAR_STRONG_PROMOTION_RATE 105
|
||||||
|
#define WORDS_WITH_EQUIVALENT_CHAR_WEAK_DEMOTION_RATE 95
|
||||||
#define FULL_MATCHED_WORDS_PROMOTION_RATE 120
|
#define FULL_MATCHED_WORDS_PROMOTION_RATE 120
|
||||||
#define WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE 90
|
#define WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE 90
|
||||||
#define WORDS_WITH_MATCH_SKIP_PROMOTION_RATE 105
|
#define WORDS_WITH_MATCH_SKIP_PROMOTION_RATE 105
|
||||||
|
|
Loading…
Reference in a new issue