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
PredVP. S ::= NP VP ; @@ -407,16 +409,20 @@ Rules in a GF grammar are called judgements, and the keywords judgement forms:
+
| form | reading |
| cat C | C is a category |
| fun f : A | f is a function of type A |
+
| form | reading |
| lincat C = T | category C has linearization type T |
| lin f = t | function f has linearization t |
+ {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. + +
@@ -520,11 +557,11 @@ Import PaleolithicEng.gf and try what happensThe 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:
@@ -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. +