Skip to content

Commit

Permalink
docs(samples): remove unsupported field RecognitionResult (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
kweinmeister authored Mar 29, 2022
1 parent 2ca0ad0 commit 1b04f74
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,11 @@ public void onStart(StreamController controller) {}
public void onResponse(StreamingTranslateSpeechResponse response) {
StreamingTranslateSpeechResult res = response.getResult();
String translation = res.getTextTranslationResult().getTranslation();
String source = res.getRecognitionResult();

if (res.getTextTranslationResult().getIsFinal()) {
System.out.println(String.format("\nFinal translation: %s", translation));
System.out.println(String.format("Final recognition result: %s", source));
} else {
System.out.println(String.format("\nPartial translation: %s", translation));
System.out.println(String.format("Partial recognition result: %s", source));
}
}

Expand Down

0 comments on commit 1b04f74

Please sign in to comment.