aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-09-20 20:37:44 +0900
committerSatoshi Kataoka <satok@google.com>2012-09-20 20:37:44 +0900
commit379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4 (patch)
tree1836a0f65c41e66e65b22c2282c2807935dffe7a /java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
parentf18fc03621b70f5a51cf54c4bf40eb213de40652 (diff)
parent54717534b1164c575a14a4a117284e72c6cd0ee0 (diff)
downloadlatinime-379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4.tar.gz
latinime-379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4.tar.xz
latinime-379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4.zip
Merge remote-tracking branch 'goog/jb-mr1-dev' into mergescriptpackage
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
index 6775de8a8..98cf308c8 100644
--- a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
+++ b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
@@ -556,6 +556,7 @@ public class FusionDictionary implements Iterable<Word> {
final StringBuilder checker = DBG ? new StringBuilder() : null;
CharGroup currentGroup;
+ final int codePointCountInS = s.codePointCount(0, s.length());
do {
int indexOfGroup = findIndexOfChar(node, s.codePointAt(index));
if (CHARACTER_NOT_FOUND == indexOfGroup) return null;
@@ -570,12 +571,12 @@ public class FusionDictionary implements Iterable<Word> {
index = newIndex;
if (DBG) checker.append(new String(currentGroup.mChars, 0, currentGroup.mChars.length));
- if (index < s.length()) {
+ if (index < codePointCountInS) {
node = currentGroup.mChildren;
}
- } while (null != node && index < s.length());
+ } while (null != node && index < codePointCountInS);
- if (index < s.length()) return null;
+ if (index < codePointCountInS) return null;
if (!currentGroup.isTerminal()) return null;
if (DBG && !s.equals(checker.toString())) return null;
return currentGroup;