"where am i"
"what is my location"
"find where i am"
These could be in longer sentence such as
"help me find where i am"
"please could you tell me my location"
"what is my current position"
I was hoping to achieve this with:-
location_request = "am i"/"i am"/"my location"/"location"/"position"
location_predicate = "where"/"what"/"find"/"tell"
And a top level rule that says:-
<optional stuff> +location_predicate + <option stuff> + location_request + <optional stuff>
I am not sure how to define the <optional stuff> to ignore the location_request and location_predicate rules
Can this be done?
TIA
Dave
start
= _ predicate:LocationPredicate _ request:LocationRequest _ {
return { predicate, request };
}
LocationRequest "Request"
= "am i"
/ "i am"
/ "my location"
/ "location"
/ "position"
LocationPredicate "Predicate"
= "where"
/ "what"
/ "find"
/ "tell"
_ "Optional Stuff"
= (!(LocationRequest / LocationPredicate) .)*