| 1 | import type * as comprehend from "@distilled.cloud/aws/comprehend"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `comprehend:DetectSyntax` — tokenize the input text |
| 7 | * and label each token with its part of speech (noun, verb, adjective, …). |
| 8 | * |
| 9 | * The binding takes no arguments and grants the action on `*` (the action |
| 10 | * has no resource-level IAM). |
| 11 | * |
| 12 | * ### Real-Time Analysis |
| 13 | * **Example:** Parse Parts of Speech |
| 14 | * ```typescript |
| 15 | * // init |
| 16 | * const detectSyntax = yield* AWS.Comprehend.DetectSyntax(); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const result = yield* detectSyntax({ |
| 20 | * Text: "The cat sat on the mat.", |
| 21 | * LanguageCode: "en", |
| 22 | * }); |
| 23 | * // result.SyntaxTokens: [{ Text: "cat", PartOfSpeech: { Tag: "NOUN" } }, …] |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface DetectSyntax extends Binding.Service< |
| 29 | DetectSyntax, |
| 30 | "AWS.Comprehend.DetectSyntax", |
| 31 | () => Effect.Effect< |
| 32 | ( |
| 33 | request: comprehend.DetectSyntaxRequest, |
| 34 | ) => Effect.Effect< |
| 35 | comprehend.DetectSyntaxResponse, |
| 36 | comprehend.DetectSyntaxError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const DetectSyntax = Binding.Service<DetectSyntax>( |
| 41 | "AWS.Comprehend.DetectSyntax", |
| 42 | ); |