Files
gf-core/doc/gf-quickstart.html
2010-12-23 10:32:39 +00:00

105 lines
2.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>GF Quickstart</title>
<link rel=stylesheet href="../css/style.css">
</head>
<body>
<center>
<img src="Logos/gf0.png">
<p>
Aarne Ranta
<p>
December 2010 for GF 3.2
<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. See download and install
instructions <a href="../download/index.html">here</a>.
<h2>Translation and generation</h2>
When you have downloaded and installed GF:
<ol>
<li> Copy the files
<a href="../examples/tutorial/food/Food.gf"><tt>Food.gf</tt></a>,
<a href="../examples/tutorial/food/FoodEng.gf"><tt>FoodEng.gf</tt></a>, and
<a href="../examples/tutorial/food/FoodIta.gf"><tt>FoodIta.gf</tt></a>.
Or go to <tt>GF/examples/tutorial/food/</tt>, if you have downloaded the
GF sources.
<li> Start GF with the command
<pre>
gf FoodIta.gf FoodEng.gf
</pre>
<li> <b>Translation</b>. Try your first translation by giving the GF command
<pre>
parse "this cheese is very very Italian" | linearize -treebank
</pre>
<li> <b>Generation</b>. Random-generate sentences in two languages:
<pre>
generate_random | linearize
</pre>
<li> <b>Grammar development</b>. Add words to the <tt>Food</tt>
grammars and try the above commands again. For instance, add the following lines:
<pre>
Bread : Kind ; -- in Food.gf
Black = {s = "bread"} ; -- in FoodEng.gf
Black = {s = "pane"} ; -- in FoodIta.gf
</pre>
and start GF again with the same command. Now you can even translate
<i>this bread is very Italian</i>.
</ol>
To lear more on GF commands and
grammar development, go to the one of the tutorials:
<ul>
<li> <a href="tutorial/gf-tutorial.html">GF Tutorial</a>: older, more programmer-oriented
<li> <a href="gf-lrec-2010.pdf">GF Resource Tutorial</a>: newer, more linguist-oriented
</ul>
To learn about how GF is used for easily writing grammars for 16 languages, consult the
<ul>
<li> <a href="../lib/doc/synopsis.html">GF Resource Grammar Library</a>.
</ul>
<h2>Run-time grammars and web applications</h2>
GF has its own "machine language", PGF (Portable Grammar Format),
which is recommended for use in applications at run time. To produce a PGF file from
the two grammars above, do
<pre>
gf -make FoodIta.gf FoodEng.gf
wrote Food.pgf
</pre>
You can use this in Haskell and Java programs, and also on web services, as shown in
<a href="http://www.grammaticalframework.org:41296/minibar/minibar.html">here</a>.
To build your own web application, consult the
<a href="http://code.google.com/p/grammatical-framework/wiki/SideBar?tm=6">developer wiki</a>.
<h2>User Group</h2>
You are welcome to join the <A HREF="http://groups.google.com/group/gf-dev">User Group</A>
to get help and discuss GF-related issues!
</body></html>