fix: Bug when the source language is English

This commit is contained in:
Vincent Young 2023-02-18 20:14:02 +08:00
parent 7f0919c4c9
commit 0532327aed

14
main.go
View File

@ -21,9 +21,9 @@ type Lang struct {
}
type CommonJobParams struct {
WasSpoken bool `json:"wasSpoken"`
TranscribeAS string `json:"transcribe_as"`
RegionalVariant string `json:"regionalVariant"`
WasSpoken bool `json:"wasSpoken"`
TranscribeAS string `json:"transcribe_as"`
// RegionalVariant string `json:"regionalVariant"`
}
type Params struct {
@ -57,9 +57,9 @@ func init_data(source_lang string, target_lang string) *PostData {
TargetLang: target_lang,
},
CommonJobParams: CommonJobParams{
WasSpoken: false,
TranscribeAS: "",
RegionalVariant: "en-US",
WasSpoken: false,
TranscribeAS: "",
// RegionalVariant: "en-US",
},
},
}
@ -131,7 +131,7 @@ func main() {
post_data := init_data(source_lang, target_lang)
text := Text{
Text: translate_text,
RequestAlternatives: 0,
RequestAlternatives: 3,
}
// set id
post_data.ID = id