Rename containsCorrection to containsUserDeletions
This change renames containsCorrection to avoid confusion with CorrectionInfo, and to better clarify its meaning. Change-Id: I5d8f8e2b03133c15a60d4e8b0f395cda1fff5447main
parent
89c66fc12e
commit
315ab98007
|
@ -67,7 +67,7 @@ public class LogUnit {
|
||||||
private String[] mWordArray = EMPTY_STRING_ARRAY;
|
private String[] mWordArray = EMPTY_STRING_ARRAY;
|
||||||
private boolean mMayContainDigit;
|
private boolean mMayContainDigit;
|
||||||
private boolean mIsPartOfMegaword;
|
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
|
// mCorrectionType indicates whether the word was corrected at all, and if so, the nature of the
|
||||||
// correction.
|
// correction.
|
||||||
|
@ -277,13 +277,13 @@ public class LogUnit {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Refactor to eliminate getter/setters
|
// TODO: Refactor to eliminate getter/setters
|
||||||
public void setContainsCorrection() {
|
public void setContainsUserDeletions() {
|
||||||
mContainsCorrection = true;
|
mContainsUserDeletions = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Refactor to eliminate getter/setters
|
// TODO: Refactor to eliminate getter/setters
|
||||||
public boolean containsCorrection() {
|
public boolean containsUserDeletions() {
|
||||||
return mContainsCorrection;
|
return mContainsUserDeletions;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Refactor to eliminate getter/setters
|
// TODO: Refactor to eliminate getter/setters
|
||||||
|
@ -323,7 +323,7 @@ public class LogUnit {
|
||||||
true /* isPartOfMegaword */);
|
true /* isPartOfMegaword */);
|
||||||
newLogUnit.mWords = null;
|
newLogUnit.mWords = null;
|
||||||
newLogUnit.mMayContainDigit = mMayContainDigit;
|
newLogUnit.mMayContainDigit = mMayContainDigit;
|
||||||
newLogUnit.mContainsCorrection = mContainsCorrection;
|
newLogUnit.mContainsUserDeletions = mContainsUserDeletions;
|
||||||
|
|
||||||
// Purge the logStatements and associated data from this LogUnit.
|
// Purge the logStatements and associated data from this LogUnit.
|
||||||
laterLogStatements.clear();
|
laterLogStatements.clear();
|
||||||
|
@ -346,7 +346,7 @@ public class LogUnit {
|
||||||
setWords(logUnit.mWords);
|
setWords(logUnit.mWords);
|
||||||
}
|
}
|
||||||
mMayContainDigit = mMayContainDigit || logUnit.mMayContainDigit;
|
mMayContainDigit = mMayContainDigit || logUnit.mMayContainDigit;
|
||||||
mContainsCorrection = mContainsCorrection || logUnit.mContainsCorrection;
|
mContainsUserDeletions = mContainsUserDeletions || logUnit.mContainsUserDeletions;
|
||||||
mIsPartOfMegaword = false;
|
mIsPartOfMegaword = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -260,14 +260,14 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
final String wordsString = logUnit.getWordsAsString();
|
final String wordsString = logUnit.getWordsAsString();
|
||||||
Log.d(TAG, "onPublish: '" + wordsString
|
Log.d(TAG, "onPublish: '" + wordsString
|
||||||
+ "', hc: " + logUnit.containsCorrection()
|
+ "', hc: " + logUnit.containsUserDeletions()
|
||||||
+ ", cipd: " + canIncludePrivateData);
|
+ ", cipd: " + canIncludePrivateData);
|
||||||
}
|
}
|
||||||
for (final String word : logUnit.getWordsAsStringArray()) {
|
for (final String word : logUnit.getWordsAsStringArray()) {
|
||||||
final Dictionary dictionary = getDictionary();
|
final Dictionary dictionary = getDictionary();
|
||||||
mStatistics.recordWordEntered(
|
mStatistics.recordWordEntered(
|
||||||
dictionary != null && dictionary.isValidWord(word),
|
dictionary != null && dictionary.isValidWord(word),
|
||||||
logUnit.containsCorrection());
|
logUnit.containsUserDeletions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
publishLogUnits(logUnits, mMainResearchLog, canIncludePrivateData);
|
publishLogUnits(logUnits, mMainResearchLog, canIncludePrivateData);
|
||||||
|
@ -819,8 +819,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
mCurrentLogUnit.setMayContainDigit();
|
mCurrentLogUnit.setMayContainDigit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCurrentLogUnitContainsCorrection() {
|
private void setCurrentLogUnitContainsUserDeletions() {
|
||||||
mCurrentLogUnit.setContainsCorrection();
|
mCurrentLogUnit.setContainsUserDeletions();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCurrentLogUnitCorrectionType(final int correctionType) {
|
private void setCurrentLogUnitCorrectionType(final int correctionType) {
|
||||||
|
@ -920,7 +920,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, "publishLogBuffer: " + (logUnit.hasOneOrMoreWords()
|
Log.d(TAG, "publishLogBuffer: " + (logUnit.hasOneOrMoreWords()
|
||||||
? logUnit.getWordsAsString() : "<wordless>")
|
? logUnit.getWordsAsString() : "<wordless>")
|
||||||
+ ", correction?: " + logUnit.containsCorrection());
|
+ ", correction?: " + logUnit.containsUserDeletions());
|
||||||
}
|
}
|
||||||
researchLog.publish(logUnit, canIncludePrivateData);
|
researchLog.publish(logUnit, canIncludePrivateData);
|
||||||
}
|
}
|
||||||
|
@ -1286,7 +1286,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
final ResearchLogger researchLogger = getInstance();
|
final ResearchLogger researchLogger = getInstance();
|
||||||
if (!replacedWord.equals(suggestion.toString())) {
|
if (!replacedWord.equals(suggestion.toString())) {
|
||||||
// The user chose something other than what was already there.
|
// The user chose something other than what was already there.
|
||||||
researchLogger.setCurrentLogUnitContainsCorrection();
|
researchLogger.setCurrentLogUnitContainsUserDeletions();
|
||||||
researchLogger.setCurrentLogUnitCorrectionType(LogUnit.CORRECTIONTYPE_TYPO);
|
researchLogger.setCurrentLogUnitCorrectionType(LogUnit.CORRECTIONTYPE_TYPO);
|
||||||
}
|
}
|
||||||
final String scrubbedWord = scrubDigitsFromString(suggestion);
|
final String scrubbedWord = scrubDigitsFromString(suggestion);
|
||||||
|
@ -1463,7 +1463,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
LOGSTATEMENT_LATINIME_REVERTCOMMIT, committedWord, originallyTypedWord,
|
LOGSTATEMENT_LATINIME_REVERTCOMMIT, committedWord, originallyTypedWord,
|
||||||
separatorString);
|
separatorString);
|
||||||
if (logUnit != null) {
|
if (logUnit != null) {
|
||||||
logUnit.setContainsCorrection();
|
logUnit.setContainsUserDeletions();
|
||||||
}
|
}
|
||||||
researchLogger.mStatistics.recordRevertCommit(SystemClock.uptimeMillis());
|
researchLogger.mStatistics.recordRevertCommit(SystemClock.uptimeMillis());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue