aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/voice/VoiceInput.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2010-09-03 22:57:28 +0900
committersatok <satok@google.com>2010-09-03 22:57:28 +0900
commit4d67480fe297f3b9265fcbeb1d1651b910bd96c2 (patch)
tree56ec6666d6c13e1daefd43ed9fbe44988d42fb8c /java/src/com/android/inputmethod/voice/VoiceInput.java
parent17fe18350fe5b411f78596ab4630fcd03ac8eb31 (diff)
parent48206a62c9ac5f9d1794bb7f3e15fdfec0825cc8 (diff)
downloadlatinime-4d67480fe297f3b9265fcbeb1d1651b910bd96c2.tar.gz
latinime-4d67480fe297f3b9265fcbeb1d1651b910bd96c2.tar.xz
latinime-4d67480fe297f3b9265fcbeb1d1651b910bd96c2.zip
Merge remote branch 'goog/master' into mastermerge
Conflicts: java/src/com/android/inputmethod/latin/LatinIME.java Change-Id: I8fe443f434ced0cf18b1aa86e38fb8913a5b75c2
Diffstat (limited to 'java/src/com/android/inputmethod/voice/VoiceInput.java')
-rw-r--r--java/src/com/android/inputmethod/voice/VoiceInput.java16
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();
}