diff options
author | 2011-04-15 23:37:38 +0900 | |
---|---|---|
committer | 2011-04-15 23:37:38 +0900 | |
commit | abcbe57252f914e827d1823e7d4151be4e30bdee (patch) | |
tree | a4dc0c30ef4063802ab58e3f639e194d519a1761 /native/src | |
parent | 7c06332be25535ed8182a348ba8e5535870f9f29 (diff) | |
parent | 8cd0acba6d3fbde8034b3ef5d26344003a40fa11 (diff) | |
download | latinime-abcbe57252f914e827d1823e7d4151be4e30bdee.tar.gz latinime-abcbe57252f914e827d1823e7d4151be4e30bdee.tar.xz latinime-abcbe57252f914e827d1823e7d4151be4e30bdee.zip |
Merge remote-tracking branch 'goog/master' into merge
Diffstat (limited to 'native/src')
-rw-r--r-- | native/src/defines.h | 2 | ||||
-rw-r--r-- | native/src/unigram_dictionary.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/native/src/defines.h b/native/src/defines.h index 2a06e9485..bdab19ff7 100644 --- a/native/src/defines.h +++ b/native/src/defines.h @@ -145,7 +145,7 @@ static void prof_out(void) { #define WORDS_WITH_EXCESSIVE_CHARACTER_OUT_OF_PROXIMITY_DEMOTION_RATE 75 #define WORDS_WITH_TRANSPOSED_CHARACTERS_DEMOTION_RATE 60 #define FULL_MATCHED_WORDS_PROMOTION_RATE 120 -#define WORDS_WITH_JUST_ONE_PROXIMITY_CHARACTER_PROMOTION_RATE 110 +#define WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE 90 // This should be greater than or equal to MAX_WORD_LENGTH defined in BinaryDictionary.java // This is only used for the size of array. Not to be used in c functions. 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; |