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 ;
2024-01-16 10:41:11 -05:00
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 ;
2024-01-16 10:41:11 -05:00
2019-02-01 06:27:16 +00:00
public class GetLexiconSample {
private String LEXICON_NAME = " SampleLexicon " ;
2024-01-16 10:41:11 -05:00
2019-02-01 06:27:16 +00:00
AmazonPolly client = AmazonPollyClientBuilder . defaultClient ( ) ;
2024-01-16 10:41:11 -05:00
2019-02-01 06:27:16 +00:00
public void getLexicon ( ) {
GetLexiconRequest getLexiconRequest = new GetLexiconRequest ( ) . withName ( LEXICON_NAME ) ;
2024-01-16 10:41:11 -05:00
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]