From b59faa21df7825141a6008fe1114313a5f5ffb3c Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 3 Nov 2005 10:31:27 +0000 Subject: [PATCH] fixed SyntaxEng.fromAgr --- lib/resource/doc/example/Animals.gf | 2 + lib/resource/doc/example/mkAnimals.gfs | 6 +- lib/resource/doc/gf-resource.html | 289 +++++++++++++++++++------ lib/resource/english/SyntaxEng.gf | 2 +- 4 files changed, 232 insertions(+), 67 deletions(-) diff --git a/lib/resource/doc/example/Animals.gf b/lib/resource/doc/example/Animals.gf index 17e64c7b1..33b56e740 100644 --- a/lib/resource/doc/example/Animals.gf +++ b/lib/resource/doc/example/Animals.gf @@ -2,6 +2,8 @@ abstract Animals = Questions ** { + flags startcat=Phrase ; + fun -- a lexicon of animals and actions among them Dog, Cat, Mouse, Lion, Zebra : Entity ; diff --git a/lib/resource/doc/example/mkAnimals.gfs b/lib/resource/doc/example/mkAnimals.gfs index 295057768..304263eb9 100644 --- a/lib/resource/doc/example/mkAnimals.gfs +++ b/lib/resource/doc/example/mkAnimals.gfs @@ -1,4 +1,4 @@ - i -src AnimalsEng.gf ;; s - i -src AnimalsFre.gf ;; s - i -src AnimalsSwe.gf ;; s + i -ex AnimalsEng.gf ;; s + i AnimalsFre.gf ;; s + i AnimalsSwe.gf ;; s pm | wf animals.gfcm diff --git a/lib/resource/doc/gf-resource.html b/lib/resource/doc/gf-resource.html index a6abe7b04..1b1bdc7fd 100644 --- a/lib/resource/doc/gf-resource.html +++ b/lib/resource/doc/gf-resource.html @@ -5,15 +5,17 @@ -

GF Resource Grammar Library

+

The GF Resource Grammar Library

+ +Fourth Version, 2 November 2005. +
Third Version, 22 May 2005. Completed 1 July. -
Second Version, 1 March 2005 -
First Draft, 7 February 2005 +

@@ -29,16 +31,16 @@ Aarne Ranta

GF = Grammatical Framework

-A grammar formalism based on functional programming and type theory. +GF is a grammar formalism based on functional programming and type theory.

-Designed to be nice for ordinary programmers to use: by this -we mean programmers without training in linguistics. +GF was designed to be nice for ordinary programmers to use: by this +we mean programmers without training in linguistics.

-Mission: to make natural-language applications available for +The mission of GF is to make natural-language applications available for ordinary programmers, in tasks like

-Thus not primarily another theoretical framework for +Thus GF is not primarily another theoretical framework for linguists. @@ -54,10 +56,16 @@ linguists.

Multilingual grammars

+A GF grammar consists of an abstract syntax and a set +of concrete syntaxes. + +

+ Abstract syntax: language-independent representation

   cat Prop ; Nat ;
   fun Even : Nat -> Prop ;
+  fun NInt : Int -> Nat ;
 
Concrete syntax: mapping from abstract syntax trees to strings in a language (English, French, German, Swedish,...) @@ -70,11 +78,18 @@ linguists. lin Even x = {s = x.s ++ "är" ++ "jämnt"} ; -We can translate between language via the abstract syntax. +We can translate between languages via the abstract syntax: +
+  4 is even                  4 ist gerade
+             \              /
+               Even (NInt 4)
+             /              \
+  4 est pair                  4 är jämnt
+

-Is it really so simple? +But is it really so simple? @@ -93,6 +108,8 @@ la somme de 3 et de 5 est pair
wenn 2 ist gerade, dann 2+2 ist gerade
om 2 är jämnt, 2+2 är jämnt
+All these sentences are grammatically incorrect. + @@ -120,7 +137,10 @@ and record types. For instance, French: } } ; - +To learn more about these constructs, consult GF documentation, e.g. the +New Grammarian's Tutorial. +However, in what follows we will show how to avoid learning them and +still write linguistically correct grammars. @@ -131,7 +151,7 @@ theoretical knowledge about the language.

-Which kind of a programmer is easier to find? +Which kind of a programmer is it easier to find?