diff options
author | 2010-06-03 16:36:29 +0900 | |
---|---|---|
committer | 2010-06-03 18:46:44 +0900 | |
commit | 518643a2c54818597f3d3c6c23926f5d44044a2c (patch) | |
tree | d6c7e95f526f6f00a8c8659eff9236961c85dfa7 /java/src | |
parent | 4ff7bbcb97a6b71d84c927e3e4a30dd4dd2494b9 (diff) | |
download | latinime-518643a2c54818597f3d3c6c23926f5d44044a2c.tar.gz latinime-518643a2c54818597f3d3c6c23926f5d44044a2c.tar.xz latinime-518643a2c54818597f3d3c6c23926f5d44044a2c.zip |
Remove non-main dictionary candidates
Change-Id: I9f33da674c2c2a0101671ba24424640ba3e695e5
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinImeLogger.java | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinImeLogger.java b/java/src/com/android/inputmethod/latin/LatinImeLogger.java index 474281058..c81da55ce 100644 --- a/java/src/com/android/inputmethod/latin/LatinImeLogger.java +++ b/java/src/com/android/inputmethod/latin/LatinImeLogger.java @@ -441,33 +441,38 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang public static void logOnManualSuggestion(String before, String after, int position , List<CharSequence> suggestions) { 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) { Log.e(TAG, "logOnManualSuggestion was cancelled: came from unknown source."); } - return; - } - int dicTypeId = sSuggestDicMap.get(after); - sLatinImeLogger.mManualSuggestCountPerDic[dicTypeId]++; - sSuggestDicMap.clear(); - if (dicTypeId != Suggest.DIC_MAIN) { - if (DBG) { - Log.d(TAG, "logOnManualSuggestion was cancelled: didn't come from main dic."); + } else { + int dicTypeId = sSuggestDicMap.get(after); + sLatinImeLogger.mManualSuggestCountPerDic[dicTypeId]++; + if (dicTypeId != Suggest.DIC_MAIN) { + 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)) { - 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); + sSuggestDicMap.clear(); } } |