HorizonRobotics / SocialRobot

Apache License 2.0
71 stars 20 forks source link

A simple parser based on regex #131

Closed emailweixu closed 3 years ago

emailweixu commented 3 years ago

LGTM.

On a high level, I think a deterministic logical form is probably better than natural language for both simple generation and simple parsing? E.g. "left(agent, apple)" means apple is on the left of the agent. "green(apple)" means apple is green. "and(left(agent, apple), green(apple))" means a green apple is on the agent's left.

I guess we can always define the parsing rule to parse this kind of grammar if we need. But I don't feel it can make things much easier.