Skip to content
Snippets Groups Projects
Commit 097e75ef authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi Committed by Android (Google) Code Review
Browse files

Merge "Fix: -1 can be used as a code point of most probable string."

parents d694e354 33e38096
No related branches found
No related tags found
No related merge requests found
...@@ -992,7 +992,16 @@ namespace latinime { ...@@ -992,7 +992,16 @@ namespace latinime {
} }
} }
if (character != NOT_AN_INDEX) { if (character != NOT_AN_INDEX) {
codePointBuf[index] = proximityInfo->getCodePointOf(character); const int codePoint = proximityInfo->getCodePointOf(character);
if (codePoint == NOT_A_CODE_POINT) {
AKLOGE("Key index(%d) is not found. Cannot construct most probable string",
character);
ASSERT(false);
// Make the length zero, which means most probable string won't be used.
index = 0;
break;
}
codePointBuf[index] = codePoint;
index++; index++;
} }
sumLogProbability += minLogProbability; sumLogProbability += minLogProbability;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment