Loading native/jni/src/correction.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -977,7 +977,7 @@ int Correction::RankingAlgorithm::calcFreqForSplitMultipleWords( } const int freq = freqArray[i]; // Demote too short weak words if (wordLength <= 4 && freq <= MAX_FREQ * 2 / 3 /* heuristic... */) { if (wordLength <= 4 && freq <= SUPPRESS_SHORT_MULTIPLE_WORDS_THRESHOLD_FREQ) { multiplyRate(100 * freq / MAX_FREQ, &totalFreq); } if (wordLength == 1) { Loading native/jni/src/defines.h +2 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,8 @@ static inline void prof_out(void) { #define TWO_WORDS_CORRECTION_WITH_OTHER_ERROR_THRESHOLD 0.35 #define START_TWO_WORDS_CORRECTION_THRESHOLD 0.185 /* heuristic... This should be changed if we change the unit of the frequency. */ #define SUPPRESS_SHORT_MULTIPLE_WORDS_THRESHOLD_FREQ (MAX_FREQ * 58 / 100) #define MAX_DEPTH_MULTIPLIER 3 Loading native/jni/src/unigram_dictionary.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -503,8 +503,12 @@ bool UnigramDictionary::getSubStringSuggestion( freqArray, wordLengthArray, currentWordIndex + 1, isSpaceProximity, outputWord); if (DEBUG_DICT) { DUMP_WORD(outputWord, tempOutputWordLength); AKLOGI("Split two words: %d, %d, %d, %d, (%d) %d", freqArray[0], freqArray[1], pairFreq, inputLength, wordLengthArray[0], tempOutputWordLength); for (int i = 0; i < currentWordIndex + 1; ++i) { AKLOGI("Split %d,%d words: freq = %d, length = %d", i, currentWordIndex + 1, freqArray[i], wordLengthArray[i]); } AKLOGI("Split two words: freq = %d, length = %d, %d, isSpace ? %d", pairFreq, inputLength, tempOutputWordLength, isSpaceProximity); } addWord(outputWord, tempOutputWordLength, pairFreq, queuePool->getMasterQueue()); } Loading Loading
native/jni/src/correction.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -977,7 +977,7 @@ int Correction::RankingAlgorithm::calcFreqForSplitMultipleWords( } const int freq = freqArray[i]; // Demote too short weak words if (wordLength <= 4 && freq <= MAX_FREQ * 2 / 3 /* heuristic... */) { if (wordLength <= 4 && freq <= SUPPRESS_SHORT_MULTIPLE_WORDS_THRESHOLD_FREQ) { multiplyRate(100 * freq / MAX_FREQ, &totalFreq); } if (wordLength == 1) { Loading
native/jni/src/defines.h +2 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,8 @@ static inline void prof_out(void) { #define TWO_WORDS_CORRECTION_WITH_OTHER_ERROR_THRESHOLD 0.35 #define START_TWO_WORDS_CORRECTION_THRESHOLD 0.185 /* heuristic... This should be changed if we change the unit of the frequency. */ #define SUPPRESS_SHORT_MULTIPLE_WORDS_THRESHOLD_FREQ (MAX_FREQ * 58 / 100) #define MAX_DEPTH_MULTIPLIER 3 Loading
native/jni/src/unigram_dictionary.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -503,8 +503,12 @@ bool UnigramDictionary::getSubStringSuggestion( freqArray, wordLengthArray, currentWordIndex + 1, isSpaceProximity, outputWord); if (DEBUG_DICT) { DUMP_WORD(outputWord, tempOutputWordLength); AKLOGI("Split two words: %d, %d, %d, %d, (%d) %d", freqArray[0], freqArray[1], pairFreq, inputLength, wordLengthArray[0], tempOutputWordLength); for (int i = 0; i < currentWordIndex + 1; ++i) { AKLOGI("Split %d,%d words: freq = %d, length = %d", i, currentWordIndex + 1, freqArray[i], wordLengthArray[i]); } AKLOGI("Split two words: freq = %d, length = %d, %d, isSpace ? %d", pairFreq, inputLength, tempOutputWordLength, isSpaceProximity); } addWord(outputWord, tempOutputWordLength, pairFreq, queuePool->getMasterQueue()); } Loading