mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-20 18:29:33 -06:00
spr?kdata talk ready
This commit is contained in:
29
lib/resource/doc/ScanMod.dot
Normal file
29
lib/resource/doc/ScanMod.dot
Normal file
@@ -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"];
|
||||
|
||||
}
|
||||
@@ -47,6 +47,77 @@ Thus <i>not</i> primarily another theoretical framework for
|
||||
linguists.
|
||||
|
||||
|
||||
<!-- NEW -->
|
||||
<h2>Multilingual grammars</h2>
|
||||
|
||||
<b>Abstract syntax</b>: language-independent representation
|
||||
<pre>
|
||||
cat Prop ; Nat ;
|
||||
fun Even : Nat -> Prop ;
|
||||
</pre>
|
||||
<b>Concrete syntax</b>: mapping from abstract syntax trees to strings in a language
|
||||
(English, French, German, Swedish,...)
|
||||
<pre>
|
||||
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"} ;
|
||||
</pre>
|
||||
We can <b>translate</b> between language via the abstract syntax.
|
||||
|
||||
<p>
|
||||
|
||||
Is it really so simple?
|
||||
|
||||
|
||||
<!-- NEW -->
|
||||
<h2>Difficulties with concrete syntax</h2>
|
||||
|
||||
Most languages have rules of <b>inflection</b>, <b>agreement</b>,
|
||||
and <b>word order</b>, which have to be obeyed when putting together
|
||||
expressions.
|
||||
|
||||
<p>
|
||||
|
||||
The previous multilingual grammar breaks these rules in many situations:
|
||||
<p><i>
|
||||
2 and 3 is even<br>
|
||||
la somme de 3 et de 5 est pair<br>
|
||||
wenn 2 ist gerade, dann 2+2 ist gerade<br>
|
||||
om 2 är jämnt, 2+2 är jämnt<br>
|
||||
</i>
|
||||
|
||||
<!-- NEW -->
|
||||
<h2>Solving the difficulties</h2>
|
||||
|
||||
GF has tools for expressing the linguistic rules that are needed to
|
||||
produce correct translations in different languages.
|
||||
|
||||
<p>
|
||||
|
||||
Instead of just strings, we need <p>parameters</b>, <b>tables</b>,
|
||||
and <b>record types</b>. For instance, French:
|
||||
<pre>
|
||||
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"}
|
||||
}
|
||||
} ;
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
<!-- NEW -->
|
||||
<h2>Language + Libraries</h2>
|
||||
|
||||
@@ -55,7 +126,7 @@ theoretical knowledge about the language.
|
||||
|
||||
<p>
|
||||
|
||||
Which kind of programmer is easier to find?
|
||||
Which kind of a programmer is easier to find?
|
||||
<ul>
|
||||
<li> one who can write a sorting algorithm
|
||||
<li> one who can write a grammar for Swedish determiners
|
||||
@@ -84,10 +155,10 @@ success - libraries are another half.
|
||||
To define a Swedish expression of a mathematical predicate from scratch:
|
||||
<pre>
|
||||
Even x =
|
||||
let jämn = case <x.n,x.g> of {
|
||||
<Sg,Utr> => "jämn" ;
|
||||
<Sg,Neutr> => "jämnt" ;
|
||||
<Pl,_> => "jämna"
|
||||
let jämn = case <x.n,x.g> of {
|
||||
<Sg,Utr> => "jämn" ;
|
||||
<Sg,Neutr> => "jämnt" ;
|
||||
<Pl,_> => "jämna"
|
||||
}
|
||||
in
|
||||
{s = table {
|
||||
@@ -103,6 +174,7 @@ To use library functions for syntax and morphology:
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
<!-- NEW -->
|
||||
<h2>Questions in grammar library design</h2>
|
||||
|
||||
@@ -149,9 +221,9 @@ Basic syntactic structures
|
||||
|
||||
<p>
|
||||
|
||||
Currently <i>no</i> semantics,
|
||||
<i>no</i> language-specific structures if not
|
||||
necessary for expressivity.
|
||||
Currently,<br>
|
||||
<li> <i>no</i> semantics,<br>
|
||||
<li> <i>no</i> language-specific structures if not necessary for expressivity.
|
||||
|
||||
|
||||
|
||||
@@ -196,7 +268,7 @@ Semantic correctness
|
||||
<p>
|
||||
|
||||
(Warning for linguists:) theoretical innovation in
|
||||
syntax
|
||||
syntax (and it will all be hidden anyway!)
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user