1
0
forked from GitHub/gf-rgl

(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

View File

@@ -11,8 +11,8 @@ concrete IdiomAra of Idiom = CatAra ** open
-- : VP -> Cl ; -- it is hot
ImpersCl vp =
let it : ResAra.NP = case vp.isPred of {
True => pron2np (pgn2pron vp.obj.a.pgn) ;
False => pgn2pron vp.obj.a.pgn } ; -- if no obj, Per3 Masc Sg chosen by default
True => pron2np (gn2pron vp.obj.a.gn) ;
False => gn2pron vp.obj.a.gn } ; -- if no obj, Per3 Masc Sg chosen by default
in predVP it vp ;
-- : VP -> Cl ; -- one sleeps

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 [] ;

View File

@@ -97,7 +97,9 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
CompCN cn = {s = \\agr,c => cn2str cn agr.n Indef Nom ;
obj = emptyObj ; isNP = False} ;
CompNP np = {s = \\_,_ => [] ; obj = np ** {s = np.s ! Nom} ; isNP = True} ;
CompNP np = {s = \\_,_ => [] ;
obj = {s = np.s ! Nom ; a = agrLite np.a} ;
isNP = True} ;
--
--
}