diff options
author | 2011-04-18 19:43:30 +0900 | |
---|---|---|
committer | 2011-04-18 19:43:30 +0900 | |
commit | bee72ecf21d6de19fa785021ad52653f00836415 (patch) | |
tree | 7fa6042841cdb3ddf02a05384c5fb1b535ea68d0 /native/src | |
parent | abcbe57252f914e827d1823e7d4151be4e30bdee (diff) | |
parent | bc3dba451a7af85eab600968fbafda3040b7ced4 (diff) | |
download | latinime-bee72ecf21d6de19fa785021ad52653f00836415.tar.gz latinime-bee72ecf21d6de19fa785021ad52653f00836415.tar.xz latinime-bee72ecf21d6de19fa785021ad52653f00836415.zip |
Merge remote-tracking branch 'goog/master' into merge
Conflicts:
java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java
Change-Id: I596f9584478637284d6922aae672dc276563ffc1
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, 8 insertions, 2 deletions
diff --git a/native/src/defines.h b/native/src/defines.h index bdab19ff7..a5ed6827b 100644 --- a/native/src/defines.h +++ b/native/src/defines.h @@ -140,7 +140,7 @@ static void prof_out(void) { // The following "rate"s are used as a multiplier before dividing by 100, so they are in percent. #define WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE 80 #define WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X 12 -#define WORDS_WITH_MISSING_SPACE_CHARACTER_DEMOTION_RATE 80 +#define WORDS_WITH_MISSING_SPACE_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_TRANSPOSED_CHARACTERS_DEMOTION_RATE 60 diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp index 89a1c9ea6..8e82f1474 100644 --- a/native/src/unigram_dictionary.cpp +++ b/native/src/unigram_dictionary.cpp @@ -448,8 +448,14 @@ bool UnigramDictionary::getSplitTwoWordsSuggestion(const int inputLength, word[i] = mWord[i - firstWordLength - 1]; } - int pairFreq = ((firstFreq + secondFreq) / 2); + // Promote pairFreq with multiplying by 2, because the word length is the same as the typed + // length. + int pairFreq = firstFreq + secondFreq; for (int i = 0; i < inputLength; ++i) pairFreq *= TYPED_LETTER_MULTIPLIER; + if (DEBUG_DICT) { + LOGI("Missing space: %d, %d, %d, %d, %d", firstFreq, secondFreq, pairFreq, inputLength, + TYPED_LETTER_MULTIPLIER); + } multiplyRate(WORDS_WITH_MISSING_SPACE_CHARACTER_DEMOTION_RATE, &pairFreq); addWord(word, newWordLength, pairFreq); return true; |