Aarne Ranta
October 2011 for GF 3.3
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
$ gf -server This is GF version 3.3 Built on linux/i386 with ghc-7.0, flags: interrupt server cclazy Document root = /usr/local/share/gf-3.3/www Starting HTTP server, open http://localhost:41296/ in your web browser.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.