Aarne Ranta

20 May, 2005

Grammatical Framework Quick Start

This Quick Start shows two examples of how GF can be used. We assume that you have downloaded and installed GF, so that the command gf works for you.

Translation and generation

When you have downloaded and installed GF:
  1. Copy the files Paleolithic.gf, PaleolithicEng.gf, and PaleolithicIta.gf.
  2. Start GF with the command
      gf PaleolithicIta.gf PaleolithicEng.gf
    
  3. Translation. Try your first translation by giving the GF command
      t PaleolithicEng PaleolithicIta "the boy eats the snake"
    
  4. Generation. Random-generate sentences in two languages:
      gr | l -multi
    
  5. Grammar development. Add words to the Paleolithic grammars and try the above commands again. For instance, add the following lines:
      Black : A ;             -- in Paleolithic.gf
      Black = {s = "black"} ; -- in PaleolithicEng.gf
      Black = {s = "nero"} ;  -- in PaleolithicIta.gf
    
    and start GF again with the same command. Now you can even translate the boy eats the black snake.
To lear more on GF commands and grammar development, go to the New Grammarian's Tutorial.

Multilingual authoring

This demo also requires the GUI package, which makes the command jgf work for you.
  1. Download the file Letter.gfcm.
  2. Start the GF editor by the command
      jgf Letter.gfcm
    
  3. When the editor window is open, select "Letter" from the "New" menu.
  4. Push the button "Random" in the lower end of the window.
  5. Move the pointer to some place in the text, e.g. to the first word (in any of the languages), and click. The first word should now be highlighted and a number of alternatives appear in the lower window part (a similar situation is shown in the picture below).
  6. Double-click at some of the alternatives marked "ch ..." and observe how the text changes in each of the languages.
See the Editor User Manual for more information on how to use the editor. To change the grammars, you should not edit Letter.gfcm, which is low-level code generated by the GF grammar compiler. Instead, you can edit the files in examples/letter in the GF grammar package, and compile by using the script mkLetter.gfs in the same package.