Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class GetLexiconCommandProtected

Returns the content of the specified pronunciation lexicon stored in an Amazon Web Services Region. For more information, see Managing Lexicons.

Example

Use a bare-bones client and the command you need to make an API call.

import { PollyClient, GetLexiconCommand } from "@aws-sdk/client-polly"; // ES Modules import
// const { PollyClient, GetLexiconCommand } = require("@aws-sdk/client-polly"); // CommonJS import
const client = new PollyClient(config);
const input = { // GetLexiconInput
Name: "STRING_VALUE", // required
};
const command = new GetLexiconCommand(input);
const response = await client.send(command);
// { // GetLexiconOutput
// Lexicon: { // Lexicon
// Content: "STRING_VALUE",
// Name: "STRING_VALUE",
// },
// LexiconAttributes: { // LexiconAttributes
// Alphabet: "STRING_VALUE",
// LanguageCode: "arb" || "cmn-CN" || "cy-GB" || "da-DK" || "de-DE" || "en-AU" || "en-GB" || "en-GB-WLS" || "en-IN" || "en-US" || "es-ES" || "es-MX" || "es-US" || "fr-CA" || "fr-FR" || "is-IS" || "it-IT" || "ja-JP" || "hi-IN" || "ko-KR" || "nb-NO" || "nl-NL" || "pl-PL" || "pt-BR" || "pt-PT" || "ro-RO" || "ru-RU" || "sv-SE" || "tr-TR" || "en-NZ" || "en-ZA" || "ca-ES" || "de-AT" || "yue-CN" || "ar-AE" || "fi-FI" || "en-IE" || "nl-BE" || "fr-BE",
// LastModified: new Date("TIMESTAMP"),
// LexiconArn: "STRING_VALUE",
// LexemesCount: Number("int"),
// Size: Number("int"),
// },
// };

Param

GetLexiconCommandInput

Returns

GetLexiconCommandOutput

See

Throws

LexiconNotFoundException (client fault)

Amazon Polly can't find the specified lexicon. This could be caused by a lexicon that is missing, its name is misspelled or specifying a lexicon that is in a different region.

Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled correctly. Then try again.

Throws

ServiceFailureException (server fault)

An unknown condition has caused a service failure.

Throws

PollyServiceException

Base exception class for all service exceptions from Polly service.

Example

To retrieve a lexicon

// Returns the content of the specified pronunciation lexicon stored in an AWS Region.
const input = {
"Name": ""
};
const command = new GetLexiconCommand(input);
const response = await client.send(command);
/* response ==
{
"Lexicon": {
"Content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<lexicon version=\"1.0\" \r\n xmlns=\"http://www.w3.org/2005/01/pronunciation-lexicon\"\r\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \r\n xsi:schemaLocation=\"http://www.w3.org/2005/01/pronunciation-lexicon \r\n http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd\"\r\n alphabet=\"ipa\" \r\n xml:lang=\"en-US\">\r\n <lexeme>\r\n <grapheme>W3C</grapheme>\r\n <alias>World Wide Web Consortium</alias>\r\n </lexeme>\r\n</lexicon>",
"Name": "example"
},
"LexiconAttributes": {
"Alphabet": "ipa",
"LanguageCode": "en-US",
"LastModified": 1478542980.117,
"LexemesCount": 1,
"LexiconArn": "arn:aws:polly:us-east-1:123456789012:lexicon/example",
"Size": 503
}
}
*/
// example id: to-retrieve-a-lexicon-1481912870836

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods