aboutsummaryrefslogtreecommitdiffstats
path: root/native/src/correction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/correction.cpp')
-rw-r--r--native/src/correction.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/native/src/correction.cpp b/native/src/correction.cpp
index 308cca227..5128c2e5c 100644
--- a/native/src/correction.cpp
+++ b/native/src/correction.cpp
@@ -555,6 +555,8 @@ int Correction::RankingAlgorithm::calculateFinalFreq(const int inputIndex, const
const int transposedCount = correction->mTransposedCount / 2;
const int excessiveCount = correction->mExcessiveCount + correction->mTransposedCount % 2;
const int proximityMatchedCount = correction->mProximityCount;
+ const int equivalentCharStrongCount = correction->mEquivalentCharStrongCount;
+ const int equivalentCharWeakCount = correction->mEquivalentCharWeakCount;
const bool lastCharExceeded = correction->mLastCharExceeded;
const bool useFullEditDistance = correction->mUseFullEditDistance;
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);
}
+ 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
? adjustedProximityMatchedCount
: (proximityMatchedCount + transposedCount);