1
0
forked from GitHub/gf-rgl

(Ara) V2V and related functions

This commit is contained in:
Inari Listenmaa
2018-11-20 14:10:49 +01:00
parent 47bcbe73f6
commit b174bba3a9
5 changed files with 34 additions and 13 deletions

View File

@@ -79,9 +79,10 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
V, VS, VQ, VA = ResAra.Verb ; -- = {s : VForm => Str} ;
V2, V2A = ResAra.Verb2 ;
VV = ResAra.Verb2 ** {sc : Preposition} ;
VV = ResAra.Verb2 ** {sc : Preposition} ; -- c2 is for verb
V2S, V2Q = ResAra.Verb2 ;
V2V, V3 = ResAra.Verb3 ;
V3 = ResAra.Verb3 ;
V2V = ResAra.Verb3 ** {sc : Preposition} ; -- c3 is for verb, c2 is for dir.obj
A = ResAra.Adj ;
A2 = ResAra.Adj2 ;

View File

@@ -36,8 +36,6 @@ oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ;
oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ;
oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ;
oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ;
oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ;
oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ;
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
oper VocNP : NP -> Voc = notYet "VocNP" ;

View File

@@ -688,9 +688,9 @@ resource ParadigmsAra = open
mkV2S v p = lin V2S (prepV2 v (mkPreposition p)) ;
mkV2V = overload {
mkV2V : V -> Str -> Str -> V2V = \v,p,q ->
lin V2V (prepV3 v (mkPreposition p) (mkPreposition q)) ;
lin V2V (prepV3 v (mkPreposition p) (mkPreposition q) ** {sc = noPrep}) ;
mkV2V : V -> Preposition -> Preposition -> V2V = \v,p,q ->
lin V2V (prepV3 v p q) ;
lin V2V (prepV3 v p q ** {sc = noPrep}) ;
mkV2V : VV -> Preposition -> V2V = \vv,p ->
lin V2V (vv ** {c2 = p ; c3 = vv.c2}) ;
} ;

View File

@@ -1583,7 +1583,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
emptyObj : Obj = emptyNP ** {s=[]} ;
insertObj : NP -> VPSlash -> VP = \np,vp -> vp **
{ obj = {s = vp.obj.s ++ vp.c2.s ++ np.s ! vp.c2.c ; a = np.a} };
{ obj = {s = vp.obj.s -- old object, if there was one
++ vp.c2.s ++ np.s ! vp.c2.c -- new object
++ vp.agrObj ! np.a.pgn ; -- only used for SlashV2V
a = np.a} };
insertPred : Comp -> VP -> VP = \p,vp -> vp **
{ pred = p;
@@ -1601,11 +1604,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
-----------------------------------------------------------------------------
-- Slash categories
VPSlash : Type = VP ** {c2 : Preposition} ;
VPSlash : Type = VP ** {c2 : Preposition ; agrObj : PerGenNum => Str} ;
ClSlash : Type = VPSlash ** {subj : NP} ;
slashV2 : Verb2 -> VPSlash = \v ->
predV v ** {c2 = v.c2} ;
predV v ** {c2 = v.c2 ; agrObj = \\_ => []} ;
-- Add subject string, fix agreement to the subject,
-- but keep the structure as VP, because later on

View File

@@ -7,12 +7,31 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
SlashVV vv vps = vps ** predV vv ; ----IL
-- TODO: --c3 is for verb, c2 is for dir.obj
--SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go
--SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
SlashV2V v2v vp = let v2vVP = predV v2v in -- IL
vp ** {
s = v2vVP.s ;
agrObj = \\pgn => v2v.c3.s -- أَنْ
++ vp.s ! pgn ! VPImpf Cnj ;
isPred = False ;
c2 = v2v.c2 ; -- for the direct object
sc = v2v.sc
} ;
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
SlashV2VNP v2v np vps = let v2vVP = predV v2v in -- IL
vps ** {
s = \\pgn,vpf => v2vVP.s ! pgn ! vpf
++ v2v.c2.s ++ np.s ! v2v.c2.c
++ v2v.c3.s -- أَنْ
++ vps.s ! pgn ! VPImpf Cnj ;
isPred = False ;
-- preposition for the direct object comes from VP
sc = v2v.sc
} ;
SlashV2a = slashV2 ;
Slash3V3 v np = insertObj np (slashV2 v) ** {c2 = v.c3};
Slash3V3 v np = insertObj np (slashV2 v) ** {c2 = v.c3 ; agrObj = \\_ => []};
ComplSlash vp np = insertObj np vp ;