From bf0e3a58dd214ced8307cf725b0b588bfbfa1f7f Mon Sep 17 00:00:00 2001 From: Meowyam Date: Wed, 12 Jan 2022 17:17:10 +0800 Subject: [PATCH] add slash3v3 and SlashV2A --- src/malay/CatMay.gf | 2 +- src/malay/LexiconMay.gf | 4 ++-- src/malay/ParamMay.gf | 5 ++--- src/malay/ResMay.gf | 2 ++ src/malay/StructuralMay.gf | 2 +- src/malay/VerbMay.gf | 26 ++++++++++++++++++-------- src/malay/unittest/questions.gftest | 21 +++++++++++++++++---- 7 files changed, 43 insertions(+), 19 deletions(-) diff --git a/src/malay/CatMay.gf b/src/malay/CatMay.gf index 7f3200d5..d1bc0ebb 100644 --- a/src/malay/CatMay.gf +++ b/src/malay/CatMay.gf @@ -108,7 +108,7 @@ concrete CatMay of Cat = CommonX - [IAdv] ** open ResMay, Prelude in { V2A, -- verb with NP and AP complement e.g. "paint" 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" V2 = ResMay.Verb2 ; V3 = ResMay.Verb3 ; diff --git a/src/malay/LexiconMay.gf b/src/malay/LexiconMay.gf index e3344258..74d14c68 100644 --- a/src/malay/LexiconMay.gf +++ b/src/malay/LexiconMay.gf @@ -227,7 +227,7 @@ lin love_V2 = mkV2 "cinta" ; lin man_N = mkN "lelaki" ; -- lin married_A2 = mkA "" ; --- lin meat_N = mkN "" ; +lin meat_N = mkN "daging" ; lin milk_N = mkN "susu" ; -- lin moon_N = mkN "" ; lin mother_N2 = mkN2 "ibu" ; @@ -364,7 +364,7 @@ lin song_N = mkN "lagu" ; -- lin table_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 teacher_N = mkN "" ; -- lin television_N = mkN "" ; diff --git a/src/malay/ParamMay.gf b/src/malay/ParamMay.gf index 0eeb7de4..abe7164d 100644 --- a/src/malay/ParamMay.gf +++ b/src/malay/ParamMay.gf @@ -31,7 +31,8 @@ oper } ; prefixMeng : Str -> Str = \makan -> case makan of { - ? + ? + c => "menge" + makan ; + + ? + ? + ? => "menge" + makan ; (#v|"g"|"h") + _ => "meng" + makan ; -- prefix meng: e.g. meng+atur @@ -51,8 +52,6 @@ oper "s" + alak => "meny" + alak ; -- replace s with meny - - ("r"|"l"|"w"|"y"|"m"|"n"|"ny"|"ng") + _ => "me" + makan ; -- prefix me diff --git a/src/malay/ResMay.gf b/src/malay/ResMay.gf index 45fc9ad7..b2c0d878 100644 --- a/src/malay/ResMay.gf +++ b/src/malay/ResMay.gf @@ -248,6 +248,7 @@ oper VPSlash : Type = VerbPhrase ** { c2 : Preposition ; + adjCompl : Str ; } ; useV : Verb -> VerbPhrase = \v -> v ** { @@ -295,6 +296,7 @@ oper predVPSlash : NounPhrase -> VPSlash -> ClSlash = \np,vps -> predVP np ** {c2 = vps.c2} ; + -- mkClause : Str -> NounPhrase -> VPSlash -> Clause = \str,np,vp -> { -- subj = str ++ np.s ! Bare; -- pred = vp.s diff --git a/src/malay/StructuralMay.gf b/src/malay/StructuralMay.gf index 8f881ff8..862970fa 100644 --- a/src/malay/StructuralMay.gf +++ b/src/malay/StructuralMay.gf @@ -130,7 +130,7 @@ lin youPl_Pron = mkPron "kamu" P2; lin they_Pron = mkPron "mereka" P3 ; --lin whatPl_IP = ; ---lin whatSg_IP = : +lin whatSg_IP = mkIP "apa"; --lin whoPl_IP = ; lin whoSg_IP = mkIP "siapa"; diff --git a/src/malay/VerbMay.gf b/src/malay/VerbMay.gf index b483102e..3dbf8cba 100644 --- a/src/malay/VerbMay.gf +++ b/src/malay/VerbMay.gf @@ -38,30 +38,38 @@ lin -- : V2 -> VPSlash SlashV2a v2 = useV v2 ** { - c2 = v2.c2 + c2 = v2.c2 ; + adjCompl = [] } ; + -- : V3 -> NP -> VPSlash ; -- give it (to her) Slash2V3 v3 dobj = useV { 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 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 -> -- insertObj obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ; 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 ** { 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 } ; + -- : VV -> VPSlash -> VPSlash ; SlashVV vv vps = ComplVV vv vps ** { 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 diff --git a/src/malay/unittest/questions.gftest b/src/malay/unittest/questions.gftest index 875614d3..cdac74cf 100644 --- a/src/malay/unittest/questions.gftest +++ b/src/malay/unittest/questions.gftest @@ -43,9 +43,14 @@ LangEng: which woman did you see LangMay : awak melihat perempuan yang mana # -- 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))))) -# LangEng: whom did mother give the meat -# LangMay: +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 +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))) 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))))) LangEng: how does your mother paint the house black -LangMay: bagaimana ibu awak mengecat rumah hitam \ No newline at end of file +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 \ No newline at end of file