Is it possible to construct a set of rules to do the following:
I would like reco a particular phrase to produce a result and then anything else other than that phrase will return the complete text.
For example I have a .rule file like this:
TopRule =
($*
(help | what | how) {action='help'}
$*) |
$anything_else {action=anything_else._action} {text = anything_else._text}
;
anything_else @= (+$w) {_action='null'} {_text=_parsed};
However, I am not getting the results I want. If I put in “help” I get “action=help”. But, if I put in “i need help” or “help me” I get the anything else rule triggering instead and get back “action=null”.
How can I code up this rule to get what I am looking for: selected phrases return action=help and all other phrases will return action=null.
Thanks.