SIGN IN SIGN UP

Welcome to the AWS Code Examples Repository. This repo contains code examples used in the AWS documentation, AWS SDK Developer Guides, and more. For more information, see the Readme.md file below.

0 0 9 Java
2019-02-01 06:27:16 +00:00
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// snippet-start:[polly.java.GetLexicon.complete]
package com.amazonaws.polly.samples;
2019-02-01 06:27:16 +00:00
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;
2019-02-01 06:27:16 +00:00
public class GetLexiconSample {
private String LEXICON_NAME = "SampleLexicon";
2019-02-01 06:27:16 +00:00
AmazonPolly client = AmazonPollyClientBuilder.defaultClient();
2019-02-01 06:27:16 +00:00
public void getLexicon() {
GetLexiconRequest getLexiconRequest = new GetLexiconRequest().withName(LEXICON_NAME);
2019-02-01 06:27:16 +00:00
try {
GetLexiconResult getLexiconResult = client.getLexicon(getLexiconRequest);
System.out.println("Lexicon: " + getLexiconResult.getLexicon());
} catch (Exception e) {
System.err.println("Exception caught: " + e);
}
}
}
// snippet-end:[polly.java.GetLexicon.complete]