Remove non-main dictionary candidates
Change-Id: I9f33da674c2c2a0101671ba24424640ba3e695e5
This commit is contained in:
parent
4ff7bbcb97
commit
518643a2c5
1 changed files with 27 additions and 22 deletions
|
@ -441,33 +441,38 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
public static void logOnManualSuggestion(String before, String after, int position
|
public static void logOnManualSuggestion(String before, String after, int position
|
||||||
, List<CharSequence> suggestions) {
|
, List<CharSequence> suggestions) {
|
||||||
if (sLogEnabled) {
|
if (sLogEnabled) {
|
||||||
if (!sSuggestDicMap.containsKey(after)) {
|
// log punctuation
|
||||||
|
if (before.length() == 0 && after.length() == 1) {
|
||||||
|
sLatinImeLogger.sendLogToDropBox(ID_MANUALSUGGESTION, new String[] {
|
||||||
|
before, after, String.valueOf(position), ""});
|
||||||
|
} else if (!sSuggestDicMap.containsKey(after)) {
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
Log.e(TAG, "logOnManualSuggestion was cancelled: came from unknown source.");
|
Log.e(TAG, "logOnManualSuggestion was cancelled: came from unknown source.");
|
||||||
}
|
}
|
||||||
return;
|
} else {
|
||||||
}
|
int dicTypeId = sSuggestDicMap.get(after);
|
||||||
int dicTypeId = sSuggestDicMap.get(after);
|
sLatinImeLogger.mManualSuggestCountPerDic[dicTypeId]++;
|
||||||
sLatinImeLogger.mManualSuggestCountPerDic[dicTypeId]++;
|
if (dicTypeId != Suggest.DIC_MAIN) {
|
||||||
sSuggestDicMap.clear();
|
if (DBG) {
|
||||||
if (dicTypeId != Suggest.DIC_MAIN) {
|
Log.d(TAG, "logOnManualSuggestion was cancelled: didn't come from main dic.");
|
||||||
if (DBG) {
|
}
|
||||||
Log.d(TAG, "logOnManualSuggestion was cancelled: didn't come from main dic.");
|
} else {
|
||||||
|
if (before.equals(after)) {
|
||||||
|
before = "";
|
||||||
|
after = "";
|
||||||
|
}
|
||||||
|
String[] strings = new String[3 + suggestions.size()];
|
||||||
|
strings[0] = before;
|
||||||
|
strings[1] = after;
|
||||||
|
strings[2] = String.valueOf(position);
|
||||||
|
for (int i = 0; i < suggestions.size(); ++i) {
|
||||||
|
String s = suggestions.get(i).toString();
|
||||||
|
strings[i + 3] = sSuggestDicMap.containsKey(s) ? s : "";
|
||||||
|
}
|
||||||
|
sLatinImeLogger.sendLogToDropBox(ID_MANUALSUGGESTION, strings);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (before.equals(after)) {
|
sSuggestDicMap.clear();
|
||||||
before = "";
|
|
||||||
after = "";
|
|
||||||
}
|
|
||||||
String[] strings = new String[3 + suggestions.size()];
|
|
||||||
strings[0] = before;
|
|
||||||
strings[1] = after;
|
|
||||||
strings[2] = String.valueOf(position);
|
|
||||||
for (int i = 0; i < suggestions.size(); ++i) {
|
|
||||||
strings[i + 3] = suggestions.get(i).toString();
|
|
||||||
}
|
|
||||||
sLatinImeLogger.sendLogToDropBox(ID_MANUALSUGGESTION, strings);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue