Merge "move suggested words logpoint to SuggestionsView.java"

main
Kurt Partridge 2012-04-09 17:26:01 -07:00 committed by Android (Google) Code Review
commit a601ef03db
3 changed files with 12 additions and 35 deletions

View File

@ -21,8 +21,6 @@ import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import android.text.TextUtils;
import android.util.Log;
import com.android.inputmethod.latin.define.ProductionFlag;
import java.util.ArrayList;
import java.util.HashMap;
@ -117,19 +115,10 @@ public class AutoCorrection {
+ autoCorrectionSuggestionScore + ", " + normalizedScore
+ "(" + autoCorrectionThreshold + ")");
}
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.autoCorrection_hasAutoCorrectionForBinaryDictionary(consideredWord,
autoCorrectionThreshold, autoCorrectionSuggestion.toString(),
autoCorrectionSuggestionScore, normalizedScore);
}
if (normalizedScore >= autoCorrectionThreshold) {
if (DBG) {
Log.d(TAG, "Auto corrected by S-threshold.");
}
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger
.autoCorrection_hasAutoCorrectionForBinaryDictionary_bySthreshold();
}
return true;
}
}

View File

@ -277,11 +277,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
private static final boolean ALPHABETSHIFTSTATE_SETSHIFTLOCKED_ENABLED = DEFAULT_ENABLED;
private static final boolean ALPHABETSHIFTSTATE_SETAUTOMATICSHIFTED_ENABLED
= DEFAULT_ENABLED;
private static final boolean AUTOCORRECTION_HASAUTOCORRECTIONFORBINARYDICTIONARY_ENABLED
= DEFAULT_ENABLED;
private static final boolean
AUTOCORRECTION_HASAUTOCORRECTIONFORBINARYDICTIONARY_BYSTHRESHOLD_ENABLED
= DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONCANCELINPUT_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONCODEINPUT_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONLONGPRESSTIMEOUT_ENABLED = DEFAULT_ENABLED;
@ -317,6 +312,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
private static final boolean POINTERTRACKER_ONMOVEEVENT_ENABLED = DEFAULT_ENABLED;
private static final boolean SUDDENJUMPINGTOUCHEVENTHANDLER_ONTOUCHEVENT_ENABLED
= DEFAULT_ENABLED;
private static final boolean SUGGESTIONSVIEW_SETSUGGESTIONS_ENABLED = DEFAULT_ENABLED;
}
public static void logUnstructured(String logGroup, final String details) {
@ -397,25 +393,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
}
public static void autoCorrection_hasAutoCorrectionForBinaryDictionary(
final CharSequence consideredWord, final double autoCorrectionThreshold,
final CharSequence autoCorrectionSuggestion, final int autoCorrectionSuggestionScore,
final double normalizedScore) {
if (UnsLogGroup.AUTOCORRECTION_HASAUTOCORRECTIONFORBINARYDICTIONARY_ENABLED) {
final String s = "Normalized " + consideredWord + ","
+ autoCorrectionSuggestion + "," + autoCorrectionSuggestionScore
+ ", " + normalizedScore + "(" + autoCorrectionThreshold + ")";
logUnstructured("AutoCorrection_hasAutoCorrectionForBinaryDictionary", s);
}
}
public static void autoCorrection_hasAutoCorrectionForBinaryDictionary_bySthreshold() {
if (UnsLogGroup.AUTOCORRECTION_HASAUTOCORRECTIONFORBINARYDICTIONARY_BYSTHRESHOLD_ENABLED) {
final String s = "Auto corrected by S-threshold.";
logUnstructured("AutoCorrection_hasAutoCorrectionForBinaryDictionar_bySthreshold", s);
}
}
public static void keyboardState_onCancelInput(final boolean isSinglePointer,
final KeyboardState keyboardState) {
if (UnsLogGroup.KEYBOARDSTATE_ONCANCELINPUT_ENABLED) {
@ -666,4 +643,10 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
logUnstructured("SuddenJumpingTouchEventHandler_onTouchEvent", s);
}
}
public static void suggestionsView_setSuggestions(SuggestedWords mSuggestedWords) {
if (UnsLogGroup.SUGGESTIONSVIEW_SETSUGGESTIONS_ENABLED) {
logUnstructured("SuggestionsView_setSuggestions", mSuggestedWords.toString());
}
}
}

View File

@ -59,10 +59,12 @@ import com.android.inputmethod.keyboard.PointerTracker;
import com.android.inputmethod.keyboard.ViewLayoutUtils;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.ResearchLogger;
import com.android.inputmethod.latin.StaticInnerHandlerWrapper;
import com.android.inputmethod.latin.Suggest;
import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.Utils;
import com.android.inputmethod.latin.define.ProductionFlag;
import java.util.ArrayList;
@ -663,6 +665,9 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
clear();
mSuggestedWords = suggestedWords;
mParams.layout(mSuggestedWords, mSuggestionsStrip, this, getWidth());
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.suggestionsView_setSuggestions(mSuggestedWords);
}
}
public int setMoreSuggestionsHeight(int remainingHeight) {