Skip to content

DetectSyntax

Source: src/AWS/Comprehend/DetectSyntax.ts

Runtime binding for comprehend:DetectSyntax — tokenize the input text and label each token with its part of speech (noun, verb, adjective, …).

The binding takes no arguments and grants the action on * (the action has no resource-level IAM).

// init
const detectSyntax = yield* AWS.Comprehend.DetectSyntax();
// runtime
const result = yield* detectSyntax({
Text: "The cat sat on the mat.",
LanguageCode: "en",
});
// result.SyntaxTokens: [{ Text: "cat", PartOfSpeech: { Tag: "NOUN" } }, …]