forked from GitHub/gf-rgl
(Ara) replace Agr by AAgr in Obj
This commit is contained in:
@@ -11,8 +11,8 @@ concrete IdiomAra of Idiom = CatAra ** open
|
|||||||
-- : VP -> Cl ; -- it is hot
|
-- : VP -> Cl ; -- it is hot
|
||||||
ImpersCl vp =
|
ImpersCl vp =
|
||||||
let it : ResAra.NP = case vp.isPred of {
|
let it : ResAra.NP = case vp.isPred of {
|
||||||
True => pron2np (pgn2pron vp.obj.a.pgn) ;
|
True => pron2np (gn2pron vp.obj.a.gn) ;
|
||||||
False => pgn2pron vp.obj.a.pgn } ; -- if no obj, Per3 Masc Sg chosen by default
|
False => gn2pron vp.obj.a.gn } ; -- if no obj, Per3 Masc Sg chosen by default
|
||||||
in predVP it vp ;
|
in predVP it vp ;
|
||||||
|
|
||||||
-- : VP -> Cl ; -- one sleeps
|
-- : VP -> Cl ; -- one sleeps
|
||||||
|
|||||||
@@ -1388,9 +1388,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
isDecl : Bool
|
isDecl : Bool
|
||||||
};
|
};
|
||||||
|
|
||||||
Agr = { pgn : PerGenNum; isPron : Bool} ;
|
Agr = {pgn : PerGenNum; isPron : Bool} ;
|
||||||
AAgr = { g : Gender ; n : Number} ;
|
AgrLite = {gn : AAgr ; isPron : Bool} ; --used in ImpersCl
|
||||||
|
AAgr = {g : Gender ; n : Number} ;
|
||||||
|
|
||||||
|
agrLite : Agr -> AgrLite = \a -> a ** {gn = pgn2gn a.pgn} ;
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- NP, Pron
|
-- NP, Pron
|
||||||
@@ -1481,6 +1483,9 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
Per3 Masc Pl => theyMasc_Pron
|
Per3 Masc Pl => theyMasc_Pron
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
gn2pron : AAgr -> NP = \gn ->
|
||||||
|
pgn2pron (gn2pgn gn) ;
|
||||||
|
|
||||||
pron2np : NP -> NP = \np -> np ** {
|
pron2np : NP -> NP = \np -> np ** {
|
||||||
a = np.a ** {isPron=False} -- hack, sometimes we *don't* want prodrop
|
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 = {
|
Obj : Type = {
|
||||||
s : Str ;
|
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
|
}; -- need isPron for word order in predVP, and pgn for ImpersCl
|
||||||
|
|
||||||
Subj : Type = {s : Case => Str ; isPron : Bool} ;
|
Subj : Type = {s : Case => Str ; isPron : Bool} ;
|
||||||
|
|
||||||
np2subj : NP -> Subj = \np -> np ** {isPron = np.a.isPron} ;
|
np2subj : NP -> Subj = \np -> np ** {isPron = np.a.isPron} ;
|
||||||
subj2np : Subj -> NP = \su -> su ** {a = {pgn = emptyNP.a.pgn ; isPron = su.isPron} ; empty=[]} ;
|
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 ** {
|
insertObj : NP -> VPSlash -> VP = \np,vp -> vp ** {
|
||||||
obj = {s = vp.obj.s -- old object, if there was one
|
obj = {s = vp.obj.s -- old object, if there was one
|
||||||
++ bindIfPron np vp -- new object, bind if pronoun and not pred
|
++ bindIfPron np vp -- new object, bind if pronoun and not pred
|
||||||
++ vp.agrObj ! np.a.pgn ; -- only used for SlashV2V
|
++ 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 [] ;
|
bindIf : Bool -> Str = \b -> if_then_Str b BIND [] ;
|
||||||
|
|||||||
@@ -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 ;
|
CompCN cn = {s = \\agr,c => cn2str cn agr.n Indef Nom ;
|
||||||
obj = emptyObj ; isNP = False} ;
|
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} ;
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user