Skip to content

Commit 20701ca

Browse files
authored
fix - move language check responsability from CLI to API (#95)
* fix - move language check responsability from CLI to API * fix - delete unused test case
1 parent ddad204 commit 20701ca

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

cmd/transcribe.go

-12
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,6 @@ var transcribeCmd = &cobra.Command{
170170
U.PrintError(printErrorProps)
171171
return
172172
}
173-
if (languageCode != "" || languageDetection) && params.SpeakerLabels {
174-
if cmd.Flags().Lookup("speaker_labels").Changed {
175-
printErrorProps := S.PrintErrorProps{
176-
Error: errors.New("Speaker labels are not supported for languages other than English"),
177-
Message: "Speaker labels are not supported for languages other than English.",
178-
}
179-
U.PrintError(printErrorProps)
180-
return
181-
} else {
182-
params.SpeakerLabels = false
183-
}
184-
}
185173
if languageDetection && languageCode == "" {
186174
params.LanguageDetection = true
187175
}

main_test.go

-20
Original file line numberDiff line numberDiff line change
@@ -209,24 +209,4 @@ func TestTranscribeRestrictions(t *testing.T) {
209209
if string(out) != "\nPlease provide either language detection or language code, not both.\n" {
210210
t.Errorf("Expected Please provide either language detection or language code, not both., got %s.", string(out))
211211
}
212-
213-
// Language Detection && Speaker labels
214-
out, err = exec.Command(
215-
"go",
216-
"run",
217-
"main.go",
218-
"transcribe",
219-
"https://storage.googleapis.com/aai-web-samples/2%20min.ogg",
220-
"--language_detection",
221-
"--speaker_labels",
222-
"-p=false",
223-
"-j",
224-
"--test",
225-
).Output()
226-
if err != nil {
227-
fmt.Println(err)
228-
}
229-
if string(out) != "\nSpeaker labels are not supported for languages other than English.\n" {
230-
t.Errorf("Expected Speaker labels are not supported for languages other than English., got %s.", string(out))
231-
}
232212
}

0 commit comments

Comments
 (0)