re(moved) unused/non-lab files

This commit is contained in:
Arianna Masciolini
2025-03-26 15:10:59 +01:00
parent 1a184f6937
commit 32612a7bf7
44 changed files with 3 additions and 2343 deletions

View File

@@ -1,11 +1,11 @@
# Lab 1: Multilingual generation and translation
In this lab, you will implement the concrete syntax of a grammar for a language of your choice.
The abstract syntax is given in the directory [`../grammar/abstract/`](../grammar/abstract/) and an example concrete syntax for English can be found in [`../grammar/english/`](../grammar/english/).
The abstract syntax is given in the directory [`grammar/abstract/`](grammar/abstract/) and an example concrete syntax for English can be found in [`grammar/english/`](grammar/english/).
## Part 1: setup and lexicon
1. Create a subfolder in [`../grammar/`](../grammar/) for your language of choice
2. Copy the contents of [`../grammar/english/`](../grammar/english/) to your new folder and apply the necessary renamings (i.e. replace all occurrences of `Eng` with the new language code)
1. Create a subfolder in [`grammar/`](grammar/) for your language of choice
2. Copy the contents of [`grammar/english/`](grammar/english/) to your new folder and apply the necessary renamings (i.e. replace all occurrences of `Eng` with the new language code)
3. Translate the words in lexicon part of `MicroLangXxx`
4. Test your new concrete syntax by generating a few random trees in the GF interpreter. When you linearize them, you should see sentences in a mixture of English and your chosen language. To do this you can use the commands
- `i MicroLangXxx.gf` to [import](https://www.grammaticalframework.org/doc/gf-shell-reference.html#toc18) the grammar

View File

@@ -1,35 +0,0 @@
abstract Intro = {
cat
S ;
NP ;
VP ;
CN ;
Det ;
Pron ;
Subj ;
N ;
A ;
V2 ;
Adv ;
fun
PredVP : NP -> VP -> S ;
AdvS : S -> Adv -> S ;
ComplV2 : V2 -> NP -> VP ;
DetCN : Det -> CN -> NP ;
UsePron : Pron -> NP ;
AdjCN : A -> CN -> CN ;
UseN : N -> CN ;
SubjS : Subj -> S -> Adv ;
the_Det : Det ;
we_Pron : Pron ;
because_Subj : Subj ;
cat_N : N ;
black_A : A ;
see_V2 : V2 ;
now_Adv : Adv ;
}

View File

@@ -1,39 +0,0 @@
concrete IntroEng of Intro = {
lincat
S = Str ;
NP = {s : Case => Str ; a : Agr} ;
VP = Agr => Str ;
CN = Str ;
Det = Str ;
Pron = {s : Case => Str ; a : Agr} ;
Subj = Str ;
N = Str ;
A = Str ;
V2 = Agr => Str ;
Adv = Str ;
lin
PredVP np vp = np.s ! Nom ++ vp ! np.a ;
AdvS s adv = s ++ adv ;
ComplV2 v2 np = table {a => v2 ! a ++ np.s ! Acc} ;
DetCN det cn = {s = table {_ => det ++ cn} ; a = SgP3} ;
UsePron pron = pron ;
AdjCN a cn = a ++ cn ;
UseN n = n ;
SubjS subj s = subj ++ s ;
the_Det = "the" ;
we_Pron = {s = table {Nom => "we" ; Acc => "us"} ; a = Other} ;
because_Subj = "because" ;
cat_N = "cat" ;
black_A = "black" ;
see_V2 = table {SgP3 => "sees" ; Other => "see"} ;
now_Adv = "now" ;
param
Case = Nom | Acc ;
Agr = SgP3 | Other ;
}

View File

@@ -1,43 +0,0 @@
concrete IntroFre of Intro = {
lincat
S = Str ;
NP = {s : Case => Str ; a : Agr ; t : NPType} ;
VP = Agr => Str ;
CN = Str ;
Det = Str ;
Pron = {s : Case => Str ; a : Agr} ;
Subj = Str ;
N = Str ;
A = Str ;
V2 = Agr => Str ;
Adv = Str ;
lin
PredVP np vp = np.s ! Nom ++ vp ! np.a ;
AdvS s adv = s ++ adv ;
ComplV2 v2 np = case np.t of {
NPPron => table {a => np.s ! Acc ++ v2 ! a} ;
NPOther => table {a => v2 ! a ++ np.s ! Acc}
} ;
DetCN det cn = {s = table {_ => det ++ cn} ; a = SgP3 ; t = NPOther} ;
UsePron pron = pron ** {t = NPPron} ;
AdjCN a cn = cn ++ a ;
UseN n = n ;
SubjS subj s = subj ++ s ;
the_Det = "le" ;
we_Pron = {s = table {Nom => "nous" ; Acc => "nous"} ; a = Other} ;
because_Subj = "parce que" ;
cat_N = "chat" ;
black_A = "noir" ;
see_V2 = table {SgP3 => "voit" ; Other => "voyons"} ;
now_Adv = "maintenant" ;
param
Case = Nom | Acc ;
Agr = SgP3 | Other ;
NPType = NPPron | NPOther ;
}

View File

@@ -1,37 +0,0 @@
-- a tiny context-free grammar for English
-- subcategories with _ in them are an unscalable hack
-- combination rules
S ::= NP_subj_3 VP_3 | NP_subj VP | S Adv ;
VP ::= V2 NP_obj ;
VP_3 ::= V2_3 NP_obj ;
NP_subj_3 ::= Det CN | Pron_subj_3 ;
NP_subj ::= Pron_subj ;
NP_obj ::= Det CN | Pron_obj ;
CN ::= A N ;
Adv ::= Subj S ;
-- structural words
Det ::= "the" ;
Pron_subj ::= "we" ;
Pron_obj ::= "us" ;
Subj ::= "because" ;
-- content words
N ::= "cat" ;
A ::= "black" ;
V2_3 ::= "sees" ;
V2 ::= "see" ;
Adv ::= "now" ;