Skip to content

Polly  >  Operations  >  put_lexicon

put_lexicon

Operation

put_lexicon async

put_lexicon(input: PutLexiconInput, plugins: list[Plugin] | None = None) -> PutLexiconOutput

Stores a pronunciation lexicon in an Amazon Web Services Region. If a lexicon with the same name already exists in the region, it is overwritten by the new lexicon. Lexicon operations have eventual consistency, therefore, it might take some time before the lexicon is available to the SynthesizeSpeech operation.

For more information, see Managing Lexicons.

Parameters:

Name Type Description Default
input PutLexiconInput

An instance of PutLexiconInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
PutLexiconOutput

An instance of PutLexiconOutput.

Input

PutLexiconInput dataclass

Dataclass for PutLexiconInput structure.

Attributes

content class-attribute instance-attribute
content: str | None = field(repr=False, default=None)

Content of the PLS lexicon as string data.

name class-attribute instance-attribute
name: str | None = None

Name of the lexicon. The name must follow the regular express format [0-9A-Za-z]{1,20}. That is, the name is a case-sensitive alphanumeric string up to 20 characters long.

Output

PutLexiconOutput dataclass

Dataclass for PutLexiconOutput structure.