1
0
forked from GitHub/gf-rgl

add slash3v3 and SlashV2A

This commit is contained in:
Meowyam
2022-01-12 17:17:10 +08:00
parent 9d56ac6fee
commit f0b5a89fd4
7 changed files with 43 additions and 19 deletions

View File

@@ -108,7 +108,7 @@ concrete CatMay of Cat = CommonX - [IAdv] ** open ResMay, Prelude in {
V2A, -- verb with NP and AP complement e.g. "paint" V2A, -- verb with NP and AP complement e.g. "paint"
V2V, -- verb with NP and V complement e.g. "cause" V2V, -- verb with NP and V complement e.g. "cause"
V2S, -- verb with NP and S complement e.g. "tell" V2S, -- Reverb with NP and S complement e.g. "tell"
V2Q, -- verb with NP and Q complement e.g. "ask" V2Q, -- verb with NP and Q complement e.g. "ask"
V2 = ResMay.Verb2 ; V2 = ResMay.Verb2 ;
V3 = ResMay.Verb3 ; V3 = ResMay.Verb3 ;

View File

@@ -227,7 +227,7 @@ lin love_V2 = mkV2 "cinta" ;
lin man_N = mkN "lelaki" ; lin man_N = mkN "lelaki" ;
-- lin married_A2 = mkA "" ; -- lin married_A2 = mkA "" ;
-- lin meat_N = mkN "" ; lin meat_N = mkN "daging" ;
lin milk_N = mkN "susu" ; lin milk_N = mkN "susu" ;
-- lin moon_N = mkN "" ; -- lin moon_N = mkN "" ;
lin mother_N2 = mkN2 "ibu" ; lin mother_N2 = mkN2 "ibu" ;
@@ -364,7 +364,7 @@ lin song_N = mkN "lagu" ;
-- lin table_N = mkN "" ; -- lin table_N = mkN "" ;
-- lin tail_N = mkN "" ; -- lin tail_N = mkN "" ;
-- lin talk_V3 = mkV3 "" ; lin talk_V3 = mkV3 (mkV "cakap" Ber) (mkPrep "tentang") (mkPrep "dengan") ;
lin teach_V2 = mkV2 "ajar" ; lin teach_V2 = mkV2 "ajar" ;
-- lin teacher_N = mkN "" ; -- lin teacher_N = mkN "" ;
-- lin television_N = mkN "" ; -- lin television_N = mkN "" ;

View File

@@ -31,7 +31,8 @@ oper
} ; } ;
prefixMeng : Str -> Str = \makan -> case makan of { prefixMeng : Str -> Str = \makan -> case makan of {
? + ? + c => "menge" + makan ;
? + ? + ? => "menge" + makan ;
(#v|"g"|"h") + _ (#v|"g"|"h") + _
=> "meng" + makan ; -- prefix meng: e.g. meng+atur => "meng" + makan ; -- prefix meng: e.g. meng+atur
@@ -51,8 +52,6 @@ oper
"s" + alak "s" + alak
=> "meny" + alak ; -- replace s with meny => "meny" + alak ; -- replace s with meny
("r"|"l"|"w"|"y"|"m"|"n"|"ny"|"ng") + _ ("r"|"l"|"w"|"y"|"m"|"n"|"ny"|"ng") + _
=> "me" + makan ; -- prefix me => "me" + makan ; -- prefix me

View File

@@ -248,6 +248,7 @@ oper
VPSlash : Type = VerbPhrase ** { VPSlash : Type = VerbPhrase ** {
c2 : Preposition ; c2 : Preposition ;
adjCompl : Str ;
} ; } ;
useV : Verb -> VerbPhrase = \v -> v ** { useV : Verb -> VerbPhrase = \v -> v ** {
@@ -295,6 +296,7 @@ oper
predVPSlash : NounPhrase -> VPSlash -> ClSlash = \np,vps -> predVPSlash : NounPhrase -> VPSlash -> ClSlash = \np,vps ->
predVP np <vps : VerbPhrase> ** {c2 = vps.c2} ; predVP np <vps : VerbPhrase> ** {c2 = vps.c2} ;
-- mkClause : Str -> NounPhrase -> VPSlash -> Clause = \str,np,vp -> { -- mkClause : Str -> NounPhrase -> VPSlash -> Clause = \str,np,vp -> {
-- subj = str ++ np.s ! Bare; -- subj = str ++ np.s ! Bare;
-- pred = vp.s -- pred = vp.s

View File

@@ -130,7 +130,7 @@ lin youPl_Pron = mkPron "kamu" P2;
lin they_Pron = mkPron "mereka" P3 ; lin they_Pron = mkPron "mereka" P3 ;
--lin whatPl_IP = ; --lin whatPl_IP = ;
--lin whatSg_IP = : lin whatSg_IP = mkIP "apa";
--lin whoPl_IP = ; --lin whoPl_IP = ;
lin whoSg_IP = mkIP "siapa"; lin whoSg_IP = mkIP "siapa";

View File

@@ -38,30 +38,38 @@ lin
-- : V2 -> VPSlash -- : V2 -> VPSlash
SlashV2a v2 = useV v2 ** { SlashV2a v2 = useV v2 ** {
c2 = v2.c2 c2 = v2.c2 ;
adjCompl = []
} ; } ;
-- : V3 -> NP -> VPSlash ; -- give it (to her) -- : V3 -> NP -> VPSlash ; -- give it (to her)
Slash2V3 v3 dobj = useV { Slash2V3 v3 dobj = useV {
s = \\vf => v3.s ! vf ++ applyPrep v3.c2 dobj s = \\vf => v3.s ! vf ++ applyPrep v3.c2 dobj
} ** { } ** {
c2 = v3.c3 -- Now the VPSlash is missing only the indirect object c2 = v3.c3; -- Now the VPSlash is missing only the indirect object
adjCompl = []
} ; } ;
-- : V3 -> NP -> VPSlash ; -- give (it) to her -- : V3 -> NP -> VPSlash ; -- give (it) to her
Slash3V3 v3 iobj = useV { Slash3V3 v3 iobj = useV {
s = \\vf => v3.s ! vf ++ iobj.s ! Bare -- applyPrep v3.c3 iobj -- TODO check if this works for all -- probably not s = \\vf => v3.s ! vf ++ iobj.s ! Bare ++ applyPrep v3.c3 emptyNP;
--iobj.s ! Bare -- applyPrep v3.c3 iobj -- TODO check if this works for all -- probably not
} ** { } ** {
c2 = v3.c2 -- Now the VPSlash is missing only the direct object c2 = v3.c2 ;-- Now the VPSlash is missing only the direct object
adjCompl = []
} ; } ;
-- insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp -> -- insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp ->
-- insertObj obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ; -- insertObj obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ;
SlashV2A v2 adj = useV { SlashV2A v2 adj = useV {
s = \\vf => v2.s ! vf ++ adj.s; s = \\vf => v2.s ! vf;
} ** { } ** {
c2 = v2.c2 c2 = v2.c2;
adjCompl = adj.s
} ; } ;
{- {-
@@ -81,14 +89,16 @@ lin
ComplSlash vps np = vps ** { ComplSlash vps np = vps ** {
s = \\vf,pol => s = \\vf,pol =>
vps.s ! vf ! pol vps.s ! vf ! pol
++ applyPrep vps.c2 np ++ applyPrep vps.c2 np ++ vps.adjCompl
-- s = \\vf,pol => vps.s ! vf ! pol ++ applyPrep vps.c2 np -- s = \\vf,pol => vps.s ! vf ! pol ++ applyPrep vps.c2 np
} ; } ;
-- : VV -> VPSlash -> VPSlash ; -- : VV -> VPSlash -> VPSlash ;
SlashVV vv vps = ComplVV vv vps ** { SlashVV vv vps = ComplVV vv vps ** {
c2 = vps.c2 ; -- like ComplVV except missing object c2 = vps.c2 ; -- like ComplVV except missing object
passive = vv.s ++ vps.passive passive = vv.s ++ vps.passive;
adjCompl = vps.adjCompl ;
} ; } ;
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy -- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy

View File

@@ -43,9 +43,14 @@ LangEng: which woman did you see
LangMay : awak melihat perempuan yang mana LangMay : awak melihat perempuan yang mana
# -- should be to whom did mother give the meat # -- should be to whom did mother give the meat
# Lang: UseQCl (TTAnt TPast ASimul) PPos (QuestSlash whoSg_IP (SlashVP (MassNP (UseN2 mother_N2)) (Slash3V3 give_V3 (DetCN (DetQuant DefArt NumSg) (UseN meat_N))))) Lang: UseQCl (TTAnt TPast ASimul) PPos (QuestSlash whoSg_IP (SlashVP (MassNP (UseN2 mother_N2)) (Slash3V3 give_V3 (DetCN (DetQuant DefArt NumSg) (UseN meat_N)))))
# LangEng: whom did mother give the meat LangEng: whom did mother give the meat
# LangMay: LangMay: ibu memberi daging kepada siapa
# -- should be to whom did mother talk the meat
Lang: UseQCl (TTAnt TPast ASimul) PPos (QuestSlash whoSg_IP (SlashVP (MassNP (UseN2 mother_N2)) (Slash3V3 talk_V3 (DetCN (DetQuant DefArt NumSg) (UseN meat_N)))))
LangEng: whom did mother talk about the meat to
LangMay: ibu bercakap daging dengan siapa
Lang: UseQCl (TTAnt TPres ASimul) PPos (QuestVP whoSg_IP (ComplVV want_VV (UseV go_V))) Lang: UseQCl (TTAnt TPres ASimul) PPos (QuestVP whoSg_IP (ComplVV want_VV (UseV go_V)))
LangEng: who wants to go LangEng: who wants to go
@@ -57,4 +62,12 @@ LangMay: siapa kucing
Lang: UseQCl (TTAnt TPres ASimul) PPos (QuestIAdv how_IAdv (PredVP (DetCN (DetQuant (PossPron youSg_Pron) NumSg) (UseN2 mother_N2)) (ComplSlash (SlashV2A paint_V2A (PositA black_A)) (DetCN (DetQuant DefArt NumSg) (UseN house_N))))) Lang: UseQCl (TTAnt TPres ASimul) PPos (QuestIAdv how_IAdv (PredVP (DetCN (DetQuant (PossPron youSg_Pron) NumSg) (UseN2 mother_N2)) (ComplSlash (SlashV2A paint_V2A (PositA black_A)) (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))
LangEng: how does your mother paint the house black LangEng: how does your mother paint the house black
LangMay: bagaimana ibu awak mengecat rumah hitam LangMay: bagaimana ibu awak mengecat rumah hitam
Lang: UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv why_IAdv (PredVP (UsePron she_Pron) (ComplSlash (SlashV2a eat_V2) (DetCN (DetQuant DefArt NumSg) (UseN meat_N)))))
LangEng: why did she eat the meat
LangMay: mengapa dia makan daging
Lang: UseQCl (TTAnt TPast ASimul) PPos (QuestVP whatSg_IP (UseComp (CompNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN meat_N) (UseRCl (TTAnt TPast ASimul) PPos (RelVP IdRP (PassV2 eat_V2))))))))
LangEng: what was the meat that was eaten
LangMay: apa daging yang dimakan