Dear All,
We have been trying to use the Java binding to the C runtime. Strangely enough, it works in one computer, but not in others. Somehow, it seems to be related to the usage of literals in the grammar. We cannot understand why. We would deeply appreciate it if you could help us.
1. The GF has been installed on all computers using the same .deb file (gf_3.10-2_amd64.deb). However, we are using different OSs (Ubuntu 16.04, Ubuntu 18.04, and Ubuntu 19.10).
2. We are using the same JDK on all computers.
3. You can download the Eclipse project from the following link. You may need to update the Java build path (in Eclipse), since it is considering an absolute path to the jpgf.jar file.
4. There is a computer (the one running Ubuntu 16.04) where this code works as expected. The output provided by the program is:
Starting GF (java)
Parsking: ok!
this wine is warm = foo
5. In the other two computers, when we run the same program, we get the following parsing error:
Starting GF (java)
org.grammaticalframework.pgf.ParseError: The sentence is incomplete
6. We are using a modified version of the Food grammar. We have only introduced a String literal as follows:
(abstract grammar)
Is : String -> Item -> Quality -> Phrase ;
(concrete grammar)
Is str item quality = {s = item.s ++ "is" ++ quality.s ++ " = " ++ str.s} ;
7. If we remove this String literal, the code works properly on all computers.
(abstract grammar)
Is : Item -> Quality -> Phrase ;
(concrete grammar)
Is item quality = {s = item.s ++ "is" ++ quality.s} ;
8. Finally, this problem only happens when parsing a string (i.e., it works when only calling the linearisation method).
Thank you in advance for your help.
Best regards,
Gustavo