Text
DetectLanguage
`Text.DetectLanguage` for language and script identification.
Signature
func (c *TextClient) DetectLanguage(ctx context.Context, input string) (*DetectLanguageResponse, error)Validation rules
inputmust be non-empty- max length is
1000characters
Response
| Field | Type |
|---|---|
RequestID | *string |
LanguageCode | *string |
ScriptCode | *ScriptCode |
Example
resp, err := client.Text.DetectLanguage(ctx, "नमस्ते")
if err != nil {
panic(err)
}
fmt.Println(*resp.LanguageCode, *resp.ScriptCode)