From 1a3b3ef796bc1fc1b18d2595b6cb3589417d82fc Mon Sep 17 00:00:00 2001 From: Meowyam Date: Wed, 12 Jan 2022 15:20:26 +0800 Subject: [PATCH] monosyllable prefix --- src/malay/AdjectiveMay.gf | 2 +- src/malay/LexiconMay.gf | 6 +++--- src/malay/ParamMay.gf | 4 ++++ src/malay/QuestionMay.gf | 4 ++-- src/malay/ResMay.gf | 3 +++ src/malay/StructuralMay.gf | 6 +++--- src/malay/VerbMay.gf | 14 +++++++++++++- src/malay/unittest/questions.gftest | 6 +++++- 8 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/malay/AdjectiveMay.gf b/src/malay/AdjectiveMay.gf index af6b454c..be7c198f 100644 --- a/src/malay/AdjectiveMay.gf +++ b/src/malay/AdjectiveMay.gf @@ -6,7 +6,7 @@ concrete AdjectiveMay of Adjective = CatMay ** open ResMay, Prelude in { -- : A -> AP ; PositA a = a ** { - compar = [] ; + compar = a.s ; } ; -- : A -> NP -> AP ; diff --git a/src/malay/LexiconMay.gf b/src/malay/LexiconMay.gf index b17c7753..e3344258 100644 --- a/src/malay/LexiconMay.gf +++ b/src/malay/LexiconMay.gf @@ -33,7 +33,7 @@ lin beautiful_A = mkA "cantik" ; -- lin bike_N = mkN "" ; -- lin bird_N = mkN "" ; -- lin bite_V2 = mkV2 "" ; --- lin black_A = mkA "" ; +lin black_A = mkA "hitam" ; -- lin blood_N = mkN "" ; -- lin blow_V = mkV "" ; -- lin blue_A = mkA "" ; @@ -230,7 +230,7 @@ lin man_N = mkN "lelaki" ; -- lin meat_N = mkN "" ; lin milk_N = mkN "susu" ; -- lin moon_N = mkN "" ; --- lin mother_N2 = mkN2 "" ; +lin mother_N2 = mkN2 "ibu" ; -- lin mountain_N = mkN "" ; -- lin mouth_N = mkN "" ; -- lin music_N = mkN "" ; @@ -256,7 +256,7 @@ lin now_Adv = mkAdv "sekarang" ; -- lin oil_N = mkN "" ; lin old_A = mkA "tua" ; -- lin open_V2 = mkV2 "" ; --- lin paint_V2A = mkV2A "" ; +lin paint_V2A = mkV2 "cat" ; -- lin paper_N = mkN "" ; -- lin paris_PN = mkPN "Paris" ; -- lin peace_N = mkN "" ; diff --git a/src/malay/ParamMay.gf b/src/malay/ParamMay.gf index 9c3f28da..0eeb7de4 100644 --- a/src/malay/ParamMay.gf +++ b/src/malay/ParamMay.gf @@ -31,6 +31,8 @@ oper } ; prefixMeng : Str -> Str = \makan -> case makan of { + ? + ? + c => "menge" + makan ; + (#v|"g"|"h") + _ => "meng" + makan ; -- prefix meng: e.g. meng+atur "k" + enal @@ -49,6 +51,8 @@ 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/QuestionMay.gf b/src/malay/QuestionMay.gf index e0d3a149..ba6cab1a 100644 --- a/src/malay/QuestionMay.gf +++ b/src/malay/QuestionMay.gf @@ -54,8 +54,8 @@ lin True => iadv.s ++ cls.subj ; False => cls.subj } ; pred = \\vf,pol => case iadv.isPre of { - True => cls.pred ! Root ! pol ; - False => cls.pred ! Root ! pol ++ iadv.s + True => cls.pred ! iadv.vf ! pol ; + False => cls.pred ! iadv.vf ! pol ++ iadv.s } ; } ; diff --git a/src/malay/ResMay.gf b/src/malay/ResMay.gf index 8c82ac27..45fc9ad7 100644 --- a/src/malay/ResMay.gf +++ b/src/malay/ResMay.gf @@ -67,6 +67,7 @@ oper sp = \\_ => str ; } ; + -------------------------------------------------------------------------------- -- Det, Quant, Card, Ord @@ -235,6 +236,7 @@ oper IAdv : Type = Adverb ** { isPre : Bool ; + vf : VForm ; } ; ------------------ @@ -256,6 +258,7 @@ oper s = \\vf,pol => nounneg pol ++ s ; } ; + verbneg : Polarity -> Str = \pol -> case pol of { Neg => "tidak" ; -- or "tak"? Pos => [] diff --git a/src/malay/StructuralMay.gf b/src/malay/StructuralMay.gf index 3d5ad4e9..8f881ff8 100644 --- a/src/malay/StructuralMay.gf +++ b/src/malay/StructuralMay.gf @@ -15,13 +15,13 @@ lin very_AdA = mkAdA "" ; lin as_CAdv = { s = "" ; p = [] } ; lin less_CAdv = { s = "" ; p = [] } ; lin more_CAdv = { s = "" ; p = [] } ; -lin how_IAdv = ss "" : lin how8much_IAdv = ss "" ; lin when_IAdv = ss "" ; -} -lin where_IAdv = { s = "mana"; isPre = False } ; -lin why_IAdv = {s = "mengapa"; isPre = True } ; +lin how_IAdv = { s = "bagaimana"; isPre = True ; vf = Active } ; +lin where_IAdv = { s = "mana"; isPre = False ; vf = Root } ; +lin why_IAdv = {s = "mengapa"; isPre = True ; vf = Root } ; {- diff --git a/src/malay/VerbMay.gf b/src/malay/VerbMay.gf index d97fa932..b483102e 100644 --- a/src/malay/VerbMay.gf +++ b/src/malay/VerbMay.gf @@ -55,6 +55,15 @@ lin c2 = v3.c2 -- Now the VPSlash is missing only the direct object } ; + -- 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; + } ** { + c2 = v2.c2 + } ; + {- -- : V2S -> S -> VPSlash ; -- answer (to him) that it is good SlashV2S v2s s = @@ -70,7 +79,10 @@ lin -} -- : VPSlash -> NP -> VP ComplSlash vps np = vps ** { - s = \\vf,pol => vps.s ! vf ! pol ++ applyPrep vps.c2 np + 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 ; diff --git a/src/malay/unittest/questions.gftest b/src/malay/unittest/questions.gftest index afadc31a..875614d3 100644 --- a/src/malay/unittest/questions.gftest +++ b/src/malay/unittest/questions.gftest @@ -53,4 +53,8 @@ LangMay: siapa mahu pergi Lang: UseQCl (TTAnt TPres ASimul) PPos (QuestIComp (CompIP whoSg_IP) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))) LangEng: who is the cat -LangMay: siapa kucing \ No newline at end of file +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