Improve brackets in patterns
A pattern such as sho[w] should match both "sho" and "show". Below are some examples of the current behavior. There are many more use cases in German and other languages. This feature would simplify and shorten pattern creation significantly.
Pattern: [show][sho] me the cash
Match: sho me the cash
Match: show me the cash
Pattern: sho[w] me the money
Match: sho me the money
No match: show me the money
Match: sho w me the money
Our pattern engine currently doesn’t support this because anything in between spaces is considered as a token. We can look into adding this.
In the meantime, you can do this with pipes (“|”). For example, (show | sho) me the money.
Shradha Singh commented
Please check "Nesting syntax in patterns" on this link, is it helpful ?
The optional syntax, with square brackets, can be nested two levels. For example: [[this]is] a new form. This example allows for the following utterances:
Nested optional utterance example Explanation
this is a new form matches all words in pattern
is a new form matches outer optional word and non-optional words in pattern
a new form matches required words only