本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
DeleteLexicon与 Amazon SDK 或 CLI 配合使用
以下代码示例演示如何使用 DeleteLexicon。
- .NET
-
- 适用于 .NET 的 Amazon SDK
-
注意
还有更多相关信息 GitHub。在 Amazon 代码示例存储库
中查找完整示例,了解如何进行设置和运行。 using System; using System.Threading.Tasks; using Amazon.Polly; using Amazon.Polly.Model; /// <summary> /// Deletes an existing Amazon Polly lexicon using the AWS SDK for .NET. /// </summary> public class DeleteLexicon { public static async Task Main() { string lexiconName = "SampleLexicon"; var client = new AmazonPollyClient(); var success = await DeletePollyLexiconAsync(client, lexiconName); if (success) { Console.WriteLine($"Successfully deleted {lexiconName}."); } else { Console.WriteLine($"Could not delete {lexiconName}."); } } /// <summary> /// Deletes the named Amazon Polly lexicon. /// </summary> /// <param name="client">The initialized Amazon Polly client object.</param> /// <param name="lexiconName">The name of the Amazon Polly lexicon to /// delete.</param> /// <returns>A Boolean value indicating the success of the operation.</returns> public static async Task<bool> DeletePollyLexiconAsync( AmazonPollyClient client, string lexiconName) { var deleteLexiconRequest = new DeleteLexiconRequest() { Name = lexiconName, }; var response = await client.DeleteLexiconAsync(deleteLexiconRequest); return response.HttpStatusCode == System.Net.HttpStatusCode.OK; } }-
有关 API 的详细信息,请参阅 适用于 .NET 的 Amazon SDK API 参考DeleteLexicon中的。
-
- CLI
-
- Amazon CLI
-
删除词典
以下
delete-lexicon示例删除指定的词典。aws polly delete-lexicon \ --namew3c此命令不生成任何输出。
有关更多信息,请参阅 Amazon Polly 开发者指南中的使用 DeleteLexicon 操作。
-
有关 API 的详细信息,请参阅Amazon CLI 命令参考DeleteLexicon
中的。
-
- SAP ABAP
-
- 适用于 SAP ABAP 的 SDK
-
注意
还有更多相关信息 GitHub。在 Amazon 代码示例存储库
中查找完整示例,了解如何进行设置和运行。 TRY. lo_ply->deletelexicon( iv_name ). MESSAGE 'Lexicon deleted successfully.' TYPE 'I'. CATCH /aws1/cx_plylexiconnotfoundex. MESSAGE 'Lexicon not found.' TYPE 'E'. CATCH /aws1/cx_plyservicefailureex. MESSAGE 'Service failure occurred.' TYPE 'E'. ENDTRY.-
有关 API 的详细信息,请参阅适用DeleteLexicon于 S AP 的Amazon SDK ABAP API 参考。
-
有关 S Amazon DK 开发者指南和代码示例的完整列表,请参阅将 Amazon Polly 与 Amazon SDK 结合使用。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。
操作
DescribeVoices