forked from GitHub/gf-core
prodrop pronouns from Anna's grammar
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
concrete CatSlv of Cat = CommonX ** open ResSlv, (P=ParamX) in {
|
||||
concrete CatSlv of Cat = CommonX ** open ResSlv, (P=ParamX), Prelude in {
|
||||
|
||||
lincat
|
||||
-- Sentence
|
||||
@@ -18,7 +18,7 @@ lincat
|
||||
|
||||
-- Noun
|
||||
CN = {s : Species => Case => Number => Str; g : AGender} ;
|
||||
NP = {s : Case => Str ; a : Agr} ;
|
||||
NP = {s : Case => Str; a : Agr; isPron : Bool} ;
|
||||
|
||||
Pron = {s : Case => Str; poss : Gender => Case => Number => Str; a : Agr} ;
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
concrete ConjunctionSlv of Conjunction =
|
||||
CatSlv ** open ResSlv in {
|
||||
CatSlv ** open ResSlv, Prelude in {
|
||||
|
||||
lin
|
||||
ConjNP conj xs = {
|
||||
s = \\c => xs.s1 ! c ++ conj.s ++ xs.s2 ! c ;
|
||||
a = {g = xs.a.g; n = conjNumber conj.n xs.a.n; p = xs.a.p}
|
||||
a = {g = xs.a.g; n = conjNumber conj.n xs.a.n; p = xs.a.p} ;
|
||||
isPron = False
|
||||
} ;
|
||||
ConjAP conj xs = {
|
||||
s = \\sp,g,c,n => xs.s1 ! sp ! g ! c ! n ++ conj.s ++ xs.s2 ! sp ! g ! c ! n
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
concrete NounSlv of Noun = CatSlv ** open ResSlv in {
|
||||
concrete NounSlv of Noun = CatSlv ** open ResSlv,Prelude in {
|
||||
|
||||
lin
|
||||
DetCN det cn = {
|
||||
@@ -13,11 +13,21 @@ concrete NounSlv of Noun = CatSlv ** open ResSlv in {
|
||||
UseGen => Pl
|
||||
} ;
|
||||
p = P3
|
||||
}
|
||||
} ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
UsePN pn = {s = pn.s; a = {g=agender2gender pn.g; n=Sg; p=P3}} ;
|
||||
UsePron p = p ;
|
||||
UsePN pn = {
|
||||
s = pn.s;
|
||||
a = {g=agender2gender pn.g; n=Sg; p=P3};
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
UsePron p = {
|
||||
s = p.s;
|
||||
a = p.a;
|
||||
isPron = True
|
||||
} ;
|
||||
|
||||
DetQuant quant num = {
|
||||
s = \\g,c => quant.s ! g ! c ! (numAgr2num ! num.n) ++ num.s ! g ! c;
|
||||
@@ -27,7 +37,8 @@ concrete NounSlv of Noun = CatSlv ** open ResSlv in {
|
||||
|
||||
DetNP det = {
|
||||
s = det.s ! Masc ;
|
||||
a = {g=Masc; n=case det.n of {UseNum n=>n; UseGen=>Pl}; p=P3};
|
||||
a = {g=Masc; n=case det.n of {UseNum n=>n; UseGen=>Pl}; p=P3} ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
PossPron p = {
|
||||
@@ -54,7 +65,8 @@ concrete NounSlv of Noun = CatSlv ** open ResSlv in {
|
||||
|
||||
MassNP n = {
|
||||
s = \\c => n.s ! Indef ! c ! Sg ;
|
||||
a = {g=agender2gender n.g; n=Sg; p=P3}
|
||||
a = {g=agender2gender n.g; n=Sg; p=P3} ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
UseN n = {s = \\_ => n.s; g = n.g} ;
|
||||
|
||||
@@ -590,7 +590,8 @@ oper
|
||||
Loc => loc;
|
||||
Instr=>instr
|
||||
} ;
|
||||
a = {g=Neut; n=n; p=P3}
|
||||
a = {g=Neut; n=n; p=P3} ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
mkInterj : Str -> Interj =
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
resource ResSlv = open ParamX in {
|
||||
resource ResSlv = open ParamX, Prelude in {
|
||||
|
||||
param
|
||||
Case = Nom | Gen | Dat | Acc | Loc | Instr;
|
||||
@@ -53,11 +53,15 @@ oper
|
||||
Neg => table {Past => "ni"; _ => "ne"}
|
||||
} ;
|
||||
|
||||
predV : (VForm => Str) -> Tense => Polarity => Agr => Str =
|
||||
\v -> table {
|
||||
predV : Bool -> (VForm => Str) -> Tense => Polarity => Agr => Str =
|
||||
\ispron,v -> table {
|
||||
Pres => \\p,a => neg ! p ! Pres ++ v ! VPres a.n a.p ;
|
||||
Past => \\p,a => neg ! p ! Past + sem_V ! a.n ! a.p ++ v ! VPastPart a.g a.n ;
|
||||
Fut => \\p,a => neg ! p ! Fut ++ bom_V ! a.n ! a.p ++ v ! VPastPart a.g a.n ;
|
||||
Past => \\p,a => case <ispron,p> of {
|
||||
<True,Pos> => v ! VPastPart a.g a.n ++ sem_V ! a.n ! a.p ;
|
||||
<_ ,_ > => neg ! p ! Past + sem_V ! a.n ! a.p ++ v ! VPastPart a.g a.n } ;
|
||||
Fut => \\p,a => case <ispron,p> of {
|
||||
<True,Pos> => v ! VPastPart a.g a.n ++ bom_V ! a.n ! a.p ;
|
||||
<_ ,_ > => neg ! p ! Fut ++ bom_V ! a.n ! a.p ++ v ! VPastPart a.g a.n } ;
|
||||
Cond => \\p,a => neg ! p ! Cond ++ "bi" ++ v ! VPastPart a.g a.n
|
||||
} ;
|
||||
|
||||
@@ -103,10 +107,13 @@ oper
|
||||
s : Tense => Anteriority => Polarity => Str
|
||||
} ;
|
||||
|
||||
mkClause : Str -> Agr -> VP -> Clause =
|
||||
\subj,agr,vp -> {
|
||||
mkClause : Str -> Agr -> Bool -> VP -> Clause =
|
||||
\subj,agr,ispron,vp -> {
|
||||
s = \\t,a,p =>
|
||||
subj ++ predV vp.s ! t ! p ! agr ++ vp.s2 ! agr
|
||||
case ispron of {
|
||||
False => subj ++ predV ispron vp.s ! t ! p ! agr ++ vp.s2 ! agr ;
|
||||
True => predV ispron vp.s ! t ! p ! agr ++ vp.s2 ! agr
|
||||
}
|
||||
} ;
|
||||
|
||||
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> vp ** {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
concrete SentenceSlv of Sentence = CatSlv ** open Prelude, ResSlv in {
|
||||
|
||||
lin
|
||||
PredVP np vp = mkClause (np.s ! Nom) np.a vp ;
|
||||
PredVP np vp = mkClause (np.s ! Nom) np.a np.isPron vp ;
|
||||
|
||||
ImpVP vp = {
|
||||
s = \\pol,g,n => vp.s ! VImper2 n ++ vp.s2 ! {g=g; n=n; p=P2} ;
|
||||
|
||||
Reference in New Issue
Block a user