Loading java/src/com/android/inputmethod/research/FixedLogBuffer.java +2 −3 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public class FixedLogBuffer extends LogBuffer { */ @Override public void shiftIn(final LogUnit newLogUnit) { if (newLogUnit.getWord() == null) { if (!newLogUnit.hasWord()) { // This LogUnit isn't a word, so it doesn't count toward the word-limit. super.shiftIn(newLogUnit); return; Loading Loading @@ -153,8 +153,7 @@ public class FixedLogBuffer extends LogBuffer { for (int i = 0; i < length && n > 0; i++) { final LogUnit logUnit = logUnits.get(i); list.add(logUnit); final String word = logUnit.getWord(); if (word != null) { if (logUnit.hasWord()) { n--; } } Loading java/src/com/android/inputmethod/research/LogUnit.java +2 −2 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ import java.util.Map; * string. */ public void setWord(final String word) { if (mWord != null) { if (hasWord()) { // The word was already set once, and it is now being changed. See if the new word // is close to the old word. If so, then the change is probably a typo correction. // If not, the user may have decided to enter a different word, so flag it. Loading @@ -310,7 +310,7 @@ import java.util.Map; } public boolean hasWord() { return mWord != null; return mWord != null && !TextUtils.isEmpty(mWord.trim()); } public void setMayContainDigit() { Loading java/src/com/android/inputmethod/research/MainLogBuffer.java +13 −14 Original line number Diff line number Diff line Loading @@ -117,7 +117,7 @@ public abstract class MainLogBuffer extends FixedLogBuffer { if (IS_LOGGING_EVERYTHING) { if (mIsStopping) { return true; } else { } // Only check that it is the right length. If not, wait for later words to make // complete n-grams. int numWordsInLogUnitList = 0; Loading @@ -131,7 +131,6 @@ public abstract class MainLogBuffer extends FixedLogBuffer { } return numWordsInLogUnitList >= minNGramSize; } } // Check that we are not sampling too frequently. Having sampled recently might disclose // too much of the user's intended meaning. Loading @@ -157,14 +156,14 @@ public abstract class MainLogBuffer extends FixedLogBuffer { final int length = logUnits.size(); for (int i = 0; i < length; i++) { final LogUnit logUnit = logUnits.get(i); final String word = logUnit.getWord(); if (word == null) { if (!logUnit.hasWord()) { // Digits outside words are a privacy threat. if (logUnit.mayContainDigit()) { return false; } } else { numWordsInLogUnitList++; final String word = logUnit.getWord(); // Words not in the dictionary are a privacy threat. if (ResearchLogger.hasLetters(word) && !(dictionary.isValidWord(word))) { if (DEBUG) { Loading Loading
java/src/com/android/inputmethod/research/FixedLogBuffer.java +2 −3 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public class FixedLogBuffer extends LogBuffer { */ @Override public void shiftIn(final LogUnit newLogUnit) { if (newLogUnit.getWord() == null) { if (!newLogUnit.hasWord()) { // This LogUnit isn't a word, so it doesn't count toward the word-limit. super.shiftIn(newLogUnit); return; Loading Loading @@ -153,8 +153,7 @@ public class FixedLogBuffer extends LogBuffer { for (int i = 0; i < length && n > 0; i++) { final LogUnit logUnit = logUnits.get(i); list.add(logUnit); final String word = logUnit.getWord(); if (word != null) { if (logUnit.hasWord()) { n--; } } Loading
java/src/com/android/inputmethod/research/LogUnit.java +2 −2 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ import java.util.Map; * string. */ public void setWord(final String word) { if (mWord != null) { if (hasWord()) { // The word was already set once, and it is now being changed. See if the new word // is close to the old word. If so, then the change is probably a typo correction. // If not, the user may have decided to enter a different word, so flag it. Loading @@ -310,7 +310,7 @@ import java.util.Map; } public boolean hasWord() { return mWord != null; return mWord != null && !TextUtils.isEmpty(mWord.trim()); } public void setMayContainDigit() { Loading
java/src/com/android/inputmethod/research/MainLogBuffer.java +13 −14 Original line number Diff line number Diff line Loading @@ -117,7 +117,7 @@ public abstract class MainLogBuffer extends FixedLogBuffer { if (IS_LOGGING_EVERYTHING) { if (mIsStopping) { return true; } else { } // Only check that it is the right length. If not, wait for later words to make // complete n-grams. int numWordsInLogUnitList = 0; Loading @@ -131,7 +131,6 @@ public abstract class MainLogBuffer extends FixedLogBuffer { } return numWordsInLogUnitList >= minNGramSize; } } // Check that we are not sampling too frequently. Having sampled recently might disclose // too much of the user's intended meaning. Loading @@ -157,14 +156,14 @@ public abstract class MainLogBuffer extends FixedLogBuffer { final int length = logUnits.size(); for (int i = 0; i < length; i++) { final LogUnit logUnit = logUnits.get(i); final String word = logUnit.getWord(); if (word == null) { if (!logUnit.hasWord()) { // Digits outside words are a privacy threat. if (logUnit.mayContainDigit()) { return false; } } else { numWordsInLogUnitList++; final String word = logUnit.getWord(); // Words not in the dictionary are a privacy threat. if (ResearchLogger.hasLetters(word) && !(dictionary.isValidWord(word))) { if (DEBUG) { Loading