diff options
author | 2010-08-26 16:31:54 -0400 | |
---|---|---|
committer | 2010-08-30 14:34:10 -0400 | |
commit | 7b9ed1aa7601e263a46cf6b852df75a3866277d4 (patch) | |
tree | 02854c8e6b6233e0f127f6290835f22a9cf19f48 /java/src/com/android/inputmethod/voice/VoiceInput.java | |
parent | a66ccc3e8da054341ada866706ad61c31468599b (diff) | |
download | latinime-7b9ed1aa7601e263a46cf6b852df75a3866277d4.tar.gz latinime-7b9ed1aa7601e263a46cf6b852df75a3866277d4.tar.xz latinime-7b9ed1aa7601e263a46cf6b852df75a3866277d4.zip |
Logging for the VoiceSearch alternates
Log which voice-based alternates were selected, and what
word in the recognition results were replaced.
Change-Id: I1527dc794902a18a226ca45e186ecf84841094c8
Conflicts:
java/src/com/android/inputmethod/latin/LatinIME.java
Diffstat (limited to 'java/src/com/android/inputmethod/voice/VoiceInput.java')
-rw-r--r-- | java/src/com/android/inputmethod/voice/VoiceInput.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/voice/VoiceInput.java b/java/src/com/android/inputmethod/voice/VoiceInput.java index f24c180d0..4c54dd3c5 100644 --- a/java/src/com/android/inputmethod/voice/VoiceInput.java +++ b/java/src/com/android/inputmethod/voice/VoiceInput.java @@ -16,6 +16,7 @@ package com.android.inputmethod.voice; +import com.android.inputmethod.latin.EditingUtil; import com.android.inputmethod.latin.R; import android.content.ContentResolver; @@ -30,6 +31,7 @@ import android.speech.RecognitionListener; import android.speech.SpeechRecognizer; import android.speech.RecognizerIntent; import android.util.Log; +import android.view.inputmethod.InputConnection; import android.view.View; import android.view.View.OnClickListener; @@ -423,8 +425,14 @@ public class VoiceInput implements OnClickListener { mLogger.textModifiedByTypingDeletion(length); } - public void logTextModifiedByChooseSuggestion(int length) { - mLogger.textModifiedByChooseSuggestion(length); + public void logTextModifiedByChooseSuggestion(String suggestion, int index, + String wordSeparators, InputConnection ic) { + EditingUtil.Range range = new EditingUtil.Range(); + String wordToBeReplaced = EditingUtil.getWordAtCursor(ic, wordSeparators, range); + // If we enable phrase-based alternatives, only send up the first word + // in suggestion and wordToBeReplaced. + mLogger.textModifiedByChooseSuggestion(suggestion.length(), wordToBeReplaced.length(), + index, wordToBeReplaced, suggestion); } public void logKeyboardWarningDialogShown() { @@ -455,10 +463,6 @@ public class VoiceInput implements OnClickListener { mLogger.voiceInputDelivered(length); } - public void logNBestChoose(int index) { - mLogger.nBestChoose(index); - } - public void logInputEnded() { mLogger.inputEnded(); } |