(Ara) replace Agr by AAgr in Obj

This commit is contained in:
Inari Listenmaa
2018-12-18 16:30:57 +01:00
parent 038cb2536f
commit ef261ac4d2
3 changed files with 15 additions and 8 deletions
+10 -5
View File
@@ -1388,9 +1388,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
isDecl : Bool
};
Agr = { pgn : PerGenNum; isPron : Bool} ;
AAgr = { g : Gender ; n : Number} ;
Agr = {pgn : PerGenNum; isPron : Bool} ;
AgrLite = {gn : AAgr ; isPron : Bool} ; --used in ImpersCl
AAgr = {g : Gender ; n : Number} ;
agrLite : Agr -> AgrLite = \a -> a ** {gn = pgn2gn a.pgn} ;
-----------------------------------------------------------------------------
-- NP, Pron
@@ -1481,6 +1483,9 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
Per3 Masc Pl => theyMasc_Pron
} ;
gn2pron : AAgr -> NP = \gn ->
pgn2pron (gn2pgn gn) ;
pron2np : NP -> NP = \np -> np ** {
a = np.a ** {isPron=False} -- hack, sometimes we *don't* want prodrop
} ;
@@ -1694,20 +1699,20 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
Obj : Type = {
s : Str ;
a : Agr -- default Agr in a VP without real Obj is Per3 Masc Sg.
a : AgrLite -- default Agr in a VP without real Obj is Per3 Masc Sg.
}; -- need isPron for word order in predVP, and pgn for ImpersCl
Subj : Type = {s : Case => Str ; isPron : Bool} ;
np2subj : NP -> Subj = \np -> np ** {isPron = np.a.isPron} ;
subj2np : Subj -> NP = \su -> su ** {a = {pgn = emptyNP.a.pgn ; isPron = su.isPron} ; empty=[]} ;
emptyObj : Obj = emptyNP ** {s=[]} ;
emptyObj : Obj = {a = {gn = {g=Masc ; n=Sg} ; isPron = False}; s = []} ;
insertObj : NP -> VPSlash -> VP = \np,vp -> vp ** {
obj = {s = vp.obj.s -- old object, if there was one
++ bindIfPron np vp -- new object, bind if pronoun and not pred
++ vp.agrObj ! np.a.pgn ; -- only used for SlashV2V
a = np.a}
a = agrLite np.a}
} ;
bindIf : Bool -> Str = \b -> if_then_Str b BIND [] ;