1
0
forked from GitHub/gf-rgl

(Ara) replace NP with just its string and isPron:Bool for ClSlash

This commit is contained in:
Inari Listenmaa
2018-11-21 16:20:44 +01:00
parent 473f6ae05b
commit e911ad7cb3

View File

@@ -1559,16 +1559,32 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
False => (proDrop np).s ! sc.c ; -- prodrop if it's not predicative False => (proDrop np).s ! sc.c ; -- prodrop if it's not predicative
True => np.s ! sc.c True => np.s ! sc.c
} ; } ;
} in wordOrder o
vp.obj.a.isPron np.a.isPron
(vStr t p)
subj
} in (case <vp.isPred,vp.obj.a.isPron> of {
<False,True> => BIND ++ vp.obj.s ;
_ => vp.obj.s })
(pred t p)
vp.s2
} ;
-- seems complicated, but this is to share code between PredVP and ClSlash-using funs
wordOrder : Order -> (objIsPron,subjIsPron : Bool) -> (verb,subj,obj,pred,adv : Str) -> Str =
\o,objIsPron,subjIsPron,verb,subj,obj,pred,adv ->
case o of { case o of {
Verbal => vStr t p ++ case vp.obj.a.isPron of { VOS => verb ++ obj ++ pred ++ adv ++ subj ;
True => vp.obj.s ++ subj ; -- obj. clitic attaches directly to the verb Verbal => verb ++
False => subj ++ vp.obj.s } case objIsPron of {
++ vp.s2 ++ pred t p ; True => obj ++ subj ; -- obj. clitic attaches directly to the verb
VOS => vStr t p ++ vp.obj.s ++ vp.s2 ++ pred t p ++ subj ; False => subj ++ obj } ++ adv ++ pred ;
Nominal|Subord => subj ++ vStr t p ++ vp.obj.s ++ vp.s2 ++ pred t p Nominal => subj ++ verb ++ obj ++ adv ++ pred ;
} Subord => if_then_Str subjIsPron BIND [] -- in subord. clause, subj. pronoun binds to the main verb
++ subj ++ verb ++ obj ++ adv ++ pred
} ; } ;
-- in verbal sentences, the verb agrees with the subject -- in verbal sentences, the verb agrees with the subject
@@ -1591,6 +1607,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
a : Agr -- default Agr in a VP without real Obj is Per3 Masc Sg. a : Agr -- 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} ;
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 = emptyNP ** {s=[]} ;
insertObj : NP -> VPSlash -> VP = \np,vp -> vp ** insertObj : NP -> VPSlash -> VP = \np,vp -> vp **
@@ -1616,7 +1636,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
-- Slash categories -- Slash categories
VPSlash : Type = VP ** {c2 : Preposition ; agrObj : PerGenNum => Str} ; VPSlash : Type = VP ** {c2 : Preposition ; agrObj : PerGenNum => Str} ;
ClSlash : Type = VPSlash ** {subj : NP} ; ClSlash : Type = VPSlash ** {subj : Subj} ;
slashV2 : Verb2 -> VPSlash = \v -> slashV2 : Verb2 -> VPSlash = \v ->
predV v ** {c2 = v.c2 ; agrObj = \\_ => []} ; predV v ** {c2 = v.c2 ; agrObj = \\_ => []} ;
@@ -1625,14 +1645,15 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
-- but keep the structure as VP, because later on -- but keep the structure as VP, because later on
-- we might need different word orders for the ClSlash. -- we might need different word orders for the ClSlash.
predVPSlash : NP -> VPSlash -> ClSlash = \np,v -> v ** { predVPSlash : NP -> VPSlash -> ClSlash = \np,v -> v ** {
subj = np subj = np2subj np ;
s = \\_pgn,vf => v.s ! np.a.pgn ! vf -- so we can throw away subject's pgn
} ; } ;
complClSlash = overload { complClSlash = overload {
complClSlash : NP -> ClSlash -> Cl = \obj,cls -> complClSlash : NP -> ClSlash -> Cl = \obj,cls ->
predVP cls.subj (insertObj obj cls) ; predVP (subj2np cls.subj) (insertObj obj cls) ;
complClSlash : ClSlash -> Cl = \cls -> complClSlash : ClSlash -> Cl = \cls ->
predVP cls.subj (insertObj emptyNP cls) -- Empty subject and object predVP (subj2np cls.subj) (insertObj emptyNP cls) -- Empty subject and object
} ; } ;
Cl : Type = {s : Tense => Polarity => Order => Str} ; Cl : Type = {s : Tense => Polarity => Order => Str} ;