diff --git a/doc/tutorial/gf-tutorial2.html b/doc/tutorial/gf-tutorial2.html index b1bd541ae..2ca7949cc 100644 --- a/doc/tutorial/gf-tutorial2.html +++ b/doc/tutorial/gf-tutorial2.html @@ -51,7 +51,7 @@ It will guide you

Getting the GF program

-The program is open-source free software, which you can download from the +The program is open-source free software, which you can download via the GF Homepage:
http://www.cs.chalmers.se/~aarne/GF @@ -290,8 +290,10 @@ and so on.

The labelled context-free format

The labelled context-free grammar format permits user-defined -labels to each rule. GF recognizes files of this format by the suffix -.cf. Let us include the following rules in the file +labels to each rule. +GF recognizes files of this format by the suffix +.cf. It is intermediate between EBNF and full GF format. +Let us include the following rules in the file paleolithic.cf.
   PredVP.  S   ::= NP VP ;
@@ -407,16 +409,20 @@ Rules in a GF grammar are called judgements, and the keywords
 judgement forms:
 
 We return to the precise meanings of these judgement forms later.
 First we will look at how judgements are grouped into modules, and
 show how the grammar paleolithic.cf is
@@ -436,10 +442,41 @@ module forms are
        abstract syntax A, with judgements in the module body M.
 
 
+
+
+

Record types, records, and Strs

+ +The linearization type of a category is a record type, with +zero of more fields of different types. The simplest record +type used for linearization in GF is +
+  {s : Str}
+
+which has one field, with label s and type Str. + +

+ +Examples of records of this type are +

+  [s = "foo"}
+  [s = "hello" ++ "world"}
+
+The type Str is really the type of token lists, but +most of the time one can conveniently think of it as the type of strings, +denoted by string literals in double quotes. + +

+ +Whenever a record r of type {s : Str} is given, +r.s is an object of type Str. This is of course +a special case of the projection rule, allowing the extraction +of fields from a record. + +

An abstract syntax example

-Each nonterminal occurring in paleolithic.cf is +Each nonterminal occurring in the grammar paleolithic.cf is introduced by a cat judgement. Each rule label is introduced by a fun judgement.
@@ -520,11 +557,11 @@ Import PaleolithicEng.gf and try what happens
 
The GF program does not only read the file PaleolithicEng.gf, but also all other files that it -depends on - in this case, Paleolithic.gf. +depends on - in this case, Paleolithic.gf.

-For each file that is compiles, a .gfc file +For each file that is compiled, a .gfc file is generated. The GFC format (="GF Canonical") is the "machine code" of GF, which is faster to process than GF source files. When reading a module, GF knows whether @@ -611,7 +648,7 @@ Translate by using a pipe:

Translation quiz

-This is a simple kind of language exercises that can be automatically +This is a simple language exercise that can be automatically generated from a multilingual grammar. The system generates a set of random sentence, displays them in one language, and checks the user's answer given in another language. The command translation_quiz = tq @@ -706,7 +743,7 @@ only do "one thing" each, e.g. fun Cep, Agaric : Mushroom ; }
-They can afterwards be combined in bigger grammars by using +They can afterwards be combined into bigger grammars by using multiple inheritance, i.e. extension of several grammars at the same time:
@@ -786,14 +823,14 @@ The introduction of plural forms requires two things:
 
 Different languages have different rules of inflection and agreement.
 For instance, Italian has also agreement in gender (masculine vs. feminine).
-We want to be able to ignore such differences in the abstract
-syntax.
+We want to express such special features of languages precisely in
+concrete syntax while ignoring them in abstract syntax.
 
 

-To be able to do all this, we need a couple of new judgement forms, -a new module form, and a more powerful way of expressing linearization -rules. +To be able to do all this, we need two new judgement forms, +a new module form, and a generalizarion of linearization types +from strings to more complex types. @@ -1018,7 +1055,7 @@ these forms are explained in the following section. The paradigms regNoun does not give the correct forms for all nouns. For instance, louse - lice and -fish - fish must be given by using mkNoun. +fish - fish must be given by using mkNoun. Also the word boy would be inflected incorrectly; to prevent this, either use mkNoun or modify regNoun so that the "y" case does not @@ -1165,7 +1202,7 @@ lin

Hierarchic parameter types

The reader familiar with a functional programming language such as -Haskell must have noticed the similarity +Haskell must have noticed the similarity between parameter types in GF and algebraic datatypes (data definitions in Haskell). The GF parameter types are actually a special case of algebraic datatypes: the main restriction is that in GF, these types must be finite. diff --git a/index.html b/index.html index d523c1a1f..dce5b4f1b 100644 --- a/index.html +++ b/index.html @@ -150,7 +150,7 @@ of a multimodal dialogue system built with embedded grammars.

-Resource grammar library: +Resource grammar library: basic structures of ten languages (Danish, English, Finnish, French, German, Italian, Norwegian, Russian, Spanish, Swedish). @@ -240,6 +240,10 @@ outdated). Language specification of the GF grammar formalism. +

  • + +Resource grammar library documentation. +
  • Highlights of Version 2.1 and 2.0 (in comparison with version 1.2).