mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
* commit '478605baa460d2d595c7ed0da2790b147727d284': Follow up change for I5f166a738f6e84a1b807be
This commit is contained in:
commit
595b9ea54a
@ -801,7 +801,7 @@ int Correction::RankingAlgorithm::calculateFinalProbability(const int inputIndex
|
|||||||
const float factor = max((x < R1)
|
const float factor = max((x < R1)
|
||||||
? (A * (R1 - x) + B * x) / R1
|
? (A * (R1 - x) + B * x) / R1
|
||||||
: (B * (R2 - x) + C * (x - R1)) / (R2 - R1), MIN);
|
: (B * (R2 - x) + C * (x - R1)) / (R2 - R1), MIN);
|
||||||
// factor is piecewise linear function like:
|
// factor is a piecewise linear function like:
|
||||||
// A -_ .
|
// A -_ .
|
||||||
// ^-_ .
|
// ^-_ .
|
||||||
// B \ .
|
// B \ .
|
||||||
@ -809,7 +809,7 @@ int Correction::RankingAlgorithm::calculateFinalProbability(const int inputIndex
|
|||||||
// C ------------.
|
// C ------------.
|
||||||
// .
|
// .
|
||||||
// 0 R1 R2 .
|
// 0 R1 R2 .
|
||||||
multiplyRate((int)(factor * 100), &finalFreq);
|
multiplyRate((int)(factor * 100.0f), &finalFreq);
|
||||||
} else if (squaredDistance == PROXIMITY_CHAR_WITHOUT_DISTANCE_INFO) {
|
} else if (squaredDistance == PROXIMITY_CHAR_WITHOUT_DISTANCE_INFO) {
|
||||||
multiplyRate(WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE, &finalFreq);
|
multiplyRate(WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE, &finalFreq);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user