-
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
pgf.PGFError: Unknown expression tag #153
Comments
Hello @Saibo-creator, thanks for reporting the issue! What is your GF version? Does it work with any other PGF? If that doesn't help, you can try to install the Python bindings manually, following the steps below. 1. Install the C runtime1.1 Download the source code at gf-core. 1.2 Go to the directory 2) Install the Python bindingsAfter installing the C runtime at $ python setup.py build
$ sudo python setup.py install |
With "pip install" you probably got pgf-2.2 which is not compatible with
the default binary installers for the GF compiler.
Try this:
pip uninstall pgf
pip install pgf==1.0
This is more likely to work but again it also depends on where you got the
compiler from.
Best Regards,
Krasimir
…On Thu, 9 Mar 2023 at 19:26, Saibo-creator ***@***.***> wrote:
Hello GF team,
I just started to try GF with python. I tried to run the starting example
showed here
https://github.com/GrammaticalFramework/gf-core/blob/master/src/runtime/python/examples/translation_pipeline.py
But I get an error and I don't know how to fix it. Thank you so much for
the help!
OS: Ubuntu 20.04 (It produces the same error on MacOS Monterey as well)
Python version:3.8.3
Reproduction
Install pyg with pip install pgf
create the following toy grammar files:
Food.gf
abstract Food = {
flags startcat = Phrase ;
cat
Phrase ; Item ; Kind ; Quality ;
fun
Is : Item -> Quality -> Phrase ;
This, That : Kind -> Item ;
QKind : Quality -> Kind -> Kind ;
Wine, Cheese, Fish : Kind ;
Very : Quality -> Quality ;
Fresh, Warm, Italian, Expensive, Delicious, Boring : Quality ;
}
FoodEng.gf
concrete FoodEng of Food = {
lincat
Phrase, Item, Kind, Quality = {s : Str} ;
lin
Is item quality = {s = item.s ++ "is" ++ quality.s} ;
This kind = {s = "this" ++ kind.s} ;
That kind = {s = "that" ++ kind.s} ;
QKind quality kind = {s = quality.s ++ kind.s} ;
Wine = {s = "wine"} ;
Cheese = {s = "cheese"} ;
Fish = {s = "fish"} ;
Very quality = {s = "very" ++ quality.s} ;
Fresh = {s = "fresh"} ;
Warm = {s = "warm"} ;
Italian = {s = "Italian"} ;
Expensive = {s = "expensive"} ;
Delicious = {s = "delicious"} ;
Boring = {s = "boring"} ;
}
compile into a pgf file:
gf -make FoodEng.gf
Get the following message
linking ... OK
Writing Food.pgf...
Try to load the pgf file in python.
import pgfpgffile = "./Food.pgf"grammar = pgf.readPGF(pgffile)
Error message
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pgf.PGFError: Unknown expression tag
—
Reply to this email directly, view it on GitHub
<#153>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEYFSZD37FRY63WQ4OQD6P3W3IOGNANCNFSM6AAAAAAVVO6ZZY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hello @krangelov , indeed, it works with |
Hello @inariksit , I confirm that I get the same error with I tried to reinstall from source by following your instruction, and I get the following error message when run
It seems that install pgf==1.0 indeed fixed the error, but I guess the error when installing from source may still be an issue ? |
Hello GF team,
I just started to try GF with python. I tried to run the starting example showed here https://github.com/GrammaticalFramework/gf-core/blob/master/src/runtime/python/examples/translation_pipeline.py
But I get an error and I don't know how to fix it. Thank you so much for the help!
OS: Ubuntu 20.04 (It produces the same error on MacOS Monterey as well)
Python version:3.8.3
Reproduction
Install pyg with
pip install pgf
create the following toy grammar files:
Food.gf
FoodEng.gf
compile into a pgf file:
gf -make FoodEng.gf
Get the following message
Try to load the pgf file in python.
Error message
The text was updated successfully, but these errors were encountered: