Skip to content
Snippets Groups Projects
Commit fdfa03c9 authored by Kurt Partridge's avatar Kurt Partridge Committed by Android (Google) Code Review
Browse files

Merge "ResearchLogger switch word segmentation"

parents 2ae580ea 6a072047
No related branches found
No related tags found
No related merge requests found
......@@ -733,20 +733,20 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
researchLog.publish(closingLogUnit, true /* isIncludingPrivateData */);
}
private boolean hasOnlyLetters(final String word) {
private boolean hasLetters(final String word) {
final int length = word.length();
for (int i = 0; i < length; i = word.offsetByCodePoints(i, 1)) {
final int codePoint = word.codePointAt(i);
if (!Character.isLetter(codePoint)) {
return false;
if (Character.isLetter(codePoint)) {
return true;
}
}
return true;
return false;
}
private void onWordComplete(final String word) {
Log.d(TAG, "onWordComplete: " + word);
if (word != null && word.length() > 0 && hasOnlyLetters(word)) {
if (word != null && word.length() > 0 && hasLetters(word)) {
mCurrentLogUnit.setWord(word);
mStatistics.recordWordEntered();
}
......
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