aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorKurt Partridge <kep@google.com>2013-06-14 17:03:03 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-06-14 17:03:03 +0000
commit14718ab898e2f23b078b9f25aa234c1e673517c7 (patch)
tree50d27cd81e6de45322023e2433491e29dc210b5e /java/src
parent0052dbda762b1871c3214a6abeb5e89f11e091cd (diff)
parentfc98325c61e5df3845f3d2b4906b0af301204b73 (diff)
downloadlatinime-14718ab898e2f23b078b9f25aa234c1e673517c7.tar.gz
latinime-14718ab898e2f23b078b9f25aa234c1e673517c7.tar.xz
latinime-14718ab898e2f23b078b9f25aa234c1e673517c7.zip
Merge "Log score, kind, and sourceDict for manual suggestion and gesture"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java3
-rw-r--r--java/src/com/android/inputmethod/research/JsonUtils.java9
-rw-r--r--java/src/com/android/inputmethod/research/ResearchLogger.java11
3 files changed, 15 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 6a3066cc1..73ec57871 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -2357,7 +2357,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
LastComposedWord.NOT_A_SEPARATOR);
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
ResearchLogger.latinIME_pickSuggestionManually(replacedWord, index, suggestion,
- mWordComposer.isBatchMode());
+ mWordComposer.isBatchMode(), suggestionInfo.mScore, suggestionInfo.mKind,
+ suggestionInfo.mSourceDict);
}
mConnection.endBatchEdit();
// Don't allow cancellation of manual pick
diff --git a/java/src/com/android/inputmethod/research/JsonUtils.java b/java/src/com/android/inputmethod/research/JsonUtils.java
index 24cd8d935..63d524df7 100644
--- a/java/src/com/android/inputmethod/research/JsonUtils.java
+++ b/java/src/com/android/inputmethod/research/JsonUtils.java
@@ -94,12 +94,17 @@ import java.util.Map;
.value(words.mIsPunctuationSuggestions);
jsonWriter.name("isObsoleteSuggestions").value(words.mIsObsoleteSuggestions);
jsonWriter.name("isPrediction").value(words.mIsPrediction);
- jsonWriter.name("words");
+ jsonWriter.name("suggestedWords");
jsonWriter.beginArray();
final int size = words.size();
for (int j = 0; j < size; j++) {
final SuggestedWordInfo wordInfo = words.getInfo(j);
- jsonWriter.value(wordInfo.toString());
+ jsonWriter.beginObject();
+ jsonWriter.name("word").value(wordInfo.toString());
+ jsonWriter.name("score").value(wordInfo.mScore);
+ jsonWriter.name("kind").value(wordInfo.mKind);
+ jsonWriter.name("sourceDict").value(wordInfo.mSourceDict);
+ jsonWriter.endObject();
}
jsonWriter.endArray();
jsonWriter.endObject();
diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java
index e890b74aa..6029ba963 100644
--- a/java/src/com/android/inputmethod/research/ResearchLogger.java
+++ b/java/src/com/android/inputmethod/research/ResearchLogger.java
@@ -1308,9 +1308,10 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
*/
private static final LogStatement LOGSTATEMENT_LATINIME_PICKSUGGESTIONMANUALLY =
new LogStatement("LatinIMEPickSuggestionManually", true, false, "replacedWord", "index",
- "suggestion", "x", "y", "isBatchMode");
+ "suggestion", "x", "y", "isBatchMode", "score", "kind", "sourceDict");
public static void latinIME_pickSuggestionManually(final String replacedWord,
- final int index, final String suggestion, final boolean isBatchMode) {
+ final int index, final String suggestion, final boolean isBatchMode,
+ final int score, final int kind, final String sourceDict) {
final ResearchLogger researchLogger = getInstance();
if (!replacedWord.equals(suggestion.toString())) {
// The user chose something other than what was already there.
@@ -1321,7 +1322,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_PICKSUGGESTIONMANUALLY,
scrubDigitsFromString(replacedWord), index,
suggestion == null ? null : scrubbedWord, Constants.SUGGESTION_STRIP_COORDINATE,
- Constants.SUGGESTION_STRIP_COORDINATE, isBatchMode);
+ Constants.SUGGESTION_STRIP_COORDINATE, isBatchMode, score, kind, sourceDict);
researchLogger.commitCurrentLogUnitAsWord(scrubbedWord, Long.MAX_VALUE, isBatchMode);
researchLogger.mStatistics.recordManualSuggestion(SystemClock.uptimeMillis());
}
@@ -1843,7 +1844,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
*/
private static final LogStatement LOGSTATEMENT_LATINIME_ONENDBATCHINPUT =
new LogStatement("LatinIMEOnEndBatchInput", true, false, "enteredText",
- "enteredWordPos");
+ "enteredWordPos", "suggestedWords");
public static void latinIME_onEndBatchInput(final CharSequence enteredText,
final int enteredWordPos, final SuggestedWords suggestedWords) {
final ResearchLogger researchLogger = getInstance();
@@ -1851,7 +1852,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
researchLogger.mCurrentLogUnit.setWords(enteredText.toString());
}
researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_ONENDBATCHINPUT, enteredText,
- enteredWordPos);
+ enteredWordPos, suggestedWords);
researchLogger.mCurrentLogUnit.initializeSuggestions(suggestedWords);
researchLogger.mStatistics.recordGestureInput(enteredText.length(),
SystemClock.uptimeMillis());