GetLexicon - Amazon Polly

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

GetLexicon

次の Java コードサンプルは、Java ベースのアプリケーションを使用して、AWS リージョンに格納されている特定の発音レキシコンのコンテンツを作成する方法を示しています。

このオペレーションの詳細については、GetLexicon API リファレンスを参照してください。

package com.amazonaws.polly.samples; import com.amazonaws.services.polly.AmazonPolly; import com.amazonaws.services.polly.AmazonPollyClientBuilder; import com.amazonaws.services.polly.model.GetLexiconRequest; import com.amazonaws.services.polly.model.GetLexiconResult; public class GetLexiconSample { private String LEXICON_NAME = "SampleLexicon"; AmazonPolly client = AmazonPollyClientBuilder.defaultClient(); public void getLexicon() { GetLexiconRequest getLexiconRequest = new GetLexiconRequest().withName(LEXICON_NAME); try { GetLexiconResult getLexiconResult = client.getLexicon(getLexiconRequest); System.out.println("Lexicon: " + getLexiconResult.getLexicon()); } catch (Exception e) { System.err.println("Exception caught: " + e); } } }