summaryrefslogtreecommitdiff
path: root/doc/gf-quickstart.html
blob: 40e860f45144b26454a1f3bb8ecc38bb334f01ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html><head><title>GF Quickstart</title></head>
 

<body bgcolor="#ffffff" text="#000000">

<center>
<img src="gf-logo.gif">
<p>
Aarne Ranta
<p>
20 May, 2005

<p>

<h1>Grammatical Framework Quick Start</h1>

</center>

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 <tt>gf</tt> works for you.



<h2>Translation and generation</h2>

When you have downloaded and installed GF:

<ol>
<li> Copy the files
<a href="tutorial/old/Paleolithic.gf"><tt>Paleolithic.gf</tt></a>,
<a href="tutorial/old/PaleolithicEng.gf"><tt>PaleolithicEng.gf</tt></a>, and
<a href="tutorial/old/PaleolithicIta.gf"><tt>PaleolithicIta.gf</tt></a>.

 <li> Start GF with the command
<pre>
  gf PaleolithicIta.gf PaleolithicEng.gf
</pre>

<li> <b>Translation</b>. Try your first translation by giving the GF command
<pre>
  t PaleolithicEng PaleolithicIta "the boy eats the snake"
</pre>

<li> <b>Generation</b>. Random-generate sentences in two languages:
<pre>
  gr | l -multi
</pre>

<li> <b>Grammar development</b>. Add words to the <tt>Paleolithic</tt>
grammars and try the above commands again. For instance, add the following lines:
<pre>
  Black : A ;             -- in Paleolithic.gf
  Black = {s = "black"} ; -- in PaleolithicEng.gf
  Black = {s = "nero"} ;  -- in PaleolithicIta.gf
</pre>
and start GF again with the same command. Now you can even translate
<i>the boy eats the black snake</i>.
</ol>
To lear more on GF commands and
grammar development, go to the
<a href="tutorial/gf-tutorial2.html">New Grammarian's Tutorial</a>.



<h2>Multilingual authoring</h2>

This demo also requires the GUI package, which makes the command
<tt>jgf</tt> work for you.
<ol>
<li> Download the file <a href="../examples/letter/Letter.gfcm"><tt>Letter.gfcm</tt></a>.
<li> Start the GF editor by the command
<pre>
  jgf Letter.gfcm
</pre>
<li> When the editor window is open, select "Letter" from the "New" menu.
<li> Push the button "Random" in the lower end of the window.
<li> 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).
<li> Double-click at some of the alternatives marked "ch ..." and observe how
  the text changes in each of the languages.
</ol>
See the <a href="../../GF2.0/doc/javaGUImanual/javaGUImanual.htm">Editor User Manual</a>
for more information on how to use the
editor. To change the grammars, you should not edit <tt>Letter.gfcm</tt>,
which is low-level code generated by the GF grammar compiler. Instead, you
can edit the files in <tt>examples/letter</tt> in the GF grammar package,
and compile by using the script <tt>mkLetter.gfs</tt> in the same package.

<p>

<img src="quick-editor.gif">

</body></html>