1
0
forked from GitHub/gf-rgl

Update RG tutorial to render well with update_html from gf-core

This commit is contained in:
John J. Camilleri
2019-05-20 10:10:11 +02:00
parent 4c308d0498
commit 4838a59d20
18 changed files with 237 additions and 324 deletions

View File

@@ -1,10 +0,0 @@
all: lrecslides-html
lrecslides-tex:
txt2tags -ttex gf-lrec-2010.txt
cat prelude gf-lrec-2010.tex >tmp.tex
mv tmp.tex gf-lrec-2010.tex
pdflatex gf-lrec-2010.tex
lrecslides-html:
txt2tags -thtml gf-lrec-2010.txt

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 KiB

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 178 KiB

View File

@@ -1,50 +1,20 @@
GF Resource Grammar Tutorial
Creating Linguistic Resources with the Grammatical Framework Creating Linguistic Resources with the Grammatical Framework
Aarne Ranta Aarne Ranta
LREC Tutorial, Malta, 17 May 2010
%!postproc(tex) : "\\documentclass{article}" "" ==Introduction==
%!postproc(tex) : "\\subsubsection\*" "\\snewslide"
%!postproc(tex) : "\\subsection\*" "\\newslide"
%!postproc(tex) : "\\section\*" "\\nnewslide"
%!postproc(tex) : "\\includegraphics" "\\includegraphics[width=\\textwidth]"
%!postproc(tex) : #MOLTOLOGO "includegraphics[width=60mm]{molto_logo.png}"
%!postproc(tex) : #ALIGNEX "includegraphics[width=\\textwidth]{align-zero.png}"
%!postproc(tex) : #ABSANDCNC "includegraphics[width=\\textwidth]{abs-and-cnc.jpg}"
%!postproc(tex) : #ZEROFRIDGE "includegraphics[width=60mm]{zero-fridge.jpg}"
%!postproc(tex) : #ABSTREE "includegraphics[width=50mm]{abstract.jpg}"
%!postproc(tex) : #PARSETREE "includegraphics[width=50mm]{parse.jpg}"
%!postproc(tex) : #ABSANDPARSE "includegraphics[width=50mm]{abstract.jpg} \\includegraphics[width=50mm]{parse.jpg}\\includegraphics[width=50mm]{dutparse.jpg}"
%!postproc(tex) : #ALIGNMENT "includegraphics[width=50mm]{engdut.jpg}"
%!postproc(tex) : #TESTDEP "includegraphics[width=60mm]{langdep.png}"
%!postproc(tex) : #FACEMOD "includegraphics[width=100mm]{facemod.jpg}"
%!postproc(tex) : #ARAV "includegraphics[width=90mm]{arav.jpg}"
%!postproc(tex) : #HINDI "includegraphics[width=90mm]{hindi.jpg}"
%!postproc(tex) : #ARABNUM "includegraphics[width=100mm]{arabnum.jpg}"
%!postproc(tex) : #Syntax "includegraphics[width=\\textwidth]{Syntax.jpg}"
%!preproc(tex): "#NEW" ""
%!postproc(tex) : "#SMALL" "small"
%!postproc(tex) : "#HUGE" "huge"
%!postproc(tex) : "#TINY" "tiny"
%!postproc(tex) : "#NORMAL" "normalsize"
%!postproc(tex) : "#BEGNOTPRINTED" "notprinted{"
%!postproc(tex) : "#ENDNOTPRINTED" "}"
#NEW This tutorial was given at LREC in Malta, 17 May 2010,
and is an updated versions of the one used at the
//Notice//. This tutorial is an updated versions of the one used at the [GF Summer School 2009 http://www.grammaticalframework.org/summerschool.html].
GF Summer School 2009 It was first presented on an on-line course in April 2009.
([``grammaticalframework.org/summerschool.html`` http://www.grammaticalframework.org/summerschool.html]). It was first presented on an The summer school in August 2009 had
on-line course in April 2009.
The
summer school in August 2009
had
30 participants from 20 countries. 30 participants from 20 countries.
15 new languages were started. Since the summer school, 15 new languages were started.
the library has grown from 12 to 16 languages. Since that first summer school, the library has grown from 12 to over 30 languages.
The goal of this tutorial is to introduce The goal of this tutorial is to introduce
@@ -55,17 +25,16 @@ and the linguistic concepts in the resource grammar library.
For more details, we recommend For more details, we recommend
- the tutorial on the GF homepage - the tutorial on the [GF homepage http://grammaticalframework.org/]
[``grammaticalframework.org`` http://grammaticalframework.org/]
- the article //The GF Resource Grammar Library//, LiLT 2(2), 2009. - the article //The GF Resource Grammar Library//, LiLT 2(2), 2009.
Freely available in Freely available in
[``elanguage.net/journals/index.php/lilt/article/viewFile/214/158`` http://elanguage.net/journals/index.php/lilt/article/viewFile/214/158] [``elanguage.net/journals/index.php/lilt/article/viewFile/214/158`` http://elanguage.net/journals/index.php/lilt/article/viewFile/214/158]
- GF Book by A. Ranta, forthcoming at CSLI Publications - [GF Book http://www.grammaticalframework.org/gf-book] by A. Ranta, by CSLI Publications
The code examples in this tutorial are available in The code examples in this tutorial are available at
[``code.haskell.org/gf/examples/lrec-tutorial/`` http://code.haskell.org/gf/examples/lrec-tutorial/]. [``https://github.com/GrammaticalFramework/gf-contrib/tree/master/lrec-tutorial`` https://github.com/GrammaticalFramework/gf-contrib/tree/master/lrec-tutorial].
We cannot stress enough the importance of your own work on the We cannot stress enough the importance of your own work on the
code examples and exercises using the GF system! code examples and exercises using the GF system!
@@ -129,7 +98,7 @@ A grammar is a declarative program that defines
Many languages related by a common **abstract syntax** Many languages related by a common **abstract syntax**
#ABSANDCNC [abs-and-cnc.jpg]
===The GF program=== ===The GF program===
@@ -172,7 +141,7 @@ Dialogue systems: TALK, see
Translation: MOLTO, see Translation: MOLTO, see
[``www.molto-project.eu`` http://www.molto-project.eu] [``www.molto-project.eu`` http://www.molto-project.eu]
#MOLTOLOGO [molto_logo.png]
===GF run-time system=== ===GF run-time system===
@@ -205,7 +174,6 @@ The //Developers// method is recommended for resource grammar developers:
===Starting the GF shell=== ===Starting the GF shell===
#SMALL
The command ``gf`` starts the GF shell: The command ``gf`` starts the GF shell:
``` ```
@@ -230,7 +198,6 @@ Languages:
> >
``` ```
#NORMAL
@@ -311,7 +278,7 @@ To **pipe** a command to another one: ``|``
===Graphical view of abstract trees=== ===Graphical view of abstract trees===
#ABSTREE [abstract.jpg]
In Mac: In Mac:
``` ```
@@ -326,7 +293,7 @@ You need the Graphviz program to see the view.
===Graphical view of parse trees=== ===Graphical view of parse trees===
#PARSETREE [parse.jpg]
``` ```
> p "John loves Mary" | visualize_parse -view=open > p "John loves Mary" | visualize_parse -view=open
@@ -383,7 +350,7 @@ The grammar is divided to two **modules**
- a **concrete** module, judgement forms ``lincat`` and ``lin`` - a **concrete** module, judgement forms ``lincat`` and ``lin``
|| Judgement | reading || || Judgement | reading |
| ``cat``//C// | //C// is a category | ``cat``//C// | //C// is a category
| ``fun`` //f// : //T// | //f// is a function of type //T// | ``fun`` //f// : //T// | //f// is a function of type //T//
| ``lincat`` //C// ``=`` //L// | //C// has linearization type //L// | ``lincat`` //C// ``=`` //L// | //C// has linearization type //L//
@@ -569,7 +536,23 @@ The values of fields are picked by **projection** (``.``)
===Concrete syntax, Hebrew=== ===Concrete syntax, Hebrew===
[ZeroHeb.jpg] ```
concrete ZeroHeb of Zero = {
flags coding=utf8 ;
lincat
S = Str ;
NP = {s : Str ; g : Gender} ;
VP, V2 = Gender => Str ;
lin
Pred np vp = np.s ++ vp ! np.g ;
Compl v2 np = table {g => v2 ! g ++ "את" ++ np.s} ;
John = {s = "ג'ון" ; g = Masc} ;
Mary = {s = "מרי" ; g = Fem} ;
Love = table {Masc => "אוהב" ; Fem => "אוהבת"} ;
param
Gender = Masc | Fem ;
}
```
The verb **agrees** to the gender of the subject. The verb **agrees** to the gender of the subject.
@@ -613,7 +596,6 @@ From this we infer that French nouns have variable number and inherent gender
==Visualizing trees and word alignment== ==Visualizing trees and word alignment==
%#ABSANDPARSE
[abstract.jpg] [parse.jpg] [dutparse.jpg] [abstract.jpg] [parse.jpg] [dutparse.jpg]
@@ -637,7 +619,7 @@ Delete the intervening tree, combining links directly from L1 to L2
===Word alignment via trees=== ===Word alignment via trees===
#ALIGNMENT [engdut.jpg]
``` ```
> parse "John loves Mary" | aw -view=open > parse "John loves Mary" | aw -view=open
@@ -658,7 +640,7 @@ Compile the grammar to PGF:
``` ```
The resulting file ``Zero.pgf`` can be e.g. included in fridge magnets: The resulting file ``Zero.pgf`` can be e.g. included in fridge magnets:
#ZEROFRIDGE [zero-fridge.jpg]
==Scaling up the grammar== ==Scaling up the grammar==
@@ -724,7 +706,6 @@ Moreover: common nouns, adjectives
//is old//. //is old//.
#NEW
=Morphological Paradigms and Lexicon Building= =Morphological Paradigms and Lexicon Building=
@@ -798,7 +779,7 @@ categories.
===The main lexical categories in the resource grammar=== ===The main lexical categories in the resource grammar===
|| ``cat`` | name | example || || ``cat`` | name | example |
| ``N`` | noun | //house// | ``N`` | noun | //house//
| ``A`` | adjective | //small// | ``A`` | adjective | //small//
| ``V`` | verb | //sleep// | ``V`` | verb | //sleep//
@@ -808,7 +789,7 @@ categories.
===Typical feature design=== ===Typical feature design===
|| ``cat`` | variable | inherent || || ``cat`` | variable | inherent |
| ``N`` | number, case | gender | ``N`` | number, case | gender
| ``A`` | number, case, gender, degree | position | ``A`` | number, case, gender, degree | position
| ``V`` | tense, number, person, ... | auxiliary | ``V`` | tense, number, person, ... | auxiliary
@@ -1313,7 +1294,7 @@ But not in all combinations. For instance: no first person dual.
===Example of Arabic verb inflection=== ===Example of Arabic verb inflection===
#ARAV [arav.jpg]
===Arabic verb type: implementation=== ===Arabic verb type: implementation===
@@ -1335,7 +1316,6 @@ Thus 2*(3*2 + 2 + 1 + 2 + 1 + 1) = 26 forms, not 2*3*2*3 = 36.
===An Arabic verb paradigm=== ===An Arabic verb paradigm===
#SMALL
``` ```
pattV_u : Tense -> VPer -> Pattern = \t,v -> getPattern (case t of { pattV_u : Tense -> VPer -> Pattern = \t,v -> getPattern (case t of {
@@ -1357,7 +1337,6 @@ Thus 2*(3*2 + 2 + 1 + 2 + 1 + 1) = 26 forms, not 2*3*2*3 = 36.
} ; } ;
``` ```
#NORMAL
===Applying an Arabic paradigm=== ===Applying an Arabic paradigm===
@@ -1414,7 +1393,6 @@ in HTML.
#NEW
=Basics of a Linguistic Syntax Implementation= =Basics of a Linguistic Syntax Implementation=
@@ -1458,7 +1436,7 @@ A lot of work, easy to get wrong!
===The key categories=== ===The key categories===
|| ``cat`` | name | example || || ``cat`` | name | example |
| ``Cl`` | clause | //every young man loves Mary// | ``Cl`` | clause | //every young man loves Mary//
| ``VP`` | verb phrase | //loves Mary// | ``VP`` | verb phrase | //loves Mary//
| ``V2`` | two-place verb | //loves// | ``V2`` | two-place verb | //loves//
@@ -1470,7 +1448,7 @@ A lot of work, easy to get wrong!
===The key functions=== ===The key functions===
|| ``fun`` | name | example || || ``fun`` | name | example |
| ``PredVP : NP -> VP -> Cl`` | predication | //every man loves Mary// | ``PredVP : NP -> VP -> Cl`` | predication | //every man loves Mary//
| ``ComplV2 : V2 -> NP -> VP`` | complementation | //loves Mary// | ``ComplV2 : V2 -> NP -> VP`` | complementation | //loves Mary//
| ``DetCN : Det -> CN -> NP`` | determination | //every man// | ``DetCN : Det -> CN -> NP`` | determination | //every man//
@@ -1481,7 +1459,7 @@ A lot of work, easy to get wrong!
===Feature design=== ===Feature design===
|| ``cat`` | variable | inherent || || ``cat`` | variable | inherent |
| ``Cl`` | tense | - | ``Cl`` | tense | -
| ``VP`` | tense, agr | - | ``VP`` | tense, agr | -
| ``V2`` | tense, agr | case | ``V2`` | tense, agr | case
@@ -1529,27 +1507,25 @@ It is similar to lambda abstraction (``\x,y -> t`` in a function type).
English English
|| np.agr | present | past | future || || np.agr | present | past | future |
| Sg Per1 | //I sleep// | //I slept// | //I will sleep// | Sg Per1 | //I sleep// | //I slept// | //I will sleep//
| Sg Per3 | //she sleeps// | //she slept// | //she will sleep// | Sg Per3 | //she sleeps// | //she slept// | //she will sleep//
| Pl Per1 | //we sleep// | //we slept// | //we will sleep// | Pl Per1 | //we sleep// | //we slept// | //we will sleep//
Italian ("I am tired", "she is tired", "we are tired") Italian ("I am tired", "she is tired", "we are tired")
#SMALL
|| np.agr | present | past | future || || np.agr | present | past | future |
| Masc Sg Per1 | //io sono stanco// | //io ero stanco// | //io sarò stanco// | Masc Sg Per1 | //io sono stanco// | //io ero stanco// | //io sarò stanco//
| Fem Sg Per3 | //lei è stanca// | //lei era stanca// | //lei sarà stanca// | Fem Sg Per3 | //lei è stanca// | //lei era stanca// | //lei sarà stanca//
| Fem Pl Per1 | //noi siamo stanche// | //noi eravamo stanche// | //noi saremo stanche// | Fem Pl Per1 | //noi siamo stanche// | //noi eravamo stanche// | //noi saremo stanche//
#NORMAL
===Predication: variations=== ===Predication: variations===
Word order: Word order:
- //will I sleep// (English), //è stanca lei// (Italian) - //will I sleep// (English), //è stanca lei// (Italian)
Pro-drop: Pro-drop:
@@ -1561,7 +1537,7 @@ Ergativity:
Variable subject case: Variable subject case:
- //minä olen lapsi// vs. //minulla on lapsi// (Finnish, - //minä olen lapsi// vs. //minulla on lapsi// (Finnish,
"I am a child" (nominative) vs. "I have a child" (adessive)) "I am a child" (nominative) vs. "I have a child" (adessive))
@@ -1583,17 +1559,17 @@ lin ComplV2 v2 vp = {s = \\t,a => v2.s ! t ! a ++ np.s ! v2.c}
English English
|| v2.case | infinitive VP || || v2.case | infinitive VP |
| Acc | //love me// | Acc | //love me//
| //at// + Acc | //look at me// | //at// + Acc | //look at me//
Finnish Finnish
|| v2.case | VP, infinitive | translation || || v2.case | VP, infinitive | translation |
| Accusative | //tavata minut// | "meet me" | Accusative | //tavata minut// | "meet me"
| Partitive | //rakastaa minua// | "love me" | Partitive | //rakastaa minua// | "love me"
| Elative | //pitää minusta// | "like me" | Elative | //pitää minusta// | "like me"
| Genitive + //perään// | //katsoa minun perääni// | "look after me" | Genitive + //perään// | //katsoa minun perääni// | "look after me"
===Complementation: variations=== ===Complementation: variations===
@@ -1636,22 +1612,22 @@ oper agr : Gender -> Number -> Person -> Agr
English English
|| Det.num | NP || || Det.num | NP |
| Sg | //every house// | Sg | //every house//
| Pl | //these houses// | Pl | //these houses//
Italian ("this wine", "this pizza", "those pizzas") Italian ("this wine", "this pizza", "those pizzas")
|| Det.num | CN.gen | NP || || Det.num | CN.gen | NP |
| Sg | Masc | //questo vino// | Sg | Masc | //questo vino//
| Sg | Fem | //questa pizza// | Sg | Fem | //questa pizza//
| Pl | Fem | //quelle pizze// | Pl | Fem | //quelle pizze//
Finnish ("every house", "these houses") Finnish ("every house", "these houses")
|| Det.num | NP, nominative | NP, inessive || || Det.num | NP, nominative | NP, inessive |
| Sg | //jokainen talo// | //jokaisessa talossa// | Sg | //jokainen talo// | //jokaisessa talossa//
| Pl | //nämä talot// | //näissä taloissa// | Pl | //nämä talot// | //näissä taloissa//
@@ -1692,18 +1668,18 @@ lin AdjCN ap cn = {
English English
|| CN, singular | CN, plural || || CN, singular | CN, plural |
| //new house// | //new houses// | //new house// | //new houses//
Italian ("red wine", "red house") Italian ("red wine", "red house")
|| CN.gen | CN, singular | CN, plural || || CN.gen | CN, singular | CN, plural |
| Masc | //vino rosso// | //vini rossi// | Masc | //vino rosso// | //vini rossi//
| Fem | //casa rossa// | //case rosse// | Fem | //casa rossa// | //case rosse//
Finnish ("red house") Finnish ("red house")
|| CN, sg, nominative | CN, sg, ablative | CN, pl, essive || || CN, sg, nominative | CN, sg, ablative | CN, pl, essive |
| //punainen talo// | //punaiselta talolta// | //punaisina taloina// | | //punainen talo// | //punaiselta talolta// | //punaisina taloina// |
@@ -1814,11 +1790,9 @@ Module opening: ``N = open R1, R2, R3 in {...}``
===Module dependencies=== ===Module dependencies===
#TESTDEP [langdep.png]
#SMALL
//rectangle = abstract, solid ellipse = concrete, dashed ellipse = resource// //rectangle = abstract, solid ellipse = concrete, dashed ellipse = resource//
#NORMAL
%% TODO: Test -> Lang %% TODO: Test -> Lang
@@ -1837,7 +1811,6 @@ Before calling ``dot``, removed the module ``Predef`` to save space.
===The module Grammar=== ===The module Grammar===
#SMALL
``` ```
abstract Grammar = { abstract Grammar = {
cat cat
@@ -1856,7 +1829,6 @@ abstract Grammar = {
i_NP, she_NP, we_NP : NP ; i_NP, she_NP, we_NP : NP ;
} }
``` ```
#NORMAL
===Parameters=== ===Parameters===
@@ -1879,13 +1851,13 @@ Parameters are defined in ``ResIta.gf``. Just 11 of the 56 verb forms.
===Tense and agreement of a verb phrase, in syntax=== ===Tense and agreement of a verb phrase, in syntax===
|| ``UseV arrive_V`` | Pres | Perf || || ``UseV arrive_V`` | Pres | Perf |
| Ag Masc Sg Per1 | //arrivo// | //sono arrivato// | Ag Masc Sg Per1 | //arrivo// | //sono arrivato//
| Ag Fem Sg Per1 | //arrivo// | //sono arrivata// | Ag Fem Sg Per1 | //arrivo// | //sono arrivata//
| Ag Masc Sg Per2 | //arrivi// | //sei arrivato// | Ag Masc Sg Per2 | //arrivi// | //sei arrivato//
| Ag Fem Sg Per2 | //arrivi// | //sei arrivata// | Ag Fem Sg Per2 | //arrivi// | //sei arrivata//
| Ag Masc Sg Per3 | //arriva// | //è arrivato// | Ag Masc Sg Per3 | //arriva// | //è arrivato//
| Ag Fem Sg Per3 | //arriva// | //è arrivata// | Ag Fem Sg Per3 | //arriva// | //è arrivata//
| Ag Masc Pl Per1 | //arriviamo// | //siamo arrivati// | Ag Masc Pl Per1 | //arriviamo// | //siamo arrivati//
| Ag Fem Pl Per1 | //arriviamo// | //siamo arrivate// | Ag Fem Pl Per1 | //arriviamo// | //siamo arrivate//
| Ag Masc Pl Per2 | //arrivate// | //siete arrivati// | Ag Masc Pl Per2 | //arrivate// | //siete arrivati//
@@ -1896,7 +1868,7 @@ Parameters are defined in ``ResIta.gf``. Just 11 of the 56 verb forms.
===The forms of a verb, in morphology=== ===The forms of a verb, in morphology===
|| ``arrive_V`` | form || || ``arrive_V`` | form |
| VInf | //arrivare// | VInf | //arrivare//
| VPres Sg Per1 | //arrivo// | VPres Sg Per1 | //arrivo//
| VPres Sg Per2 | //arrivi// | VPres Sg Per2 | //arrivi//
@@ -1953,7 +1925,6 @@ Being clitic depends on case
``` ```
lincat NP = {s : Case => {clit,obj : Str} ; a : Agr} ; lincat NP = {s : Case => {clit,obj : Str} ; a : Agr} ;
``` ```
#SMALL
Examples: Examples:
``` ```
lin she_NP = { lin she_NP = {
@@ -1972,7 +1943,6 @@ Examples:
a = Ag Fem Sg Per3 a = Ag Fem Sg Per3
} }
``` ```
#NORMAL
===Noun phrases: alternatively=== ===Noun phrases: alternatively===
@@ -2105,7 +2075,7 @@ However, in the perfective tense:
Example: "the boy/girl eats the apple/bread" Example: "the boy/girl eats the apple/bread"
|| subj | obj | gen. present | perfective || || subj | obj | gen. present | perfective |
| Masc | Masc | //ladka: seb Ka:ta: hai// | //ladke ne seb Ka:ya:// | Masc | Masc | //ladka: seb Ka:ta: hai// | //ladke ne seb Ka:ya://
| Masc | Fem | //ladka: roTi: Ka:ta: hai// | //ladke ne roTi: Ka:yi:// | Masc | Fem | //ladka: roTi: Ka:ta: hai// | //ladke ne roTi: Ka:yi://
| Fem | Masc | //ladki: seb Ka:ti: hai// | //ladki: ne seb Ka:ya:// | Fem | Masc | //ladki: seb Ka:ti: hai// | //ladki: ne seb Ka:ya://
@@ -2116,7 +2086,7 @@ Example: "the boy/girl eats the apple/bread"
===A Hindi clause in different tenses=== ===A Hindi clause in different tenses===
#HINDI [hindi.jpg]
==Exercises== ==Exercises==
@@ -2140,7 +2110,6 @@ Test this with the sentences //lei la ha amata// and //lei ci ha amati//
at least 14 editions). at least 14 editions).
#NEW
=Using the Resource Grammar Library in Applications= =Using the Resource Grammar Library in Applications=
@@ -2229,10 +2198,10 @@ Adapt the email program to Italian, Finnish, Arabic...
===> hai due messaggi ===> hai due messaggi
PredVP youSg_NP (ComplV2 have_V2 (NumCN two_Num (UseN (mkN "viesti")))) PredVP youSg_NP (ComplV2 have_V2 (NumCN two_Num (UseN (mkN "viesti"))))
===> sinulla on kaksi viestiä ===> sinulla on kaksi viestiä
PredVP youSg_NP (ComplV2 have_V2 (NumCN two_Num (UseN (mkN "risaAlat.u.")))) PredVP youSg_NP (ComplV2 have_V2 (NumCN two_Num (UseN (mkN "risaAlat.u."))))
===> sinulla on kaksi viestiä ===> sinulla on kaksi viestiä
``` ```
The new languages are more complex than English - but only internally, The new languages are more complex than English - but only internally,
not on the API level! not on the API level!
@@ -2240,12 +2209,10 @@ not on the API level!
===Correct number in Arabic=== ===Correct number in Arabic===
#ARABNUM [arabnum.jpg]
#TINY
(From "Implementation of the Arabic Numerals and their Syntax in GF" by (From "Implementation of the Arabic Numerals and their Syntax in GF" by
Ali Dada, ACL workshop on Arabic, Prague 2007) Ali Dada, ACL workshop on Arabic, Prague 2007)
#NORMAL
===Use cases for grammar libraries=== ===Use cases for grammar libraries===
@@ -2264,7 +2231,7 @@ Some applications where grammars have shown to be useful:
**Application grammarians** vs. **resource grammarians** **Application grammarians** vs. **resource grammarians**
|| grammarian | applications | resources || || grammarian | applications | resources |
| expertise | application domain | linguistics | expertise | application domain | linguistics
| programming skills | programming in general | GF programming | programming skills | programming in general | GF programming
| language skills | practical use | theoretical knowledge | language skills | practical use | theoretical knowledge
@@ -2276,7 +2243,7 @@ We want a **division of labour**.
**Application grammars** vs. **resource grammars** **Application grammars** vs. **resource grammars**
|| grammar | application | resource || || grammar | application | resource |
| abstract syntax | semantic | syntactic | abstract syntax | semantic | syntactic
| concrete syntax | using resource API | parameters, tables, records | concrete syntax | using resource API | parameters, tables, records
| lexicon | idiomatic, technical | just for testing | lexicon | idiomatic, technical | just for testing
@@ -2393,7 +2360,7 @@ The resource defines e.g.
These functions (some of which are structural words) are used. These functions (some of which are structural words) are used.
|| Function | example || || Function | example |
| ``mkCl : NP -> V2 -> NP -> Cl`` | //John loves Mary// | ``mkCl : NP -> V2 -> NP -> Cl`` | //John loves Mary//
| ``mkNP : Numeral -> CN -> NP`` | //five cars// | ``mkNP : Numeral -> CN -> NP`` | //five cars//
| ``mkNP : Quant -> CN -> NP`` | //that car// | ``mkNP : Quant -> CN -> NP`` | //that car//
@@ -2410,7 +2377,6 @@ These functions (some of which are structural words) are used.
===Concrete syntax for English=== ===Concrete syntax for English===
How are messages expressed by using the library? How are messages expressed by using the library?
#SMALL
``` ```
concrete FaceEng of Face = open SyntaxEng, ParadigmsEng in { concrete FaceEng of Face = open SyntaxEng, ParadigmsEng in {
lincat lincat
@@ -2433,13 +2399,11 @@ oper
friend_N = mkN "friend" ; friend_N = mkN "friend" ;
} }
``` ```
#NORMAL
===Concrete syntax for Finnish=== ===Concrete syntax for Finnish===
How are messages expressed by using the library? How are messages expressed by using the library?
#SMALL
``` ```
concrete FaceFin of Face = open SyntaxFin, ParadigmsFin in { concrete FaceFin of Face = open SyntaxFin, ParadigmsFin in {
lincat lincat
@@ -2457,12 +2421,11 @@ lin
Two = n2_Numeral ; Two = n2_Numeral ;
Hundred = n100_Numeral ; Hundred = n100_Numeral ;
oper oper
like_V2 = mkV2 "pitää" elative ; like_V2 = mkV2 "pitää" elative ;
invitation_N = mkN "kutsu" ; invitation_N = mkN "kutsu" ;
friend_N = mkN "ystävä" ; friend_N = mkN "ystävä" ;
} }
``` ```
#NORMAL
@@ -2505,7 +2468,6 @@ oper
===Concrete syntax functor "FaceI"=== ===Concrete syntax functor "FaceI"===
#SMALL
``` ```
incomplete concrete FaceI of Face = open Syntax, LexFace in { incomplete concrete FaceI of Face = open Syntax, LexFace in {
@@ -2525,7 +2487,6 @@ lin
Hundred = n100_Numeral ; Hundred = n100_Numeral ;
} }
``` ```
#NORMAL
@@ -2564,9 +2525,9 @@ Also notice the domain search path.
``` ```
instance LexFaceFin of LexFace = open SyntaxFin, ParadigmsFin in { instance LexFaceFin of LexFace = open SyntaxFin, ParadigmsFin in {
oper oper
like_V2 = mkV2 (mkV "pitää") elative ; like_V2 = mkV2 (mkV "pitää") elative ;
invitation_N = mkN "kutsu" ; invitation_N = mkN "kutsu" ;
friend_N = mkN "ystävä" ; friend_N = mkN "ystävä" ;
} }
``` ```
2. Functor instantiation: mechanically change ``Eng`` to ``Fin`` 2. Functor instantiation: mechanically change ``Eng`` to ``Fin``
@@ -2596,11 +2557,9 @@ concrete FaceFin of Face = FaceI with
===Module dependency graph=== ===Module dependency graph===
#FACEMOD [facemod.jpg]
#TINY
//red = to do, orange = to do (trivial), blue = to do (once), green = library// //red = to do, orange = to do (trivial), blue = to do (once), green = library//
#NORMAL
@@ -2665,7 +2624,7 @@ Main division:
===Categories of complex phrases=== ===Categories of complex phrases===
|| Category | Explanation | Example || || Category | Explanation | Example |
| ``Text`` | sequence of utterances | //Does John walk? Yes.// | | ``Text`` | sequence of utterances | //Does John walk? Yes.// |
| ``Utt`` | utterance | //does John walk// | | ``Utt`` | utterance | //does John walk// |
| ``Imp`` | imperative | //don't walk// | | ``Imp`` | imperative | //don't walk// |
@@ -2682,7 +2641,7 @@ Main division:
===Lexical categories for building predicates=== ===Lexical categories for building predicates===
|| Cat | Explanation | Compl | Example || || Cat | Explanation | Compl | Example |
| ``A`` | one-place adjective | - | //smart// | | ``A`` | one-place adjective | - | //smart// |
| ``A2`` | two-place adjective | ``NP`` | //married// (//to her//) | | ``A2`` | two-place adjective | ``NP`` | //married// (//to her//) |
| ``Adv`` | adverb | - | //here// | | ``Adv`` | adverb | - | //here// |
@@ -2698,7 +2657,7 @@ Main division:
===Functions for building predication clauses=== ===Functions for building predication clauses===
|| Fun | Type | Example || || Fun | Type | Example |
| ``mkCl`` | ``NP -> V -> Cl`` | //John walks// | | ``mkCl`` | ``NP -> V -> Cl`` | //John walks// |
| ``mkCl`` | ``NP -> V2 -> NP -> Cl`` | //John loves her// | | ``mkCl`` | ``NP -> V2 -> NP -> Cl`` | //John loves her// |
| ``mkCl`` | ``NP -> V3 -> NP -> NP -> Cl`` | //John sends it to her// | | ``mkCl`` | ``NP -> V3 -> NP -> NP -> Cl`` | //John sends it to her// |
@@ -2716,7 +2675,7 @@ Main division:
===Noun phrases and common nouns=== ===Noun phrases and common nouns===
|| Fun | Type | Example || || Fun | Type | Example |
| ``mkNP`` | ``Quant -> CN -> NP`` | //this man// | | ``mkNP`` | ``Quant -> CN -> NP`` | //this man// |
| ``mkNP`` | ``Numeral -> CN -> NP`` | //five men// | | ``mkNP`` | ``Numeral -> CN -> NP`` | //five men// |
| ``mkNP`` | ``PN -> NP`` | //John// | | ``mkNP`` | ``PN -> NP`` | //John// |
@@ -2732,7 +2691,7 @@ Main division:
===Questions and interrogatives=== ===Questions and interrogatives===
|| Fun | Type | Example || || Fun | Type | Example |
| ``mkQCl`` | ``Cl -> QCl`` | //does John walk// | | ``mkQCl`` | ``Cl -> QCl`` | //does John walk// |
| ``mkQCl`` | ``IP -> V -> QCl`` | //who walks// | | ``mkQCl`` | ``IP -> V -> QCl`` | //who walks// |
| ``mkQCl`` | ``IP -> V2 -> NP -> QCl`` | //who loves her// | | ``mkQCl`` | ``IP -> V2 -> NP -> QCl`` | //who loves her// |
@@ -2749,13 +2708,13 @@ Main division:
===Sentence formation, tense, and polarity=== ===Sentence formation, tense, and polarity===
|| Fun | Type | Example || || Fun | Type | Example |
| ``mkS`` | ``Cl -> S`` | //he walks// | | ``mkS`` | ``Cl -> S`` | //he walks// |
| ``mkS`` | ``(Tense)->(Ant)->(Pol)->Cl -> S`` | //he wouldn't have walked// | | ``mkS`` | ``(Tense)->(Ant)->(Pol)->Cl -> S`` | //he wouldn't have walked// |
| ``mkQS`` | ``QCl -> QS`` | //does he walk// | | ``mkQS`` | ``QCl -> QS`` | //does he walk// |
| ``mkQS`` | ``(Tense)->(Ant)->(Pol)->QCl -> QS`` | //wouldn't he have walked// | | ``mkQS`` | ``(Tense)->(Ant)->(Pol)->QCl -> QS`` | //wouldn't he have walked// |
|| Function | Type | Example || || Function | Type | Example |
| ``conditionalTense`` | ``Tense`` | (//he would walk//) | | ``conditionalTense`` | ``Tense`` | (//he would walk//) |
| ``futureTense`` | ``Tense`` | (//he will walk//) | | ``futureTense`` | ``Tense`` | (//he will walk//) |
| ``pastTense`` | ``Tense`` | (//he walked//) | | ``pastTense`` | ``Tense`` | (//he walked//) |
@@ -2766,7 +2725,7 @@ Main division:
===Utterances and imperatives=== ===Utterances and imperatives===
|| Fun | Type | Example || || Fun | Type | Example |
| ``mkUtt`` | ``Cl -> Utt`` | //he walks// | | ``mkUtt`` | ``Cl -> Utt`` | //he walks// |
| ``mkUtt`` | ``S -> Utt`` | //he didn't walk// | | ``mkUtt`` | ``S -> Utt`` | //he didn't walk// |
| ``mkUtt`` | ``QS -> Utt`` | //who didn't walk// | | ``mkUtt`` | ``QS -> Utt`` | //who didn't walk// |
@@ -2808,7 +2767,6 @@ some language.
5. Design your own domain grammar and implement it for some languages. 5. Design your own domain grammar and implement it for some languages.
#NEW
=Developing a GF Resource Grammar= =Developing a GF Resource Grammar=
@@ -2827,16 +2785,13 @@ The Assignment
==The principal module structure== ==The principal module structure==
#Syntax [syntax.jpg]
#SMALL
//solid = API, dashed = internal, ellipse = abstract+concrete, rectangle = resource/instance, diamond = interface, green = given, blue = mechanical, red = to do// //solid = API, dashed = internal, ellipse = abstract+concrete, rectangle = resource/instance, diamond = interface, green = given, blue = mechanical, red = to do//
#NORMAL
===Division of labour=== ===Division of labour===
#SMALL
Written by the resource grammarian: Written by the resource grammarian:
- concrete of the row from ``Structural`` to ``Verb`` - concrete of the row from ``Structural`` to ``Verb``
- concrete of ``Cat`` and ``Lexicon`` - concrete of ``Cat`` and ``Lexicon``
@@ -2850,7 +2805,6 @@ Already given or derived mechanically:
- ``Constructors``, ``Syntax``, ``Try`` - ``Constructors``, ``Syntax``, ``Try``
#NORMAL
===Roles of modules: Library API=== ===Roles of modules: Library API===
@@ -2886,7 +2840,7 @@ Already given or derived mechanically:
===Roles of modules: phrase categories=== ===Roles of modules: phrase categories===
|| module | scope | value categories || || module | scope | value categories |
| ``Adjective`` | adjectives | ``AP`` | ``Adjective`` | adjectives | ``AP``
| ``Adverb`` | adverbial phrases | ``AdN, Adv`` | ``Adverb`` | adverbial phrases | ``AdN, Adv``
| ``Conjunction`` | coordination | ``Adv, AP, NP, RS, S`` | ``Conjunction`` | coordination | ``Adv, AP, NP, RS, S``
@@ -2925,7 +2879,6 @@ This works even for mutual dependencies of categories:
===Auxiliary modules=== ===Auxiliary modules===
#SMALL
``resource`` modules provided by the library: ``resource`` modules provided by the library:
- ``Prelude`` and ``Predef``: string operations, booleans - ``Prelude`` and ``Predef``: string operations, booleans
- ``Coordination``: generic formation of list conjunctions - ``Coordination``: generic formation of list conjunctions
@@ -2937,7 +2890,6 @@ This works even for mutual dependencies of categories:
- ``Morpho``, ``Phono``,...: possible division of ``Res`` to more modules - ``Morpho``, ``Phono``,...: possible division of ``Res`` to more modules
#NORMAL
===Dependencies=== ===Dependencies===
@@ -2974,7 +2926,6 @@ The Golden Rule: //Whenever you find yourself programming by copy and paste, wri
===Functors in the Resource Grammar Library=== ===Functors in the Resource Grammar Library===
#SMALL
Used in families of languages Used in families of languages
- Romance: Catalan, French, Italian, Spanish - Romance: Catalan, French, Italian, Spanish
@@ -2988,7 +2939,6 @@ Structure:
- ``Idiom``, ``Structural``, ``Lexicon``, ``Paradigms`` are ordinary modules - ``Idiom``, ``Structural``, ``Lexicon``, ``Paradigms`` are ordinary modules
#NORMAL
===Example: DiffRomance=== ===Example: DiffRomance===
@@ -2998,19 +2948,18 @@ are of course different, in ways we haven't tried to formalize.
In syntax, there are just eight parameters that fundamentally In syntax, there are just eight parameters that fundamentally
make the difference: make the difference:
#SMALL
Prepositions that fuse with the article Prepositions that fuse with the article
(Fre, Spa //de//, //a//; Ita also //con//, //da//, //in//, //su//). (Fre, Spa //de//, //a//; Ita also //con//, //da//, //in//, //su//).
``` ```
param Prepos ; param Prepos ;
``` ```
Which types of verbs exist, in terms of auxiliaries. Which types of verbs exist, in terms of auxiliaries.
(Fre, Ita //avoir//, //être//, and refl; Spa only //haber// and refl). (Fre, Ita //avoir//, //être//, and refl; Spa only //haber// and refl).
``` ```
param VType ; param VType ;
``` ```
Derivatively, if/when the participle agrees to the subject. Derivatively, if/when the participle agrees to the subject.
(Fre //elle est partie//, Ita //lei è partita//, Spa not) (Fre //elle est partie//, Ita //lei è partita//, Spa not)
``` ```
oper partAgr : VType -> VPAgr ; oper partAgr : VType -> VPAgr ;
``` ```
@@ -3040,7 +2989,6 @@ To render imperatives (with their clitics etc).
oper mkImperative : Bool -> Person -> VPC -> {s : Polarity => AAgr => Str} ; oper mkImperative : Bool -> Person -> VPC -> {s : Polarity => AAgr => Str} ;
``` ```
#NORMAL
===Pros and cons of functors=== ===Pros and cons of functors===
@@ -3079,9 +3027,8 @@ Semitic: Arabic, Hebrew, Maltese probably independent
==Effort statistics, completed languages== ==Effort statistics, completed languages==
#SMALL
|| language | syntax | morpho | lex | total | months | started || || language | syntax | morpho | lex | total | months | started |
| //common// | 413 | - | - | 413 | 2 | 2001 | //common// | 413 | - | - | 413 | 2 | 2001
| //abstract// | 729 | - | 468 | 1197 | 24 | 2001 | //abstract// | 729 | - | 468 | 1197 | 24 | 2001
| Bulgarian | 1200 | 2329 | 502 | 4031 | 3 | 2008 | Bulgarian | 1200 | 2329 | 502 | 4031 | 3 | 2008
@@ -3103,7 +3050,6 @@ Semitic: Arabic, Hebrew, Maltese probably independent
Lines of source code in April 2009, rough estimates of person months. Lines of source code in April 2009, rough estimates of person months.
* = generated code. * = generated code.
#NORMAL
==How to start building a language, e.g. Marathi== ==How to start building a language, e.g. Marathi==
@@ -3126,7 +3072,6 @@ Lines of source code in April 2009, rough estimates of person months.
===Suggested order for proceeding with a language=== ===Suggested order for proceeding with a language===
#SMALL
1. ``ResMar``: parameter types needed for nouns 1. ``ResMar``: parameter types needed for nouns
@@ -3148,7 +3093,6 @@ Lines of source code in April 2009, rough estimates of person months.
10. ``SentenceMar``: ``lin PredVP`` 10. ``SentenceMar``: ``lin PredVP``
#NORMAL
===Character encoding for non-ASCII languages=== ===Character encoding for non-ASCII languages===
@@ -3198,7 +3142,6 @@ Use the GF command ``gr -cat=C | l -table`` to test category C
===Regression testing with a treebank=== ===Regression testing with a treebank===
#SMALL
Build and maintain a **treebank**: a set of trees with their linearizations: Build and maintain a **treebank**: a set of trees with their linearizations:
@@ -3219,12 +3162,10 @@ correcting the Marathi linearizations.
5. Rerun (2.) and (4.) after every change in concrete syntax; extend the tree set 5. Rerun (2.) and (4.) after every change in concrete syntax; extend the tree set
and the gold standard after every new implemented function. and the gold standard after every new implemented function.
#NORMAL
===Sources=== ===Sources===
#SMALL
A //good// grammar book A //good// grammar book
- lots of inflection paradigms - lots of inflection paradigms
- reasonable chapter on syntax - reasonable chapter on syntax
@@ -3241,7 +3182,6 @@ Wikipedia article on the language
Google as "gold standard": is it //rucola// or //ruccola//? Google as "gold standard": is it //rucola// or //ruccola//?
Google translation for suggestions (can't be trusted, though!) Google translation for suggestions (can't be trusted, though!)
#NORMAL
===Compiling the library=== ===Compiling the library===
@@ -3267,5 +3207,3 @@ Use ``runghc Make lang api langs=Mar`` to compile just the language ``Mar``.
4. Send us: your source files and a treebank of 100 trees with linearizations 4. Send us: your source files and a treebank of 100 trees with linearizations
in English and your target language. These linearizations should be correct, in English and your target language. These linearizations should be correct,
and directly generated from your grammar implementation. and directly generated from your grammar implementation.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,15 +0,0 @@
\documentclass[a4paper,landscape]{slides}
\usepackage[latin1]{inputenc}
%\usepackage[utf8]{inputenc}
\newcommand{\nnewslide}[1]{\newpage {\huge \textbf{#1} \\}\\}
\newcommand{\newslide}[1]{\newpage {\large \textbf{#1} \\}\\}
\newcommand{\snewslide}[1]{\newpage {\large \textbf{#1} \\}\\}
\newcommand{\bequ}{\begin{quote}}
\newcommand{\enqu}{\end{quote}}
\setlength{\topmargin}{-20mm}
\setlength{\oddsidemargin}{-8mm}
\setlength{\evensidemargin}{-8mm}
\setlength{\textwidth}{250mm}
\setlength{\textheight}{170mm}
%%%

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 28 KiB