lecture 2 examples

This commit is contained in:
Aarne Ranta
2026-04-01 12:04:05 +02:00
parent c0bc9c85f2
commit 14ece60235
3 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
abstract Nano = {
cat
S ; NP ; VP ; CN ;
Det ; Pron ; A ; N ; V2 ;
fun
PredVPS : NP -> VP -> S ;
ComplV2 : V2 -> NP -> VP ;
DetCN : Det -> CN -> NP ;
AdjCN : A -> CN -> CN ;
UseCN : N -> CN ;
UsePron : Pron -> NP ;
the_Det : Det ;
black_A : A ;
cat_N : N ;
see_V2 : V2 ;
we_Pron : Pron ;
}

View File

@@ -0,0 +1,33 @@
concrete NanoEng of Nano = {
lincat
S = Str ;
NP, Pron = {s : Case => Str ; n : Number} ;
VP, V2 = Number => Str ;
CN, Det = Str ;
A, N = Str ;
lin
PredVPS np vp = np.s ! Nom ++ vp ! np.n ;
ComplV2 v2 np = table {n => v2 ! n ++ np.s ! Acc} ;
DetCN det cn =
{s = table {c => det ++ cn} ; n = Sg} ;
AdjCN a cn = a ++ cn ;
UseCN n = n ;
UsePron pron = pron ;
the_Det = "the" ;
black_A = "black" ;
cat_N = "cat" ;
see_V2 =
table {Sg => "sees" ; Pl => "see"} ;
we_Pron = {
s = table {Nom => "we" ; Acc => "us"} ;
n = Pl
} ;
param
Number = Sg | Pl ;
Case = Nom | Acc ;
}

View File

@@ -0,0 +1,21 @@
concrete NanoIta of Nano = {
lincat
S, NP, VP, CN,
Det, Pron, A, N, V2 = Str ;
lin
PredVPS np vp = np ++ vp ;
ComplV2 v2 np = np ++ v2 ;
DetCN det cn = det ++ cn ;
AdjCN a cn = cn ++ a ;
UseCN n = n ;
UsePron pron = pron ;
the_Det = "il" ;
black_A = "nero" ;
cat_N = "gatto" ;
see_V2 = "vede" ;
we_Pron = "ci" ;
}