diff --git a/doc/tutorial/gf-tutorial2.html b/doc/tutorial/gf-tutorial2.html index 4a3e15d44..329b47ae3 100644 --- a/doc/tutorial/gf-tutorial2.html +++ b/doc/tutorial/gf-tutorial2.html @@ -7,38 +7,35 @@

Grammatical Framework Tutorial

Author: Aarne Ranta <aarne (at) cs.chalmers.se>
-Last update: Thu Dec 15 16:43:59 2005 +Last update: Fri Dec 16 15:10:23 2005


-


@@ -47,17 +44,6 @@ Last update: Thu Dec 15 16:43:59 2005

-

Grammatical Framework Tutorial

-

-3rd Edition, for GF version 2.2 or later -

-

-Aarne Ranta -

-

-aarne@cs.chalmers.se -

-

GF = Grammatical Framework

The term GF is used for different things: @@ -79,7 +65,7 @@ It will guide you

  • to write programs in which GF grammars are used as components - +

    Getting the GF program

    The program is open-source free software, which you can download via the @@ -109,19 +95,19 @@ To start the GF program, assuming you have installed it, just type

    in the shell. You will see GF's welcome message and the prompt >.

    - +

    My first grammar

    Now you are ready to try out your first grammar. We start with one that is not written in GF language, but -in the EBNF notation (Extended Backus Naur Form), which GF can also +in the ubiquitous BNF notation (Backus Naur Form), which GF can also understand. Type (or copy) the following lines in a file named paleolithic.ebnf:

         S   ::= NP VP ;
         VP  ::= V | TV NP | "is" A ;
    -    NP  ::= ("this" | "that" | "the" | "a") CN ;
    +    NP  ::= "this" CN | "that" CN | "the" CN | "a" CN ;
         CN  ::= A CN ;
         CN  ::= "boy" | "louse" | "snake" | "worm" ;
         A   ::= "green" | "rotten" | "thick" | "warm" ;
    @@ -129,7 +115,17 @@ understand. Type (or copy) the following lines in a file named
         TV  ::= "eats" | "kills" | "washes" ;
     

    - +

    +(The name paleolithic refers to a larger package +stoneage, +which implements a fragment of primitive language. This fragment +was defined by the linguist Morris Swadesh as a tool for studying +the historical relations of languages. But as pointed out +in the Wiktionary article on +Swadesh list, the +fragment is also usable for basic communication with foreigners.) +

    +

    Importing grammars and parsing strings

    The first GF command when using a grammar is to import it. @@ -169,7 +165,7 @@ you imported. Try parsing something else, and you fail no tree found

    - +

    Generating trees and strings

    You can also use GF for linearizing @@ -200,7 +196,7 @@ a pipe. this worm is warm

    - +

    Some random-generated sentences

    Random generation can be quite amusing. So you may want to @@ -220,7 +216,7 @@ generate ten strings with one and the same command: a boy is green

    - +

    Systematic generation

    To generate <i>all<i> sentence that a grammar @@ -250,7 +246,7 @@ You get quite a few trees but not all of them: only up to a given Quiz. If the command gt generated all trees in your grammar, it would never terminate. Why?

    - +

    More on pipes; tracing

    A pipe of GF commands can have any length, but the "output type" @@ -273,7 +269,7 @@ This facility is good for test purposes: for instance, you may want to see if a grammar is ambiguous, i.e. contains strings that can be parsed in more than one way.

    - +

    Writing and reading files

    To save the outputs of GF commands into a file, you can @@ -296,7 +292,7 @@ the file separately. Without the flag, the grammar could not recognize the string in the file, because it is not a sentence but a sequence of ten sentences.

    - +

    Labelled context-free grammars

    The syntax trees returned by GF's parser in the previous examples @@ -393,7 +389,7 @@ old grammar from the GF shell state. a louse is thick

    - +

    The GF grammar format

    To see what there really is in GF's shell state when a grammar @@ -417,7 +413,7 @@ one more way of defining the same grammar as in Then we will show how the full GF grammar format enables you to do things that are not possible in the weaker formats.

    - +

    Abstract and concrete syntax

    A GF grammar consists of two main parts: @@ -897,7 +893,7 @@ The graph uses

    <img src="Gatherer.gif">

    - +

    Resource modules

    Suppose we want to say, with the vocabulary included in @@ -1043,7 +1039,7 @@ Resource modules can extend other resource modules, in the same way as modules of other types can extend modules of the same type.

    - +

    Opening a ``resource``

    Any number of resource modules can be @@ -1390,7 +1386,7 @@ GF currently requires that all fields in linearization records that have a table with value type Str have as labels either s or s with an integer index.

    - +

    Topics still to be written

    Free variation @@ -1419,11 +1415,7 @@ Dependent types, variable bindings, semantic definitions

    Transfer rules

    -

    -<body> -<html> -

    - + diff --git a/doc/tutorial/gf-tutorial2.txt b/doc/tutorial/gf-tutorial2.txt index f417968d5..b7cc929f5 100644 --- a/doc/tutorial/gf-tutorial2.txt +++ b/doc/tutorial/gf-tutorial2.txt @@ -10,20 +10,6 @@ Last update: %%date(%c) [../gf-logo.gif] -=Grammatical Framework Tutorial= - - - -**3rd Edition, for GF version 2.2 or later** - - - -[Aarne Ranta http://www.cs.chalmers.se/~aarne] - - -``aarne@cs.chalmers.se`` - - %--! @@ -84,13 +70,13 @@ in the shell. You will see GF's welcome message and the prompt ``>``. Now you are ready to try out your first grammar. We start with one that is not written in GF language, but -in the EBNF notation (Extended Backus Naur Form), which GF can also +in the ubiquitous BNF notation (Backus Naur Form), which GF can also understand. Type (or copy) the following lines in a file named ``paleolithic.ebnf``: ``` S ::= NP VP ; VP ::= V | TV NP | "is" A ; - NP ::= ("this" | "that" | "the" | "a") CN ; + NP ::= "this" CN | "that" CN | "the" CN | "a" CN ; CN ::= A CN ; CN ::= "boy" | "louse" | "snake" | "worm" ; A ::= "green" | "rotten" | "thick" | "warm" ; @@ -98,6 +84,15 @@ understand. Type (or copy) the following lines in a file named TV ::= "eats" | "kills" | "washes" ; ``` +(The name ``paleolithic`` refers to a larger package +[stoneage http://www.cs.chalmers.se/~aarne/GF/examples/stoneage/], +which implements a fragment of primitive language. This fragment +was defined by the linguist Morris Swadesh as a tool for studying +the historical relations of languages. But as pointed out +in the Wiktionary article on +[Swadesh list http://en.wiktionary.org/wiki/Wiktionary:Swadesh_list], the +fragment is also usable for basic communication with foreigners.) + %--! ===Importing grammars and parsing strings=== @@ -1314,7 +1309,3 @@ Dependent types, variable bindings, semantic definitions Transfer rules - - - - \ No newline at end of file diff --git a/examples/mp3/mp3-resource.txt b/examples/mp3/mp3-resource.txt index e9e26b0a9..60c39fcb7 100644 --- a/examples/mp3/mp3-resource.txt +++ b/examples/mp3/mp3-resource.txt @@ -41,10 +41,11 @@ To try out the grammar, do for example > si -tr | p | l -multi -- translate speech input [say:] I want to play Yesterday ``` -The last command only works if you have installed -[ATK http://mi.eng.cam.ac.uk/~sjy/software.htm] and compiled +The last command only works if you have installed the +[ATK http://mi.eng.cam.ac.uk/~sjy/software.htm] speech recognition library +and compiled [GF version 14/12/2005 http://www.cs.chalmers.se/Cs/Research/Language-technology/darcs/GF/doc/darcs.html] -or later. +or later, with support for ATK enabled. ==Structure==