Loading native/jni/src/binary_format.h +2 −2 Original line number Diff line number Diff line Loading @@ -360,7 +360,7 @@ inline int BinaryFormat::getTerminalPosition(const uint8_t *const root, while (true) { // If we already traversed the tree further than the word is long, there means // there was no match (or we would have found it). if (wordPos > length) return NOT_VALID_WORD; if (wordPos >= length) return NOT_VALID_WORD; int charGroupCount = BinaryFormat::getGroupCountAndForwardPointer(root, &pos); const int32_t wChar = forceLowerCaseSearch ? toLowerCase(inWord[wordPos]) : inWord[wordPos]; while (true) { Loading @@ -383,7 +383,7 @@ inline int BinaryFormat::getTerminalPosition(const uint8_t *const root, // character that does not match, as explained above, it means the word is // not in the dictionary (by virtue of this chargroup being the only one to // match the word on the first character, but not matching the whole word). if (wordPos > length) return NOT_VALID_WORD; if (wordPos >= length) return NOT_VALID_WORD; if (inWord[wordPos] != character) return NOT_VALID_WORD; character = BinaryFormat::getCodePointAndForwardPointer(root, &pos); } Loading native/jni/src/unigram_dictionary.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -546,9 +546,9 @@ int UnigramDictionary::getSubStringSuggestion( freq = score >> (nextWordLength + TWO_WORDS_PLUS_OTHER_ERROR_CORRECTION_DEMOTION_DIVIDER); } if (DEBUG_DICT) { AKLOGI("Freq(%d): %d, length: %d, input length: %d, input start: %d (%d)" , currentWordIndex, freq, nextWordLength, inputWordLength, inputWordStartPos, wordLengthArray[0]); AKLOGI("Freq(%d): %d, length: %d, input length: %d, input start: %d (%d)", currentWordIndex, freq, nextWordLength, inputWordLength, inputWordStartPos, (currentWordIndex > 0) ? wordLengthArray[0] : 0); } if (freq <= 0 || nextWordLength <= 0 || MAX_WORD_LENGTH <= (outputWordStartPos + nextWordLength)) { Loading Loading
native/jni/src/binary_format.h +2 −2 Original line number Diff line number Diff line Loading @@ -360,7 +360,7 @@ inline int BinaryFormat::getTerminalPosition(const uint8_t *const root, while (true) { // If we already traversed the tree further than the word is long, there means // there was no match (or we would have found it). if (wordPos > length) return NOT_VALID_WORD; if (wordPos >= length) return NOT_VALID_WORD; int charGroupCount = BinaryFormat::getGroupCountAndForwardPointer(root, &pos); const int32_t wChar = forceLowerCaseSearch ? toLowerCase(inWord[wordPos]) : inWord[wordPos]; while (true) { Loading @@ -383,7 +383,7 @@ inline int BinaryFormat::getTerminalPosition(const uint8_t *const root, // character that does not match, as explained above, it means the word is // not in the dictionary (by virtue of this chargroup being the only one to // match the word on the first character, but not matching the whole word). if (wordPos > length) return NOT_VALID_WORD; if (wordPos >= length) return NOT_VALID_WORD; if (inWord[wordPos] != character) return NOT_VALID_WORD; character = BinaryFormat::getCodePointAndForwardPointer(root, &pos); } Loading
native/jni/src/unigram_dictionary.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -546,9 +546,9 @@ int UnigramDictionary::getSubStringSuggestion( freq = score >> (nextWordLength + TWO_WORDS_PLUS_OTHER_ERROR_CORRECTION_DEMOTION_DIVIDER); } if (DEBUG_DICT) { AKLOGI("Freq(%d): %d, length: %d, input length: %d, input start: %d (%d)" , currentWordIndex, freq, nextWordLength, inputWordLength, inputWordStartPos, wordLengthArray[0]); AKLOGI("Freq(%d): %d, length: %d, input length: %d, input start: %d (%d)", currentWordIndex, freq, nextWordLength, inputWordLength, inputWordStartPos, (currentWordIndex > 0) ? wordLengthArray[0] : 0); } if (freq <= 0 || nextWordLength <= 0 || MAX_WORD_LENGTH <= (outputWordStartPos + nextWordLength)) { Loading