the AP now inflects by Person since it may contain an embedded VP

This commit is contained in:
Krasimir Angelov
2018-05-30 14:08:14 +02:00
parent 36f0220db3
commit 3815e753ae
10 changed files with 61 additions and 60 deletions

View File

@@ -4,24 +4,24 @@ concrete AdjectiveBul of Adjective = CatBul ** open ResBul, Prelude in {
lin
PositA a = {
s = \\aform => a.s ! aform ;
s = \\aform,_ => a.s ! aform ;
adv = a.adv ;
isPre = True
} ;
ComparA a np = {
s = \\aform => "ïî" ++ hyphen ++ a.s ! aform ++ "îò" ++ np.s ! RObj Acc ;
s = \\aform,_ => "ïî" ++ hyphen ++ a.s ! aform ++ "îò" ++ np.s ! RObj Acc ;
adv = "ïî" ++ hyphen ++ a.adv ++ "îò" ++ np.s ! RObj Acc ;
isPre = True
} ;
UseComparA a = {
s = \\aform => "ïî" ++ hyphen ++ a.s ! aform ;
s = \\aform,_ => "ïî" ++ hyphen ++ a.s ! aform ;
adv = "ïî" ++ hyphen ++ a.adv ;
isPre = True
} ;
AdjOrd ord = {
s = ord.s ;
s = \\aform,_ => ord.s ! aform ;
adv = ord.s ! ASg Neut Indef ;
isPre = True
} ;
@@ -30,43 +30,43 @@ concrete AdjectiveBul of Adjective = CatBul ** open ResBul, Prelude in {
---- just to make the API compile. AR 7/4/2010
CAdvAP ad ap np = {
s = \\a => ad.s ++ ap.s ! a ++ ad.sn ++ np.s ! RObj Acc ;
adv = ad.s ++ ap.adv ++ ad.sn ++ np.s ! RObj Acc ;
s = \\a,p => ad.s ++ ap.s ! a ! p ++ ad.sn ++ np.s ! RObj Acc ;
adv = ad.s ++ ap.adv ++ ad.sn ++ np.s ! RObj Acc ;
isPre = False
} ;
ComplA2 a np = {
s = \\aform => a.s ! aform ++ a.c2 ++ np.s ! RObj Acc ;
s = \\aform,p => a.s ! aform ++ a.c2 ++ np.s ! RObj Acc ;
adv = a.adv ++ a.c2 ++ np.s ! RObj Acc ;
isPre = False
} ;
ReflA2 a = {
s = \\aform => a.s ! aform ++ a.c2 ++ ["ñåáå ñè"] ;
s = \\aform,_ => a.s ! aform ++ a.c2 ++ ["ñåáå ñè"] ;
adv = a.adv ++ a.c2 ++ ["ñåáå ñè"] ;
isPre = False
} ;
SentAP ap sc = {
s = \\a => ap.s ! a ++ sc.s ;
adv = ap.adv ++ sc.s ;
s = \\a,p => ap.s ! a ! p ++ sc.s ! {gn=aform2gennum a; p=p} ;
adv = ap.adv ++ sc.s ! agrP3 (GSg Neut) ;
isPre = False
} ;
AdAP ada ap = {
s = \\a => ada.s ++ ap.s ! a ;
s = \\a,p => ada.s ++ ap.s ! a ! p ;
adv = ada.s ++ ap.adv ;
isPre = ap.isPre
} ;
UseA2 a = {
s = a.s ;
s = \\aform,p => a.s ! aform ;
adv = a.adv ;
isPre = True
} ;
AdvAP ap adv = {
s = \\aform => ap.s ! aform ++ adv.s ;
s = \\aform,p => ap.s ! aform ! p ++ adv.s ;
adv = ap.adv ++ adv.s;
isPre = False
} ;

View File

@@ -1,5 +1,5 @@
--# -coding=utf8
concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, Predef, (R = ParamX) in {
concrete CatBul of Cat = CommonX - [IAdv,CAdv,SC] ** open ResBul, Prelude, Predef, (R = ParamX) in {
lincat
-- Tensed/Untensed
@@ -40,12 +40,13 @@ concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, Predef,
-- Adjective
AP = {s : AForm => Str; adv : Str; isPre : Bool} ;
AP = {s : AForm => Person => Str; adv : Str; isPre : Bool} ;
-- Adjective
CAdv = {s : Str; sn : Str} ;
IAdv = {s : QForm => Str} ;
SC = {s : Agr => Str} ;
-- Noun
@@ -80,12 +81,12 @@ concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, Predef,
A = {s : AForm => Str; adv : Str} ;
A2 = {s : AForm => Str; adv : Str; c2 : Str} ;
N = {s : NForm => Str; rel : AForm => Str; g : AGender} ;
N2 = {s : NForm => Str; g : AGender} ** {c2 : Preposition} ;
N3 = {s : NForm => Str; g : AGender} ** {c2,c3 : Preposition} ;
PN = {s : Str; g : Gender} ;
lindef
SSlash = \s -> {s = \\_ => s; c2 = {s=""; c=Acc}};
ClSlash = \s -> {s = \\_,_,_,_,_ => s; c2 = {s=""; c=Acc}};

View File

@@ -30,8 +30,8 @@ concrete ConjunctionBul of Conjunction =
} ;
ConjAP conj ss = {
s = \\aform => conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!aform;
adv = conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.adv!conj.distr!conj.conj;
s = \\aform,p => conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!aform!p;
adv = conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.adv!conj.distr!conj.conj;
isPre = ss.isPre
} ;
@@ -65,12 +65,12 @@ concrete ConjunctionBul of Conjunction =
a = conjAgr xs.a x.a} ;
BaseAP x y =
{s = \\d,t,aform=>x.s!aform++linCoord!t++y.s!aform;
adv= \\d,t =>x.adv ++linCoord!t++y.adv;
{s = \\d,t,aform,p => x.s!aform!p++linCoord!t++y.s!aform!p;
adv= \\d,t => x.adv ++linCoord!t++y.adv;
isPre = andB x.isPre y.isPre} ;
ConsAP x xs =
{s = \\d,t,aform=>x.s!aform++(linCoordSep comma)!d!t++xs.s!d!t!aform;
adv= \\d,t =>x.adv ++(linCoordSep comma)!d!t++xs.adv!d!t;
{s = \\d,t,aform,p =>x.s!aform!p++(linCoordSep comma)!d!t++xs.s!d!t!aform!p;
adv= \\d,t =>x.adv ++(linCoordSep comma)!d!t++xs.adv!d!t;
isPre = andB x.isPre xs.isPre} ;
BaseRS x y =
@@ -91,7 +91,7 @@ concrete ConjunctionBul of Conjunction =
[AdV] = {s : Bool => Ints 2 => Str} ;
[IAdv] = {s : Bool => Ints 2 => QForm => Str} ;
[NP] = {s : Bool => Ints 2 => Role => Str; a : Agr} ;
[AP] = {s : Bool => Ints 2 => AForm => Str; adv : Bool => Ints 2 => Str; isPre : Bool} ;
[AP] = {s : Bool => Ints 2 => AForm => Person => Str; adv : Bool => Ints 2 => Str; isPre : Bool} ;
[RS] = {s : Bool => Ints 2 => Agr => Str} ;
[CN] = {s : Bool => Ints 2 => NForm => Str; g : AGender} ;

View File

@@ -32,7 +32,7 @@ lin
is_right_VP = mkVP (mkA084 "верен") ;
is_wrong_VP = mkVP (mkA079 "грешен") ;
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
weather_adjCl a = R.mkClause (a.s ! R.ASg R.Masc R.Indef) {gn=R.GSg R.Masc; p=R.P3} R.Pos (R.insertObj (\\_=>"") R.Pos (R.predV R.verbBe)) ;
weather_adjCl a = R.mkClause (a.s ! R.ASg R.Masc R.Indef ! R.P3) {gn=R.GSg R.Masc; p=R.P3} R.Pos (R.insertObj (\\_=>"") R.Pos (R.predV R.verbBe)) ;
lin
weekdayPunctualAdv w = SyntaxBul.mkAdv in_Prep (mkNP w) ; -- on Sunday

View File

@@ -17,32 +17,32 @@ lin
PositAdVAdj a = {s = a.adv} ;
PresPartAP vp =
let ap : AForm => Str
= \\aform => vp.ad.s ++
vp.s ! Imperf ! VPresPart aform ++
case vp.vtype of {
VMedial c => reflClitics ! c;
_ => []
} ++
vp.compl ! {gn=aform2gennum aform; p=P3} ;
in {s = ap; adv = ap ! (ASg Neut Indef); isPre = True} ;
let ap : AForm => Person => Str
= \\aform,p => vp.ad.s ++
vp.s ! Imperf ! VPresPart aform ++
case vp.vtype of {
VMedial c => reflClitics ! c;
_ => []
} ++
vp.compl ! {gn=aform2gennum aform; p=p} ;
in {s = ap; adv = ap ! (ASg Neut Indef) ! P3; isPre = True} ;
PastPartAP vp =
let ap : AForm => Str
= \\aform => vp.ad.s ++
vp.s ! Perf ! VPassive aform ++
vp.compl1 ! {gn=aform2gennum aform; p=P3} ++
vp.compl2 ! {gn=aform2gennum aform; p=P3}
in {s = ap; adv = ap ! ASg Neut Indef; isPre = True} ;
let ap : AForm => Person => Str
= \\aform,p => vp.ad.s ++
vp.s ! Perf ! VPassive aform ++
vp.compl1 ! {gn=aform2gennum aform; p=p} ++
vp.compl2 ! {gn=aform2gennum aform; p=p}
in {s = ap; adv = ap ! ASg Neut Indef ! P3; isPre = True} ;
PastPartAgentAP vp np =
let ap : AForm => Str
= \\aform => vp.ad.s ++
vp.s ! Perf ! VPassive aform ++
vp.compl1 ! {gn=aform2gennum aform; p=P3} ++
vp.compl2 ! {gn=aform2gennum aform; p=P3} ++
"от" ++ np.s ! RObj Acc
in {s = ap; adv = ap ! ASg Neut Indef; isPre = False} ;
let ap : AForm => Person => Str
= \\aform,p => vp.ad.s ++
vp.s ! Perf ! VPassive aform ++
vp.compl1 ! {gn=aform2gennum aform; p=p} ++
vp.compl2 ! {gn=aform2gennum aform; p=p} ++
"от" ++ np.s ! RObj Acc
in {s = ap; adv = ap ! ASg Neut Indef ! P3; isPre = False} ;
}

View File

@@ -15,7 +15,7 @@ concrete GrammarBul of Grammar =
TextBul,
StructuralBul,
IdiomBul,
TenseX - [CAdv,IAdv]
TenseX - [CAdv,IAdv,SC]
** {
flags coding=cp1251 ;

View File

@@ -169,13 +169,13 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
AdjCN ap cn = {
s = \\nf => case ap.isPre of {
True => (ap.s ! nform2aform nf cn.g) ++ (cn.s ! (indefNForm nf)) ;
False => (cn.s ! nf) ++ (ap.s ! nform2aform (indefNForm nf) cn.g)
True => (ap.s ! nform2aform nf cn.g ! P3) ++ (cn.s ! (indefNForm nf)) ;
False => (cn.s ! nf) ++ (ap.s ! nform2aform (indefNForm nf) cn.g ! P3)
} ;
g = cn.g
} ;
RelCN cn rs = {
s = \\nf => cn.s ! nf ++ rs.s ! {gn=gennum cn.g (numNForm nf); p=P3} ;
s = \\nf => cn.s ! nf ++ rs.s ! agrP3 (gennum cn.g (numNForm nf)) ;
g = cn.g
} ;
AdvCN cn ad = {
@@ -183,7 +183,7 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
g = cn.g
} ;
SentCN cn sc = {s = \\nf => cn.s ! nf ++ sc.s; g=ANeut} ;
SentCN cn sc = {s = \\nf => cn.s ! nf ++ sc.s ! agrP3 (gennum cn.g (numNForm nf)); g=cn.g} ;
ApposCN cn np = {s = \\nf => cn.s ! nf ++ np.s ! RSubj; g=cn.g} ;

View File

@@ -19,7 +19,7 @@ concrete PhraseBul of Phrase = CatBul ** open Prelude, ResBul in {
UttAdv adv = adv ;
UttCN n = {s = n.s ! NF Sg Indef} ;
UttCard n = {s = n.s ! CFNeut Indef} ;
UttAP ap = {s = ap.s ! ASg Masc Indef} ;
UttAP ap = {s = ap.s ! ASg Masc Indef ! P3} ;
UttInterj i = i ;
NoPConj = {s = []} ;

View File

@@ -11,7 +11,7 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in {
VMedial _ => RSubj ;
VPhrasal c => RObj c})) np.a np.p vp ;
PredSCVP sc vp = mkClause sc.s {gn=GSg Masc; p=P3} Pos vp ;
PredSCVP sc vp = let agr = {gn=GSg Masc; p=P3} in mkClause (sc.s ! agr) agr Pos vp ;
ImpVP vp = {
s = \\p,gn =>
@@ -49,9 +49,9 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in {
c2 = slash.c2
} ;
EmbedS s = {s = comma ++ "֌" ++ s.s} ;
EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = daComplex Simul Pos vp ! Perf ! {gn=GSg Masc; p=P1}} ;
EmbedS s = {s = \\_ => comma ++ "֌" ++ s.s} ;
EmbedQS qs = {s = \\_ => qs.s ! QIndir} ;
EmbedVP vp = {s = \\agr => daComplex Simul Pos vp ! Perf ! agr} ;
UseCl t p cl = {
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! Main

View File

@@ -27,11 +27,11 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in {
ComplVQ v q = insertObj (\\_ => q.s ! QDir) Pos (predV v) ;
ComplVA v ap =
insertObj (\\agr => ap.s ! aform agr.gn Indef (RObj Acc)) Pos (predV v) ;
insertObj (\\agr => ap.s ! aform agr.gn Indef (RObj Acc) ! agr.p) Pos (predV v) ;
SlashV2A v ap =
insertSlashObj2 (\\a => ap.s ! aform a.gn Indef (RObj Acc)) Pos (slashV v v.c2) ;
insertSlashObj2 (\\a => ap.s ! aform a.gn Indef (RObj Acc) ! a.p) Pos (slashV v v.c2) ;
-- test: I saw a boy to whom she said that they are here
SlashV2S v s = insertSlashObj2 (\\_ => comma ++ "֌" ++ s.s) Pos (slashV v v.c2) ;
@@ -110,7 +110,7 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in {
PassV2 v = insertObj (\\a => v.s ! Perf ! VPassive (aform a.gn Indef (RObj Acc))) Pos (predV verbBe) ;
CompAP ap = {s = \\agr => ap.s ! aform agr.gn Indef (RObj Acc); p = Pos} ;
CompAP ap = {s = \\agr => ap.s ! aform agr.gn Indef (RObj Acc) ! agr.p; p = Pos} ;
CompNP np = {s = \\_ => np.s ! RObj Acc; p = np.p} ;
CompAdv a = {s = \\_ => a.s; p = Pos} ;
CompCN cn = {s = \\agr => cn.s ! (NF (numGenNum agr.gn) Indef); p = Pos} ;