diff --git a/lib/resource/doc/ScanMod.dot b/lib/resource/doc/ScanMod.dot new file mode 100644 index 000000000..5f3ec23ba --- /dev/null +++ b/lib/resource/doc/ScanMod.dot @@ -0,0 +1,29 @@ +digraph { + +GrammarSwe [style = "solid", shape = "box", color = "green"]; +GrammarSwe -> GrammarScand [style = "solid"]; +GrammarSwe -> SyntaxSwe [style = "solid"]; + +LexiconSwe [style = "solid", shape = "box", color = "red"]; +LexiconSwe -> MorphoSwe [style = "solid"]; + +GrammarScand [style = "solid", shape = "box"]; +GrammarScand -> SyntaxScand [style = "solid"]; + +SyntaxScand [style = "solid", shape = "ellipse"]; +SyntaxScand -> TypesScand [style = "solid"]; + +SyntaxSwe [style = "solid", shape = "ellipse", color = "yellow"]; +SyntaxSwe -> SyntaxScand [style = "solid"]; +SyntaxSwe -> TypesSwe [style = "solid"]; +SyntaxSwe -> MorphoSwe [style = "solid"]; + +MorphoSwe [style = "solid", shape = "ellipse", color="red"]; +MorphoSwe -> TypesSwe [style = "solid"]; + +TypesSwe [style = "solid", shape = "ellipse", color = "yellow"]; +TypesSwe -> TypesScand [style = "solid"]; + +TypesScand [style = "solid", shape = "ellipse"]; + +} diff --git a/lib/resource/doc/gf-resource.html b/lib/resource/doc/gf-resource.html index 29a1ffde3..ae9eaa836 100644 --- a/lib/resource/doc/gf-resource.html +++ b/lib/resource/doc/gf-resource.html @@ -47,6 +47,77 @@ Thus not primarily another theoretical framework for linguists. + +

Multilingual grammars

+ +Abstract syntax: language-independent representation +
+  cat Prop ; Nat ;
+  fun Even : Nat -> Prop ;
+
+Concrete syntax: mapping from abstract syntax trees to strings in a language +(English, French, German, Swedish,...) +
+  lin Even x = {s = x.s ++ "is" ++ "even"} ; 
+
+  lin Even x = {s = x.s ++ "est" ++ "pair"} ;
+
+  lin Even x = {s = x.s ++ "ist" ++ "gerade"} ;
+
+  lin Even x = {s = x.s ++ "är" ++ "jämnt"} ;
+
+We can translate between language via the abstract syntax. + +

+ +Is it really so simple? + + + +

Difficulties with concrete syntax

+ +Most languages have rules of inflection, agreement, +and word order, which have to be obeyed when putting together +expressions. + +

+ +The previous multilingual grammar breaks these rules in many situations: +

+2 and 3 is even
+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
+
+ + +

Solving the difficulties

+ +GF has tools for expressing the linguistic rules that are needed to +produce correct translations in different languages. + +

+ +Instead of just strings, we need

parameters, tables, +and record types. For instance, French: +

+  param Mod = Ind | Subj ;
+  param Gen = Masc | Fem ;
+
+  lincat Nat = {s : Str ; g : Gen} ;
+  lincat Prop = {s : Mod => Str} ;
+
+  lin Even x = {s =
+      table {
+        m => x.s ++
+             case m   of {Ind  => "est" ;  Subj => "soit"} ++
+             case x.g of {Masc => "pair" ; Fem  => "paire"}
+      }
+    } ;
+
+ + +

Language + Libraries

@@ -55,7 +126,7 @@ theoretical knowledge about the language.

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