Skip to content

DetectDominantLanguage

Source: src/AWS/Comprehend/DetectDominantLanguage.ts

Runtime binding for comprehend:DetectDominantLanguage — determine the dominant language of the input text (returns RFC 5646 language codes with confidence scores).

Comprehend’s synchronous detect APIs are pure pay-per-call with no resource to manage: the binding takes no arguments and grants the action on * (it has no resource-level IAM).

// init
const detectDominantLanguage = yield* AWS.Comprehend.DetectDominantLanguage();
// runtime
const result = yield* detectDominantLanguage({
Text: "Bob ordered two sandwiches yesterday.",
});
// result.Languages[0].LanguageCode === "en"