From b8c4752e3b52dabcd694cb7d988c16a4c4a7ce78 Mon Sep 17 00:00:00 2001 From: Robin-St Date: Wed, 18 Jan 2023 00:02:40 +0100 Subject: [PATCH] Added example of list (#1633) Adds documentation on how to use a list to get specific numbers for an intent, like 100 % from the word maximum and how this can be used to set brightness of a light. --- .../intent-recognition/template-sentence-syntax.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/voice/intent-recognition/template-sentence-syntax.md b/docs/voice/intent-recognition/template-sentence-syntax.md index b0be4e18..6bf99deb 100644 --- a/docs/voice/intent-recognition/template-sentence-syntax.md +++ b/docs/voice/intent-recognition/template-sentence-syntax.md @@ -86,6 +86,18 @@ lists: to: 100 ``` +Specific numbers can also be matched by a list, like returning 100 from the keyword maximum. To use this list to set the brightness in a sentence, use the following syntax: `{brightness_level:brightness}`. This will get the value from the list but put it in the slot for brightness. + +```yaml +lists: + brightness_level: + values: + - in: (max | maximum | highest) + out: 100 + - in: ( minimum | lowest) + out: 1 +``` + ### Expansion Rules A lot of template sentences can be written in a similar way. To avoid having to repeat the same matching structure multiple times, we can define expansion rules. For example, a user might add "the" in front of the area name, or they might not. We can define an expansion rule to match both cases.