Skip to content

Commit 42f6ec6

Browse files
committed
feat(Speech to Text): Add endOfUtterance prop to SpeechRecognitionResult
1 parent be54f7f commit 42f6ec6

File tree

1 file changed

+44
-5
lines changed

1 file changed

+44
-5
lines changed

speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionResult.java

+44-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2019.
2+
* (C) Copyright IBM Corp. 2020.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -23,13 +23,35 @@
2323
*/
2424
public class SpeechRecognitionResult extends GenericModel {
2525

26+
/**
27+
* If the `split_transcript_at_phrase_end` parameter is `true`, describes the reason for the split:
28+
* * `end_of_data` - The end of the input audio stream.
29+
* * `full_stop` - A full semantic stop, such as for the conclusion of a grammatical sentence. The insertion of splits
30+
* is influenced by the base language model and biased by custom language models and grammars.
31+
* * `reset` - The amount of audio that is currently being processed exceeds the two-minute maximum. The service
32+
* splits the transcript to avoid excessive memory use.
33+
* * `silence` - A pause or silence that is at least as long as the pause interval.
34+
*/
35+
public interface EndOfUtterance {
36+
/** end_of_data. */
37+
String END_OF_DATA = "end_of_data";
38+
/** full_stop. */
39+
String FULL_STOP = "full_stop";
40+
/** reset. */
41+
String RESET = "reset";
42+
/** silence. */
43+
String SILENCE = "silence";
44+
}
45+
2646
@SerializedName("final")
27-
private Boolean xFinal;
28-
private List<SpeechRecognitionAlternative> alternatives;
47+
protected Boolean xFinal;
48+
protected List<SpeechRecognitionAlternative> alternatives;
2949
@SerializedName("keywords_result")
30-
private Map<String, List<KeywordResult>> keywordsResult;
50+
protected Map<String, List<KeywordResult>> keywordsResult;
3151
@SerializedName("word_alternatives")
32-
private List<WordAlternativeResults> wordAlternatives;
52+
protected List<WordAlternativeResults> wordAlternatives;
53+
@SerializedName("end_of_utterance")
54+
protected String endOfUtterance;
3355

3456
/**
3557
* Gets the xFinal.
@@ -80,4 +102,21 @@ public Map<String, List<KeywordResult>> getKeywordsResult() {
80102
public List<WordAlternativeResults> getWordAlternatives() {
81103
return wordAlternatives;
82104
}
105+
106+
/**
107+
* Gets the endOfUtterance.
108+
*
109+
* If the `split_transcript_at_phrase_end` parameter is `true`, describes the reason for the split:
110+
* * `end_of_data` - The end of the input audio stream.
111+
* * `full_stop` - A full semantic stop, such as for the conclusion of a grammatical sentence. The insertion of splits
112+
* is influenced by the base language model and biased by custom language models and grammars.
113+
* * `reset` - The amount of audio that is currently being processed exceeds the two-minute maximum. The service
114+
* splits the transcript to avoid excessive memory use.
115+
* * `silence` - A pause or silence that is at least as long as the pause interval.
116+
*
117+
* @return the endOfUtterance
118+
*/
119+
public String getEndOfUtterance() {
120+
return endOfUtterance;
121+
}
83122
}

0 commit comments

Comments
 (0)