-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to ability to have nested groups for utterances #13
Comments
I'm not saying no to this, just playing devil's advocate: couldn't this be supported by instead declaring the group as
The nested syntax seems a bit terse. |
Definitely makes it harder to read at first. I find myself revisiting utterances and want to expand on the options. The example was quite simple and expanding it makes it easier to read. My templates often have a lot of alternation and I will expand on it to cover as many voice options as possible. When I do this I may want to use nested groups. Admittedly this does not happen often, and when I do need it, I just copy the template and expand upon it. When I do that, though, my utterance templates are not DRY. I'm fine either way considering the implementation is not simple ;) |
Here is an example that I have came across. Supposing that you are using the Amazon Slot types for both city and airport. As the user is going to ask either how long it with take to get to Los Angeles or LAX. Currently I have to structure it like this:
Would be nice not to have to repeat the initial part in the utterance. Something along these lines:
Any insights appreciated! |
This is personal preference, but I find:
to be more readable than:
|
I think you have a good thought, but I have to agree with mreinstein. I find utterances to be nearly the perfect balance of simple and powerful. There might be some cases where nested syntax might seem more convenient or even appropriate, but I haven't found anything you flat out can't do with the implementation as-is. |
+1 request for nesting support. The "flutterance" utility ( https://www.npmjs.com/package/flutterance ) supports nesting, but does not appear to work on it's own as a library to be included in a package. The specific example from their readme shows: [Hello|Hi|Good [Morning|Afternoon|Evening]] Alexa ... seems like a perfectly good use case. shrug |
Nested groups are valuable when alternating pronouns or articles of speech in an utterance. For example:
should expand to:
I'll work on creating a PR for this functionality.
The text was updated successfully, but these errors were encountered: