DeleteLexicon - Amazon Polly

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

DeleteLexicon

下列 Java 程式碼範例示範如何使用 Java 應用程式刪除儲存在區域中的特定詞典。 AWS 已刪除的語彙不可用於語音合成,也不可使用 GetLexiconListLexicon API 擷取。

如需此操作的詳細資訊,請參閱 DeleteLexicon API 的參考文章。

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); } } }