aboutsummaryrefslogtreecommitdiffstats
path: root/native/src/unigram_dictionary.cpp
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-04-14 19:13:34 +0900
committersatok <satok@google.com>2011-04-14 20:30:25 +0900
commit9d2a3020ba369a9d187a7d8dcba634c8a6eb1f81 (patch)
tree9a1d55f8d1a968c748ca03eae235b634eccf2106 /native/src/unigram_dictionary.cpp
parent6d9021527a38ba1e94225020389621a0d7227aa1 (diff)
downloadlatinime-9d2a3020ba369a9d187a7d8dcba634c8a6eb1f81.tar.gz
latinime-9d2a3020ba369a9d187a7d8dcba634c8a6eb1f81.tar.xz
latinime-9d2a3020ba369a9d187a7d8dcba634c8a6eb1f81.zip
Promote a word with a proximity character
Bug: 4293295 Change-Id: Ib0ec8aff087c71c4fbe983f3f5bc78e9c7868fd8
Diffstat (limited to 'native/src/unigram_dictionary.cpp')
-rw-r--r--native/src/unigram_dictionary.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp
index a1efc9573..89a1c9ea6 100644
--- a/native/src/unigram_dictionary.cpp
+++ b/native/src/unigram_dictionary.cpp
@@ -552,13 +552,13 @@ inline int UnigramDictionary::calculateFinalFreq(const int inputIndex, const int
if (sameLength && transposedPos < 0 && skipPos < 0 && excessivePos < 0) {
finalFreq = capped255MultForFullMatchAccentsOrCapitalizationDifference(finalFreq);
}
- } else if (lengthFreq / 2 == matchWeight && transposedPos < 0 && skipPos < 0
- && excessivePos < 0 && depth > 1) {
- // Full match except only one proximity correction
+ } else if (sameLength && transposedPos < 0 && skipPos < 0 && excessivePos < 0 && depth > 1) {
+ // A word with proximity corrections
if (DEBUG_DICT) {
LOGI("Found one proximity correction.");
}
- multiplyRate(WORDS_WITH_JUST_ONE_PROXIMITY_CHARACTER_PROMOTION_RATE, &finalFreq);
+ finalFreq *= 2;
+ multiplyRate(WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE, &finalFreq);
}
if (sameLength) finalFreq *= FULL_WORD_MULTIPLIER;
return finalFreq;