Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Tokens

Focus mode
Tokens - Amazon Lex

The following table shows the token specifications supported by the grammar slot type. For more information, see Tokens in the Speech recognition grammar specification version 1 W3C recommendation.

Token type Example Supported?
Single unquoted token hello Yes
Single unquoted token: non-alphabetic 2 Yes
Single quoted token, no white space "hello" Yes, drop double quotes when it only contains a single token
Two tokens delimited by white space bon voyage Yes
Four tokens delimited by white space this is a test Yes
Single quoted token, including white space "San Francisco No
Single XML token in <token> tag <token>San Francisco</token> No (same as single quoted token with white space)

Notes

  • Single quoted token including white space – The specification requires words enclosed in double quotes be treated as a single token. Amazon Lex V2 treats them as white space delimited tokens.

  • Single XML token in <token> – The specification requires words delimited by <token> to represent one token. Amazon Lex V2 treats them as white space delimited tokens.

  • Amazon Lex V2 throws a validation error when either usage is found in your grammar.

Example

<rule id="state" scope="public"> <one-of> <item>FL</item> <item>MA</item> <item>NY</item> </one-of> </rule>
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.