From 315ab9800739e28c200b6efb8f35887965a38020 Mon Sep 17 00:00:00 2001 From: Kurt Partridge Date: Fri, 24 May 2013 15:24:34 -0700 Subject: [PATCH] Rename containsCorrection to containsUserDeletions This change renames containsCorrection to avoid confusion with CorrectionInfo, and to better clarify its meaning. Change-Id: I5d8f8e2b03133c15a60d4e8b0f395cda1fff5447 --- .../com/android/inputmethod/research/LogUnit.java | 14 +++++++------- .../inputmethod/research/ResearchLogger.java | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/java/src/com/android/inputmethod/research/LogUnit.java b/java/src/com/android/inputmethod/research/LogUnit.java index cf1388f46..164c7e8cc 100644 --- a/java/src/com/android/inputmethod/research/LogUnit.java +++ b/java/src/com/android/inputmethod/research/LogUnit.java @@ -67,7 +67,7 @@ public class LogUnit { private String[] mWordArray = EMPTY_STRING_ARRAY; private boolean mMayContainDigit; private boolean mIsPartOfMegaword; - private boolean mContainsCorrection; + private boolean mContainsUserDeletions; // mCorrectionType indicates whether the word was corrected at all, and if so, the nature of the // correction. @@ -277,13 +277,13 @@ public class LogUnit { } // TODO: Refactor to eliminate getter/setters - public void setContainsCorrection() { - mContainsCorrection = true; + public void setContainsUserDeletions() { + mContainsUserDeletions = true; } // TODO: Refactor to eliminate getter/setters - public boolean containsCorrection() { - return mContainsCorrection; + public boolean containsUserDeletions() { + return mContainsUserDeletions; } // TODO: Refactor to eliminate getter/setters @@ -323,7 +323,7 @@ public class LogUnit { true /* isPartOfMegaword */); newLogUnit.mWords = null; newLogUnit.mMayContainDigit = mMayContainDigit; - newLogUnit.mContainsCorrection = mContainsCorrection; + newLogUnit.mContainsUserDeletions = mContainsUserDeletions; // Purge the logStatements and associated data from this LogUnit. laterLogStatements.clear(); @@ -346,7 +346,7 @@ public class LogUnit { setWords(logUnit.mWords); } mMayContainDigit = mMayContainDigit || logUnit.mMayContainDigit; - mContainsCorrection = mContainsCorrection || logUnit.mContainsCorrection; + mContainsUserDeletions = mContainsUserDeletions || logUnit.mContainsUserDeletions; mIsPartOfMegaword = false; } diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java index 64f0349fc..a87af6b91 100644 --- a/java/src/com/android/inputmethod/research/ResearchLogger.java +++ b/java/src/com/android/inputmethod/research/ResearchLogger.java @@ -260,14 +260,14 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang if (DEBUG) { final String wordsString = logUnit.getWordsAsString(); Log.d(TAG, "onPublish: '" + wordsString - + "', hc: " + logUnit.containsCorrection() + + "', hc: " + logUnit.containsUserDeletions() + ", cipd: " + canIncludePrivateData); } for (final String word : logUnit.getWordsAsStringArray()) { final Dictionary dictionary = getDictionary(); mStatistics.recordWordEntered( dictionary != null && dictionary.isValidWord(word), - logUnit.containsCorrection()); + logUnit.containsUserDeletions()); } } publishLogUnits(logUnits, mMainResearchLog, canIncludePrivateData); @@ -819,8 +819,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang mCurrentLogUnit.setMayContainDigit(); } - private void setCurrentLogUnitContainsCorrection() { - mCurrentLogUnit.setContainsCorrection(); + private void setCurrentLogUnitContainsUserDeletions() { + mCurrentLogUnit.setContainsUserDeletions(); } private void setCurrentLogUnitCorrectionType(final int correctionType) { @@ -920,7 +920,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang if (DEBUG) { Log.d(TAG, "publishLogBuffer: " + (logUnit.hasOneOrMoreWords() ? logUnit.getWordsAsString() : "") - + ", correction?: " + logUnit.containsCorrection()); + + ", correction?: " + logUnit.containsUserDeletions()); } researchLog.publish(logUnit, canIncludePrivateData); } @@ -1286,7 +1286,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang final ResearchLogger researchLogger = getInstance(); if (!replacedWord.equals(suggestion.toString())) { // The user chose something other than what was already there. - researchLogger.setCurrentLogUnitContainsCorrection(); + researchLogger.setCurrentLogUnitContainsUserDeletions(); researchLogger.setCurrentLogUnitCorrectionType(LogUnit.CORRECTIONTYPE_TYPO); } final String scrubbedWord = scrubDigitsFromString(suggestion); @@ -1463,7 +1463,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang LOGSTATEMENT_LATINIME_REVERTCOMMIT, committedWord, originallyTypedWord, separatorString); if (logUnit != null) { - logUnit.setContainsCorrection(); + logUnit.setContainsUserDeletions(); } researchLogger.mStatistics.recordRevertCommit(SystemClock.uptimeMillis()); }