diff --git a/lectures/README.md b/lectures/README.md new file mode 100644 index 0000000..3137f22 --- /dev/null +++ b/lectures/README.md @@ -0,0 +1,31 @@ +# Computations Syntax Lectures: Outline + +## Lecture 1 + +Coursenotes: Chapter 1 + +Participants' native languages: +Chinese (2), Dutch, English, Finnish, French (2), Greek, Hebrew, Italian (3), +Korean, Persian (2), Polish, Portuguese, Romanian (3), Russian, Spanish, Swedish (2), +Swiss German, West-Assyrian - 24 students, 17 languages + 2 teachers, 1 more language + +Formal grammar is no more expected to match natural language exactly +- analysis: should be wider than the language (we will use UD) +- generation: should be contained in the language (we will use GF) +- in both formats, we aim to use universal concepts for many languages + +Phrase structure grammars, context-free = BNF, grammar rules, trees +- example: [english.cf](lecture-01/english.cf) +- testing grammars in GF: import, generate_random, parse, linearize, visualize_parse, help + + +GF grammars: dividing .cf into abstract and concrete .gf +- example: [Intro*.gf](lecture-01/) +- forms of rules: cat, fun, lincat, lin +- word order switch English-Italian +- to solve next time: + +Experiments in GF: +- https://cloud.grammaticalframework.org/minibar/minibar.html +- Grammar: ResourceDemo, Startcat: S + diff --git a/lectures/lecture-01/Intro.gf b/lectures/lecture-01/Intro.gf new file mode 100644 index 0000000..47a2ce6 --- /dev/null +++ b/lectures/lecture-01/Intro.gf @@ -0,0 +1,30 @@ +abstract Intro = { + +cat + S ; + NP ; + VP ; + CN ; + AP ; + Det ; + Pron ; + N ; + A ; + V2 ; + +fun + PredVP : NP -> VP -> S ; + ComplV2 : V2 -> NP -> VP ; + DetCN : Det -> CN -> NP ; + AdjCN : AP -> CN -> CN ; + UseN : N -> CN ; + UseA : A -> AP ; + UsePron : Pron -> NP ; + + the_Det : Det ; + black_A : A ; + cat_N : N ; + see_V2 : V2 ; + we_Pron : Pron ; + +} \ No newline at end of file diff --git a/lectures/lecture-01/IntroEng.gf b/lectures/lecture-01/IntroEng.gf new file mode 100644 index 0000000..759ff24 --- /dev/null +++ b/lectures/lecture-01/IntroEng.gf @@ -0,0 +1,30 @@ +concrete IntroEng of Intro = { + +lincat + S = Str ; + NP = Str ; + VP = Str ; + CN = Str ; + AP = Str ; + Det = Str ; + Pron = Str ; + N = Str ; + A = Str ; + V2 = Str ; + +lin + PredVP np vp = np ++ vp ; + ComplV2 v2 np = v2 ++ np ; + DetCN det cn = det ++ cn ; + AdjCN ap cn = ap ++ cn ; + UseN n = n ; + UseA a = a ; + UsePron pron = pron ; + + the_Det = "the" ; + black_A = "black" ; + cat_N = "cat" ; + see_V2 = "sees" ; + we_Pron = "us" ; + +} \ No newline at end of file diff --git a/lectures/lecture-01/IntroIta.gf b/lectures/lecture-01/IntroIta.gf new file mode 100644 index 0000000..d3e6530 --- /dev/null +++ b/lectures/lecture-01/IntroIta.gf @@ -0,0 +1,30 @@ +concrete IntroIta of Intro = { + +lincat + S = Str ; + NP = Str ; + VP = Str ; + CN = Str ; + AP = Str ; + Det = Str ; + Pron = Str ; + N = Str ; + A = Str ; + V2 = Str ; + +lin + PredVP np vp = np ++ vp ; + ComplV2 v2 np = np ++ v2 ; + DetCN det cn = det ++ cn ; + AdjCN ap cn = cn ++ ap ; + UseN n = n ; + UseA a = a ; + UsePron pron = pron ; + + the_Det = "il" ; + black_A = "nero" ; + cat_N = "gatto" ; + see_V2 = "vede" ; + we_Pron = "ci" ; + +} \ No newline at end of file diff --git a/lectures/lecture-01/english.cf b/lectures/lecture-01/english.cf index f649278..03c5123 100644 --- a/lectures/lecture-01/english.cf +++ b/lectures/lecture-01/english.cf @@ -1,14 +1,14 @@ S ::= NP VP ; NP ::= Det CN ; NP ::= Pron ; -CN ::= N ; CN ::= AP CN ; +CN ::= N ; VP ::= V2 NP ; AP ::= A ; Det ::= "the" ; -Pron ::= "us" ; N ::= "cat" ; A ::= "black" ; V2 ::= "sees" ; +Pron ::= "us" ;