DeleteLexicon与 Amazon SDK 或 CLI 配合使用 - Amazon Polly
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

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 \ --name w3c

此命令不生成任何输出。

有关更多信息,请参阅 Amazon Polly 开发者指南中的使用 DeleteLexicon 操作

  • 有关 API 的详细信息,请参阅Amazon CLI 命令参考DeleteLexicon中的。

有关 S Amazon DK 开发者指南和代码示例的完整列表,请参阅将 Amazon Polly 与软件开发工具包配合使用 Amazon。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。