tejashah88/Alexa-Utterance-Generator

Suggestion for optional parenthesis group

Closed this issue · 2 comments

Hi,

Instead of using | itself to denote optional parenthesis group, if we use an alternate symbol like ! just outside the parenthesis will it solve the Note that (|big|small) would work the same as (big|small). I'm working a fix at the moment.

So the input will be to mark the group as optional
Input: "I !(love|hate) !(big) dogs"

Never mind. The below grammar works without any code change

"I (love|hate| ) (big| ) dogs"

Note an empty space at the to make it optional

@rvramesh Thank you for the concern. I'll add a note for this workaround on the website.