diff --git a/doc/tutorial/gf-tutorial2.html b/doc/tutorial/gf-tutorial2.html index 22cf7a38e..edf7d66c5 100644 --- a/doc/tutorial/gf-tutorial2.html +++ b/doc/tutorial/gf-tutorial2.html @@ -607,6 +607,38 @@ Translate by using a pipe: + + +
+ > translation_quiz PaleolithicEng PaleolithicIta
+
+ Welcome to GF Translation Quiz.
+ The quiz is over when you have done at least 10 examples
+ with at least 75 % success.
+ You can interrupt the quiz by entering a line consisting of a dot ('.').
+
+ a green boy washes the louse
+ un ragazzo verde lava il gatto
+
+ No, not un ragazzo verde lava il gatto, but
+ un ragazzo verde lava il pidocchio
+ Score 0/1
+
+You can also generate a list of translation exercises and save it in a
+file for later use, by the command translation_list = tl
++ > translation_list PaleolithicEng PaleolithicIta 25 ++(The number 25 is the number of sentences generated.) + +
+ regNoun : Str -> Noun = \s -> case last s of {
+ "s" | "z" => mkNoun s (s + "es") ;
+ "y" => mkNoun s (init s + "ies") ;
+ _ => mkNoun s (s + "s")
+ } ;
+
+This definition displays many GF expression forms not shown befores;
+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.
+Also the word boy would be inflected incorrectly; to prevent
+this, either use mkNoun or modify
+regNoun so that the "y" case does not
+apply if the second-last character is a vowel.
+
+Pattern matching
+
+Expressions of the table form are built from lists of
+argument-value pairs. These pairs are called the branches
+of the table. In addition to constants introduced in
+param definitions, the left-hand side of a branch can more
+generally be a pattern, and the computation of selection is
+then performed by pattern matching:
+
+
+Pattern matching is performed in the order in which the branches
+appear in the table.
+
+
+ +As syntactic sugar, one-branch tables can be written concisely, +
+ \\P,...,Q => t === table {P => ... table {Q => t} ...}
+
+Finally, the case expressions common in functional
+programming languages are syntactic sugar for table selections:
+
+ case e of {...} === table {...} ! e
+
+
+
+
+
+
+ lincat NP = {s : Str ; n : Number} ;
+ lincat VP = {s : Number => Str} ;
+
+We say that the number of NP is an inherent feature,
+whereas the number of NP is parametric.
+
++ +The agreement rule itself is expressed in the linearization rule of +the predication structure: +
+ lin PredVP np vp = {s = np.s ++ vp.s ! np.n} ;
+
+The following page will present a new version of
+PaleolithingEng, assuming an abstract syntax
+xextended with All and Two.
+It also assumes that MorphoEng has a paradigm
+regVerb for regular verbs (which need only be
+regular only in the present tensse).
+The reader is invited to inspect the way in which agreement works in
+the formation of noun phrases and verb phrases.
+
+
+
+
+
+concrete PaleolithicEng of Paleolithic = open MorphoEng in {
+lincat
+ S, A = {s : Str} ;
+ VP, CN, V, TV = {s : Number => Str} ;
+ NP = {s : Str ; n : Number} ;
+lin
+ PredVP np vp = {s = np.s ++ vp.s ! np.n} ;
+ UseV v = v ;
+ ComplTV tv np = {s = \\n => tv.s ! n ++ np.s} ;
+ UseA a = {s = \\n => case n of {Sg => "is" ; Pl => "are"} ++ a.s} ;
+ This cn = {s = "this" ++ cn.s ! Sg } ;
+ Indef cn = {s = "a" ++ cn.s ! Sg} ;
+ All cn = {s = "all" ++ cn.s ! Pl} ;
+ Two cn = {s = "two" ++ cn.s ! Pl} ;
+ ModA a cn = {s = \\n => a.s ++ cn.s ! n} ;
+ Louse = mkNoun "louse" "lice" ;
+ Snake = regNoun "snake" ;
+ Green = {s = "green"} ;
+ Warm = {s = "warm"} ;
+ Laugh = regVerb "laugh" ;
+ Sleep = regVerb "sleep" ;
+ Kill = regVerb "kill" ;
+}
+
+
diff --git a/src/tools/Htmls.hs b/src/tools/Htmls.hs index 08c18c907..ce0b3bb28 100644 --- a/src/tools/Htmls.hs +++ b/src/tools/Htmls.hs @@ -4,9 +4,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/05/14 08:38:55 $ +-- > CVS $Date: 2005/05/16 17:07:18 $ -- > CVS $Author: aarne $ --- > CVS $Revision: 1.10 $ +-- > CVS $Revision: 1.11 $ -- -- chop an HTML file into separate files, each linked to the next and previous. -- the names of the files are n-file, with n = 01,02,... @@ -19,6 +19,7 @@ module Main (main) where import System +import Char main :: IO () main = do