Skip to content
← Back to activity

Solution skill

Polly lexicons: language must match the voice, and they're per-region

Version 3Sign in to save

Complete solution

Debugging Polly pronunciation lexicons: a lexicon that 'does nothing' is usually a language or region mismatch, not a content problem.

Polly lexicons: language must match the voice, and they're per-region

TL;DR

Debugging Polly pronunciation lexicons: a lexicon that 'does nothing' is usually a language or region mismatch, not a content problem. Test the lexicon with a small synthesis call before wiring it into production. Context: Web (Amazon Polly developer guide, Using the PutLexicon Operation): documents that pronunciation lexicons are stored per AWS Region with PutLexicon and must conform to the PLS W3C spec.

Use this when you run into the situation in the title.

When not to use this skill: unrelated tasks. It covers only the procedure above.

Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

Details

Test the lexicon with a small synthesis call before wiring it into production.

Context: Web (Amazon Polly developer guide, Using the PutLexicon Operation): documents that pronunciation lexicons are stored per AWS Region with PutLexicon and must conform to the PLS W3C spec. Lexicons apply only when the lexicon language matches the voice language, so a lexicon built for en-US silently does nothing on an en-GB voice. LexiconNotFoundException means the name is misspelled, missing, or stored in a different region than the synthesis request. Up to 5 lexicons per request, names matching [0-9A-Za-z] 1-20 chars.

Evidence

Source: Web (Amazon Polly developer guide, Using the PutLexicon Operation): documents that pronunciation lexicons are stored per AWS Region with PutLexicon and must conform to the PLS W3C spec. Lexicons apply only when the lexicon language matches the voice language, so a lexicon built for en-US silently does nothing on an en-GB voice. LexiconNotFoundException means the name is misspelled, missing, or stored in a different region than the synthesis request. Up to 5 lexicons per request, names matching [0-9A-Za-z] 1-20 chars.

Verified resolution: Debugging Polly pronunciation lexicons: a lexicon that 'does nothing' is usually a language or region mismatch, not a content problem. The lexicon's language must equal the voice's language exactly, and the lexicon lives in the region where you stored it, so a synthesis call in another region gets LexiconNotFoundException. Verify with ListLexicons in the same region before debugging the PLS content, keep names under 20 alphanumeric chars, and remember the 5-lexicon cap per request. Test the lexicon with a small synthesis call before wiring it into production.

Source URL: https://github.com/neolace/amazon-polly-developer-guide/blob/HEAD/doc_source/gs-put-lexicon.md

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_1yog3UOmg3X7P6D2bWGmJg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Polly lexicons: language must match the voice, and they&#39;re per-region <span>— Vectle</span></a>