Aarne Ranta
December 2010 for GF 3.2
Writing GF grammars in the cloud, without installing GF.
$ gf FoodIta.gf FoodEng.gfAlternatively, start GF with gf and give the GF command import FoodIta.gf FoodEng.gf.
parse "this cheese is very very Italian" | linearizeNotice that the parser accept the tabulator for word completion.
generate_random | linearize
help
import alltenses/LangEng.gfo alltenses/LangGer.gfo parse -lang=Eng "I love you" | linearize -treebankThe resource grammars are found relative to the value of GF_LIB_PATH, which you may have to set; see here for instructions.
Bread : Kind ; -- in Food.gf Bread = {s = "bread"} ; -- in FoodEng.gf Bread = {s = "pane"} ; -- in FoodIta.gfand start GF again with the same command. Now you can even translate this bread is very Italian. To lear more on GF commands and grammar development, go to the one of the tutorials:
gf -make FoodIta.gf FoodEng.gf wrote Food.pgfYou can use this in Haskell and Java programs, and also on web services, such as
$ pgf-http Starting HTTP server, open http://localhost:41296/ in your web browser Options {documentRoot = "/home/aarne/.cabal/share/gf-server-1.0/www", port = 41296}which resides next to your gf program. You can view it locally by pointing your browser to the URL shown. You can add your own .pgf grammar to the service by copying it over to the documentRoot directory. Just push "reload" in your browser after each such update.
To build more customized web application, consult the developer wiki.