How to approach refined grammar rules #1062
Unanswered
alexanderchen750
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to define a cfg and add some refinement rule on top of that. For example using the cfg expression defined in the github readme:
I'd like to add a rule to stop a zero from being chosen if the previous operator was a '/'. I though about accessing the state of the lm like
lm["op"]
, but stateless functions can't access state. If I set it to stateful, I run into error that I can't select between stateful functions. I thought about using a table to store state, liketable["op"] = select(['+' , '*', '**', '/', '-'], name="op")
, but it stores a intermediary representation like{{G|137482486511456|G}}
.I'm still new to guidance, so I would appreciate some pointers in the right direction.
Beta Was this translation helpful? Give feedback.
All reactions