1
0
forked from GitHub/gf-rgl

(Som) WIP: Passive.

This commit is contained in:
Inari Listenmaa
2019-06-10 15:57:23 +02:00
parent 8c6be2e7b2
commit 7a545c25f1
6 changed files with 56 additions and 30 deletions
+16 -11
View File
@@ -8,20 +8,25 @@ lin
--2 Clauses
-- : NP -> VP -> Cl
PredVP np vps = let vp = complSlash vps in {
s = \\t,a,p =>
let pred : {fin : Str ; inf : Str} = vf t a p np.a vp ;
subj : Str = if_then_Str np.isPron [] (np.s ! Nom) ;
obj : {p1,p2 : Str} = vp.comp ! np.a ;
PredVP np vps =
let vp = case vps.c2 of {
passive => complSlash (insertComp vps np) ;
_ => complSlash vps } ;
subj = case vps.c2 of {passive => impersNP ; _ => np} ;
in { s = \\t,a,p =>
let pred : {fin : Str ; inf : Str} = vf t a p subj.a vp ;
subjnoun : Str = if_then_Str np.isPron [] (subj.s ! Nom) ;
subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) [] ;
obj : {p1,p2 : Str} = vp.comp ! subj.a ;
stm : Str =
case <p,vp.isPred,np.a> of {
<Pos,True,Sg3 _> => "waa" ;
case <p,vp.isPred,subj.a> of {
<Pos,True,Sg3 _|Impers> => "waa" ;
-- _ => stmarker ! np.a ! b } -- marker+pronoun contract
_ => case <np.isPron,p> of {
<True,Pos> => "waa" ++ np.s ! Nom ; -- to force some string from NP to show in the tree
<True,Neg> => "ma" ++ np.s ! Nom ;
<False> => stmarkerNoContr ! np.a ! p }} ;
in subj -- subject if it's a noun
<True,Pos> => "waa" ++ subjpron ; -- to force some string from NP to show in the tree
<True,Neg> => "ma" ++ subjpron ;
<False> => stmarkerNoContr ! subj.a ! p }} ;
in subjnoun -- subject if it's a noun
++ obj.p1 -- object if it's a noun
++ stm -- sentence type marker + possible subj. pronoun
++ vp.adv ---- TODO word order