a majour refactoring to support clitic pronouns

This commit is contained in:
Krasimir Angelov
2018-07-04 13:01:06 +02:00
parent 6fe595104c
commit 21961e39ba
16 changed files with 404 additions and 336 deletions
+71 -70
View File
@@ -4,85 +4,84 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
lin
DetCN det cn =
{ s = \\role => let nf = case <det.nn,det.spec> of {
<NNum Sg,Def> => case role of {
RSubj => NFSgDefNom ;
RVoc => NFVocative ;
_ => NF Sg Def
} ;
<NNum Sg,Indef> => case role of {
RVoc => NFVocative ;
_ => NF Sg Indef
} ;
<NNum Pl,Def> => NF Pl Def ;
<NNum Pl,Indef> => NF Pl Indef;
<NCountable,Def> => NF Pl det.spec ;
<NCountable,Indef> => NFPlCount
} ;
s = det.s ! True ! cn.g ! role ++ cn.s ! nf
in case role of {
RObj Dat => "íà" ++ s;
RObj WithPrep => case det.p of {
Pos => with_Word ++ s ;
Neg => "áåç" ++ s
} ;
_ => s
} ;
a = {gn = gennum cn.g (numnnum det.nn); p = P3} ;
p = det.p
{ s = \\role => let nf = case <det.nn,det.spec> of {
<NNum Sg,Def> => case role of {
RSubj => NFSgDefNom ;
RVoc => NFVocative ;
_ => NF Sg Def
} ;
<NNum Sg,Indef> => case role of {
RVoc => NFVocative ;
_ => NF Sg Indef
} ;
<NNum Pl,Def> => NF Pl Def ;
<NNum Pl,Indef> => NF Pl Indef;
<NCountable,Def> => NF Pl det.spec ;
<NCountable,Indef> => NFPlCount
} ;
s = det.s ! True ! cn.g ! role ++ cn.s ! nf
in case role of {
RObj c => linCase c det.p ++ s;
_ => s
} ;
gn = gennum cn.g (numnnum det.nn);
p = NounP3 det.p
} ;
DetNP det =
{ s = \\role => let s = det.s ! False ! ANeut ! role
in case role of {
RObj Dat => "íà" ++ s;
RObj WithPrep => with_Word ++ s;
_ => s
} ;
a = {gn = gennum ANeut (numnnum det.nn); p = P3} ;
p = det.p
{ s = \\role => let s = det.s ! False ! ANeut ! role
in case role of {
RObj c => linCase c det.p ++ s;
_ => s
} ;
gn = gennum ANeut (numnnum det.nn);
p = NounP3 det.p
} ;
UsePN pn = { s = table {
RObj Dat => "íà" ++ pn.s;
RObj WithPrep => with_Word ++ pn.s;
_ => pn.s
RObj c => linCase c Pos ++ pn.s;
_ => pn.s
} ;
a = {gn = GSg pn.g; p = P3} ;
p = Pos
gn = GSg pn.g ;
p = NounP3 Pos
} ;
UsePron p = {s = p.s; a=p.a; p=Pos} ;
UsePron p = p ;
PredetNP pred np = {
s = \\c => case c of {
RObj Dat => "íà";
RObj WithPrep => case np.p of {
Pos => with_Word ;
Neg => "áåç"
} ;
_ => ""
RObj c => linCase c (personPol np.p) ;
_ => ""
} ++
pred.s ! np.a.gn ++ np.s ! RObj Acc ;
a = np.a ;
p = np.p
pred.s ! np.gn ++ np.s ! RObj CPrep ;
gn = np.gn ;
p = NounP3 (personPol np.p)
} ;
PPartNP np v2 = {
s = \\c => np.s ! c ++ v2.s ! Perf ! VPassive (aform np.a.gn Indef c) ;
a = np.a ;
p = np.p
s = \\role => case role of {
RObj c => linCase c (personPol np.p) ++ np.s ! RObj CPrep ;
role => np.s ! role
} ++ v2.s ! Perf ! VPassive (aform np.gn Indef role) ;
gn = np.gn ;
p = NounP3 (personPol np.p)
} ;
AdvNP np adv = {
s = \\c => np.s ! c ++ adv.s ;
a = np.a ;
p = np.p
s = \\role => case role of {
RObj c => linCase c (personPol np.p) ++ np.s ! RObj CPrep ;
role => np.s ! role
} ++ adv.s ;
gn = np.gn ;
p = NounP3 (personPol np.p)
} ;
ExtAdvNP np adv = {
s = \\c => np.s ! c ++ bindComma ++ adv.s ;
a = np.a ;
p = np.p
s = \\role => case role of {
RObj c => linCase c (personPol np.p) ++ np.s ! RObj CPrep ;
role => np.s ! role
} ++ bindComma ++ adv.s ;
gn = np.gn ;
p = NounP3 (personPol np.p)
} ;
DetQuant quant num = {
@@ -160,13 +159,12 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
MassNP cn = {
s = table {
RVoc => cn.s ! NFVocative ;
RObj Dat => "íà" ++ cn.s ! (NF Sg Indef) ;
RObj WithPrep => with_Word ++ cn.s ! (NF Sg Indef);
_ => cn.s ! (NF Sg Indef)
RVoc => cn.s ! NFVocative ;
RObj c => linCase c Pos ++ cn.s ! (NF Sg Indef) ;
_ => cn.s ! (NF Sg Indef)
} ;
a = {gn = gennum cn.g Sg; p = P3} ;
p = Pos
gn = gennum cn.g Sg;
p = NounP3 Pos
} ;
UseN noun = noun ;
@@ -204,21 +202,24 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
PartNP cn np = {s = \\nf => cn.s ! nf ++ "îò" ++ np.s ! (RObj Acc); g = cn.g} ;
CountNP det np = {
s = \\role => let g = case np.a.gn of { -- this is lossy
s = \\role => let g = case np.gn of { -- this is lossy
GSg Masc => AMasc NonHuman ;
GSg Neut => ANeut ;
GSg Fem => AFem ;
GPl => ANeut
}
in det.s ! False ! g ! role ++ np.s ! (RObj Acc) ;
a = {gn = gennum ANeut (numnnum det.nn); p = P3} ;
p = Pos
gn = gennum ANeut (numnnum det.nn);
p = NounP3 Pos
} ;
RelNP np rs = {
s = \\r => np.s ! r ++ rs.s ! np.a ;
a = np.a ;
p = np.p
s = \\role => case role of {
RObj c => linCase c (personPol np.p) ++ np.s ! RObj CPrep ;
role => np.s ! role
} ++ rs.s ! personAgr np.gn np.p ;
gn = np.gn ;
p = NounP3 (personPol np.p)
} ;
AdjDAP dap ap = {s = \\sp,g,role => let g' = case g of {