diff options
author | 2013-01-09 19:52:44 -0800 | |
---|---|---|
committer | 2013-01-09 19:52:45 -0800 | |
commit | f11c4a9aeb9b08d6c0c29861c3d9832334834d90 (patch) | |
tree | c0119792472af91562c500e35bc1c426f4f7936c /java/src/com/android/inputmethod/research/MainLogBuffer.java | |
parent | 95e3008d2503916a71cee322146d8a0097326000 (diff) | |
parent | 3b95eaf70b0a11b1c6e0c52361fe738b4a4b2ace (diff) | |
download | latinime-f11c4a9aeb9b08d6c0c29861c3d9832334834d90.tar.gz latinime-f11c4a9aeb9b08d6c0c29861c3d9832334834d90.tar.xz latinime-f11c4a9aeb9b08d6c0c29861c3d9832334834d90.zip |
Merge "[Rlog50] capture bigrams properly even with deletions"
Diffstat (limited to 'java/src/com/android/inputmethod/research/MainLogBuffer.java')
-rw-r--r-- | java/src/com/android/inputmethod/research/MainLogBuffer.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/research/MainLogBuffer.java b/java/src/com/android/inputmethod/research/MainLogBuffer.java index bec21d7e0..898a042d6 100644 --- a/java/src/com/android/inputmethod/research/MainLogBuffer.java +++ b/java/src/com/android/inputmethod/research/MainLogBuffer.java @@ -119,6 +119,7 @@ public class MainLogBuffer extends FixedLogBuffer { // complete buffer contents in detail. final LinkedList<LogUnit> logUnits = getLogUnits(); final int length = logUnits.size(); + int wordsFound = 0; for (int i = 0; i < length; i++) { final LogUnit logUnit = logUnits.get(i); final String word = logUnit.getWord(); @@ -135,9 +136,18 @@ public class MainLogBuffer extends FixedLogBuffer { + ", isValid: " + (dictionary.isValidWord(word))); } return false; + } else { + wordsFound++; } } } + if (wordsFound < N_GRAM_SIZE) { + // Not enough words. Not unsafe, but reject anyway. + if (DEBUG) { + Log.d(TAG, "not enough words"); + } + return false; + } // All checks have passed; this buffer's content can be safely uploaded. return true; } |