The lexicons you use must conform to the Pronunciation Lexicon Specification (PLS) W3C recommendation. For more information, see Pronunciation Lexicon Specification (PLS) Version 1.0
The following procedure demonstrates how to apply a lexicon to your input text by
applying the W3c.pls
lexicon to substitute "World Wide Web Consortium" for "W3C".
If you apply multiple lexicons to your text they are applied in a top-down order
with the first match taking precedence over later matches.
A lexicon is applied to the text only if the language specified in the lexicon is
the same as the language chosen.
You can apply a lexicon to plain text or SSML input.
Example – Applying the W3C.pls Lexicon
To create the lexicon you'll need for this exercise, see Uploading a lexicon. Use a plain text editor to create the W3C.pls lexicon shown at the top of the topic. Remember where you save this file.
To apply the W3C.pls lexicon to your input
In this example we introduce a lexicon to substitute "World Wide Web Consortium" for "W3C". Compare the results of this exercise with that of Using SSML on the console for both US English and another language.
Sign in to the AWS Management Console and open the Amazon Polly console at https://console.aws.amazon.com/polly/
. -
Do one of the following:
-
Turn off SSML and then type or paste this text into the text input box.
He was caught up in the game. In the middle of the 10/3/2014 W3C meeting he shouted, "Score!" quite loudly.
-
Turn on SSML and then type or paste this text into the text input box.
<speak>He wasn't paying attention.<break time="1s"/> In the middle of the 10/3/2014 W3C meeting he shouted, "Score!" quite loudly.</speak>
-
-
From the Language list, choose English, US, then choose the voice you want to use for this text.
-
Expand Additional settings and turn on Customize pronunciation.
-
From the list of lexicons, choose
W3C (English, US)
.If the
W3C (English, US)
lexicon is not listed, choose Upload lexicon and upload it, then choose it from the list. To create this lexicon, see Uploading a lexicon. To listen to the speech immediately, choose Listen.
-
To save the speech to a file,
-
Choose Download.
-
To change to a different file format, turn on Speech file format settings, choose the file format you want, and then choose Download.
-
Repeat the previous steps, but choose a different language and notice the difference in the output.