From c15ee36f742d01c65ef07a723b87ecaeed39c2e0 Mon Sep 17 00:00:00 2001
From: aarne Grammatical Framework Tutorial
Author: Aarne Ranta <aarne (at) cs.chalmers.se>
-Last update: Mon Dec 19 18:05:36 2005
+Last update: Wed Dec 21 10:29:13 2005
-
- p1, p2,...` are hard-coded.
+Record types of parameter types are also parameter types. +A typical example is a record of agreement features, e.g. French +
+
+ oper Agr : PType = {g : Gender ; n : Number ; p : Person} ;
+
+
+Notice the term PType rather than just Type referring to
+parameter types. Every PType is also a Type.
+
+Pattern matching is done in the expected way, but it can moreover +utilize partial records: the branch +
+
+ {g = Fem} => t
+
+
+in a table of type Agr => T means the same as
+
+ {g = Fem ; n = _ ; p = _} => t
+
++Tuple patterns are translated to record patterns in the +same way as tuples to records; partial patterns make it +possible to write, slightly surprisingly, +
+
+ case <g,n,p> of {
+ <Fem> => t
+ ...
+ }
+
+
+
The construct exemplified in @@ -2024,7 +2064,7 @@ This very example does not work in all situations: the prefix } ;
- +GF has the following predefined categories in abstract syntax: @@ -2047,11 +2087,11 @@ they can be used as arguments. For example: -- e.g. (StreetAddress 10 "Downing Street") : Address
- -A resource grammar is a grammar built on linguistic grounds, @@ -2104,17 +2144,19 @@ The rest of the modules (black) come from the resource.
Transfer means noncompositional tree-transforming operations. @@ -2133,9 +2175,9 @@ See the transfer language documentation for more information.
- +
Lexers and unlexers can be chosen from
@@ -2171,7 +2213,7 @@ Given by help -lexer, help -unlexer:
Issues: @@ -2182,7 +2224,7 @@ Issues:
-mcfg vs. others
-
+
Thespeak_aloud = sa command sends a string to the speech
@@ -2212,7 +2254,7 @@ The method words only for grammars of English.
Both Flite and ATK are freely available through the links
above, but they are not distributed together with GF.
The @@ -2229,18 +2271,29 @@ Here is a snapshot of the editor: The grammars of the snapshot are from the Letter grammar package.
- +Forthcoming.
- +Other processes can communicate with the GF command interpreter, -and also with the GF syntax editor. +and also with the GF syntax editor. Useful flags when invoking GF are
- +-batch suppresses the promps and structures the communication with XML tags.
+-s suppresses non-output non-error messages and XML tags.
+-- -nocpu suppresses CPU time indication.
+
+Thus the most silent way to invoke GF is
++ gf -batch -s -nocpu ++
GF grammars can be used as parts of programs written in the @@ -2252,15 +2305,15 @@ following languages. The links give more documentation.
A summary is given in the following chart of GF grammar compiler phases:
Formal and Informal Software Specifications, @@ -2273,6 +2326,6 @@ English and German. A simpler example will be explained here.
- +