-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting "unsupported token gluing" with nonexhaustive pattern #52
Comments
I also hit this with:
where
where
error message: and in one case it was even: Internal error in Compute.ConcreteNew: (that is when first variant uncommented) Using BIND or glue functions eliminates the problem for the simpl + case, but not for dp. Also with latest gf-core master:
|
@rnd0101: All your versions look perfectly fine, as for exhaustive patterns. case Predef.dp 1 s of {
#vowel => s + "сь" ;
_ => s + "ся"}; The other two don't even pattern match, and this one above has a catch-all, so it's not like my example without one ( Where do you call the BIND is allowed, so if you want to continue with your approach, you need to store a version without the last character of all the stems instead of calling |
@inariksit Got it! Yes, I call passivate from there, and actually "stepped on the same rake". I wish gf had a noticeably different syntax for PCFG and "Turing-complete" paths... Or some IDE, which highlights them differently... |
I am thinking if I can store just some "reflexive postfix schemas" (I already noticed they are not that diverse) and use them with BIND, that will hopefully save considerable amount of memory as they are not per verb... |
Minimal test grammar
And here's a concrete syntax that causes an unsupported token gluing error unnecessarily.
Error
The error I get is this:
Now I completely agree that the concrete syntax should cause an error, but just not about unsupported token gluing.
Minimal variations that don't cause the error
I found three ways to get rid of the misguided token gluing error:
a) Add a catch-all case after the
x + "foo"
case.No errors anymore.
b) Don't use the variable
x
on the right-hand side, but use the variablestr
instead.This gives the expected error gf: Internal error in GeneratePMCFG: evalTerm ("test").
c) Use the variable
x
on the RHS but don't glue the string"bar"
.This gives the expected error gf: Internal error in GeneratePMCFG: evalTerm ("test").
Link to grammars
The grammars are found in this gist: https://gist.github.com/inariksit/78a1929c4e98c5cc9d6ea693f7d0127f.
The text was updated successfully, but these errors were encountered: