DeleteLexicon - Amazon Polly

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

DeleteLexicon

以下 Java 代码示例展示了如何使用基于 Java 的应用程序来删除存储在某个 AWS 区域中的特定词典。已删除的词典无法用于语音合成,也无法使用GetLexiconListLexiconAPIs进行检索。

有关此操作的更多信息,请参阅的参考资料DeleteLexiconAPI。

package com.amazonaws.polly.samples; import com.amazonaws.services.polly.AmazonPolly; import com.amazonaws.services.polly.AmazonPollyClientBuilder; import com.amazonaws.services.polly.model.DeleteLexiconRequest; public class DeleteLexiconSample { private String LEXICON_NAME = "SampleLexicon"; AmazonPolly client = AmazonPollyClientBuilder.defaultClient(); public void deleteLexicon() { DeleteLexiconRequest deleteLexiconRequest = new DeleteLexiconRequest().withName(LEXICON_NAME); try { client.deleteLexicon(deleteLexiconRequest); } catch (Exception e) { System.err.println("Exception caught: " + e); } } }