aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/research/Statistics.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/research/Statistics.java')
-rw-r--r--java/src/com/android/inputmethod/research/Statistics.java34
1 files changed, 25 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/research/Statistics.java b/java/src/com/android/inputmethod/research/Statistics.java
index a9202651e..50e2b7fbc 100644
--- a/java/src/com/android/inputmethod/research/Statistics.java
+++ b/java/src/com/android/inputmethod/research/Statistics.java
@@ -1,17 +1,17 @@
/*
* Copyright (C) 2012 The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.android.inputmethod.research;
@@ -25,6 +25,7 @@ public class Statistics {
private static final String TAG = Statistics.class.getSimpleName();
private static final boolean DEBUG = false && ProductionFlag.IS_EXPERIMENTAL_DEBUG;
+ // TODO: Cleanup comments to only including those giving meaningful information.
// Number of characters entered during a typing session
int mCharCount;
// Number of letter characters entered during a typing session
@@ -41,6 +42,8 @@ public class Statistics {
int mDictionaryWordCount;
// Number of words split and spaces automatically entered.
int mSplitWordsCount;
+ // Number of words entered during a session.
+ int mCorrectedWordsCount;
// Number of gestures that were input.
int mGesturesInputCount;
// Number of gestures that were deleted.
@@ -49,6 +52,8 @@ public class Statistics {
int mGesturesCharsCount;
// Number of manual suggestions chosen.
int mManualSuggestionsCount;
+ // Number of times that autocorrection was invoked.
+ int mAutoCorrectionsCount;
// Number of times a commit was reverted in this session.
int mRevertCommitsCount;
// Whether the text field was empty upon editing
@@ -113,10 +118,12 @@ public class Statistics {
mWordCount = 0;
mDictionaryWordCount = 0;
mSplitWordsCount = 0;
+ mCorrectedWordsCount = 0;
mGesturesInputCount = 0;
mGesturesDeletedCount = 0;
mManualSuggestionsCount = 0;
mRevertCommitsCount = 0;
+ mAutoCorrectionsCount = 0;
mIsEmptyUponStarting = true;
mIsEmptinessStateKnown = false;
mKeyCounter.reset();
@@ -152,11 +159,15 @@ public class Statistics {
}
}
- public void recordWordEntered(final boolean isDictionaryWord) {
+ public void recordWordEntered(final boolean isDictionaryWord,
+ final boolean containsCorrection) {
mWordCount++;
if (isDictionaryWord) {
mDictionaryWordCount++;
}
+ if (containsCorrection) {
+ mCorrectedWordsCount++;
+ }
}
public void recordSplitWords() {
@@ -184,6 +195,11 @@ public class Statistics {
recordUserAction(time, false /* isDeletion */);
}
+ public void recordAutoCorrection(final long time) {
+ mAutoCorrectionsCount++;
+ recordUserAction(time, false /* isDeletion */);
+ }
+
public void recordRevertCommit(final long time) {
mRevertCommitsCount++;
recordUserAction(time, true /* isDeletion */);