diff --git a/languages.csv b/languages.csv index e4479c7c..6b4ca438 100644 --- a/languages.csv +++ b/languages.csv @@ -27,6 +27,7 @@ Jpn,Japanese,japanese,,,,,,,,y Kor,Korean,korean,,,n,y,y,y,n,n Lat,Latin,latin,,,,,y,y,n,y Lav,Latvian,latvian,,,,,,,y,y +May,Malay,malay,,,y,,,,n,y Mlt,Maltese,maltese,,,,,,,,y Mon,Mongolian,mongolian,,,,,,n,,y Nep,Nepali,nepali,,,,,,n,,y diff --git a/src/malay/AdjectiveMay.gf b/src/malay/AdjectiveMay.gf index af6b454c..4909f119 100644 --- a/src/malay/AdjectiveMay.gf +++ b/src/malay/AdjectiveMay.gf @@ -4,6 +4,11 @@ concrete AdjectiveMay of Adjective = CatMay ** open ResMay, Prelude in { lin + -- : AP -> Adv -> AP ; -- warm by nature + AdvAP ap adv = ap ** { + s = ap.s ++ adv.s ; + } ; + -- : A -> AP ; PositA a = a ** { compar = [] ; @@ -39,6 +44,8 @@ concrete AdjectiveMay of Adjective = CatMay ** open ResMay, Prelude in { -- AdjOrd ord = ord ** { -- compar = [] -- } ; + -- AdjOrd : Ord -> AP = + AdjOrd ord = ord ; -- Sentence and question complements defined for all adjectival -- phrases, although the semantics is only clear for some adjectives. @@ -56,7 +63,6 @@ concrete AdjectiveMay of Adjective = CatMay ** open ResMay, Prelude in { -- It can also be postmodified by an adverb, typically a prepositional phrase. - -- : AP -> Adv -> AP ; -- warm by nature - -- AdvAP ap adv = ap ** {} ; + } diff --git a/src/malay/AdverbMay.gf b/src/malay/AdverbMay.gf index 36458f82..d7b65fd7 100644 --- a/src/malay/AdverbMay.gf +++ b/src/malay/AdverbMay.gf @@ -13,6 +13,8 @@ lin -- : Prep -> NP -> Adv ; PrepNP prep np = {s = applyPrep prep np} ; + -- PrepNP to_Prep (UsePron youSg_Pron) + -- Adverbs can be modified by 'adadjectives', just like adjectives. --AdAdv : AdA -> Adv -> Adv ; -- very quickly diff --git a/src/malay/AllMay.gf b/src/malay/AllMay.gf index c965d873..2836b818 100644 --- a/src/malay/AllMay.gf +++ b/src/malay/AllMay.gf @@ -3,6 +3,6 @@ concrete AllMay of AllMayAbs = LangMay, ExtendMay - ** { + ** open ParadigmsMay in { lin sing_V2 = mkV2 "nyanyi" ; } ; diff --git a/src/malay/CatMay.gf b/src/malay/CatMay.gf index d1bc0ebb..61ca8867 100644 --- a/src/malay/CatMay.gf +++ b/src/malay/CatMay.gf @@ -120,4 +120,16 @@ concrete CatMay of Cat = CommonX - [IAdv] ** open ResMay, Prelude in { N2 = ResMay.Noun2 ; N3 = ResMay.Noun3 ; PN = ResMay.PNoun ; + + linref + CN = \cn -> cn.s ! NF Sg Bare ++ cn.heavyMod; + ClSlash = \cl -> cl.subj ++ cl.pred ! Root ! Pos ++ cl.c2.s; + RCl = \cl -> cl.subj ++ cl.pred ! P1 ! Pos; + Cl = \cl -> cl.subj ++ cl.pred ! Active ! Pos; + Det = linDet ; } + +-- Determiner : Type = Quant ** { +-- pr : Str ; -- prefix for numbers +-- n : NumType ; -- number as in 5 (noun in singular), Sg or Pl +-- } ; \ No newline at end of file diff --git a/src/malay/ExtendMay.gf b/src/malay/ExtendMay.gf index 232940d9..5e14dccc 100644 --- a/src/malay/ExtendMay.gf +++ b/src/malay/ExtendMay.gf @@ -1,8 +1,105 @@ --# -path=.:../common:../abstract concrete ExtendMay of Extend = CatMay - -- ** ExtendFunctor - [] - -- with (Grammar=GrammarMay) - ** open Prelude, ResMay, NounMay in { + ** ExtendFunctor - [ + VPS -- finite VP's with tense and polarity + , ListVPS + , VPI + , ListVPI -- infinitive VP's (TODO: with anteriority and polarity) + , MkVPS + , PredVPS + + -- excluded because RGL funs needed for them not implemented yet + , SlashBareV2S + , PredAPVP + , ComplBareVS + + + ,PresPartAP, PastPartAP + ,GenModNP, GenNP, GenRP + ,CompoundN + ,GerundNP + + + -- VPS2 ; -- have loved (binary version of VPS) + -- [VPS2] {2} ; -- has loved, hates" + -- VPI2 ; -- to love (binary version of VPI) + -- [VPI2] {2} ; -- to love, to hate + +] + with (Grammar=GrammarMay) + ** open Prelude, Coordination, ResMay, NounMay in { + lincat + VPS, VPI = SS ; + ListVPS, ListVPI = ListX ; + lin + -- MkVPS : Temp -> Pol -> VP -> VPS ; -- hasn't slept + MkVPS t p vp = { + s = t.s ++ p.s ++ vp.s ! Active ! p.p; + } ; + + -- BaseVPS : VPS -> VPS -> ListVPS ; + BaseVPS vps vps2 = twoSS vps vps2 ; + -- ConsVPS : VPS -> ListVPS -> ListVPS ; + ConsVPS str listvps vps = consSS "," listvps vps ; + -- ConjVPS : Conj -> [VPS] -> VPS ; -- has walked and won't sleep + ConjVPS conj listvps = conjunctX conj listvps ; + -- PredVPS : NP -> VPS -> S ; -- she [has walked and won't sleep] + PredVPS np vps = { + s = np.s ! Bare ++ vps.s ; + } ; + -- SQuestVPS : NP -> VPS -> QS ; -- has she walked + -- QuestVPS : IP -> VPS -> QS ; -- who has walked + -- RelVPS : RP -> VPS -> RS ; -- which won't sleep + + -- MkVPI : VP -> VPI ; -- to sleep (TODO: Ant and Pol) + MkVPI vp = {s = linVP vp} ; + + + -- BaseVPI : VPI -> VPI -> ListVPI ; + BaseVPI vpi vpi2 = twoSS vpi vpi2 ; + -- ConsVPI : VPI -> ListVPI -> ListVPI ; + ConsVPI str listvpi vpi = consSS "," listvpi vpi ; + + -- ConjVPI : Conj -> [VPI] -> VPI ; -- to sleep and to walk + -- ComplVPIVV : VV -> VPI -> VP ; -- must sleep and walk + ComplVPIVV vv vpi = useV { + s = \\vf => vv.s ++ vpi.s + } ; + + -- PresPartAP : VP -> AP ; -- (the man) looking at Mary + PresPartAP vp = { + s = linVP vp + } ; + + PastPartAP vp = { + s = linVP vp + } ; + -- GenModNP : Num -> NP -> CN -> NP ; -- this man's car(s) + GenModNP n np cn = variants {}; + + -- GenNP : NP -> Quant ; -- this man's + GenNP np = variants {}; + -- GenRP : Num -> CN -> RP ; -- whose car + GenRP n cn = variants {}; + + -- CompoundN : N -> N -> N ; -- control system / controls system / control-system + CompoundN n1 n2 = n2 ** { + s = \\nf => n1.s ! NF Sg Bare ++ n2.s ! nf + } ; + -- GerundNP : VP -> NP ; -- publishing the document (by nature definite) + GerundNP vp = emptyNP ** { + s = \\_ => linVP vp + } ; + + + -- MkVPS2 : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved + -- ConjVPS2 : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates + -- ComplVPS2 : VPS2 -> NP -> VPS ; -- has loved and now hates that person + -- ReflVPS2 : VPS2 -> RNP -> VPS ; -- have loved and now hate myself and my car + + -- MkVPI2 : VPSlash -> VPI2 ; -- to love + -- ConjVPI2 : Conj -> [VPI2] -> VPI2 ; -- to love and hate + -- ComplVPI2 : VPI2 -> NP -> VPI ; -- to love and hate that person } ; diff --git a/src/malay/GrammarMay.gf b/src/malay/GrammarMay.gf index 9c643f4b..4bf46f60 100644 --- a/src/malay/GrammarMay.gf +++ b/src/malay/GrammarMay.gf @@ -9,7 +9,7 @@ concrete GrammarMay of Grammar = RelativeMay, ConjunctionMay, PhraseMay, - TextX - [IAdv], + TextX - [AAnter, TFut, TCond, IAdv], StructuralMay, IdiomMay, TenseX - [AAnter, TFut, TCond, IAdv] @@ -17,9 +17,8 @@ concrete GrammarMay of Grammar = flags startcat = Phr ; - lin - AAnter = {s = "sudah" ; a = ParamX.Anter} ; - TFut = {s = "akan" ; t = ParamX.Fut} ; - TCond = {s = "akan" ; t = ParamX.Cond} ; + lin AAnter = {s = "sudah" ; a = ParamX.Anter} ; --# notpresent + TFut = {s = "akan" ; t = ParamX.Fut} ; --# notpresent + TCond = {s = "akan" ; t = ParamX.Cond} ; --# notpresent } ; diff --git a/src/malay/IdiomMay.gf b/src/malay/IdiomMay.gf index 79f6b362..38dbdb71 100644 --- a/src/malay/IdiomMay.gf +++ b/src/malay/IdiomMay.gf @@ -1,7 +1,7 @@ --1 Idiom: Idiomatic Expressions -concrete IdiomMay of Idiom = CatMay ** open Prelude, ResMay, VerbMay, NounMay, StructuralMay in { +concrete IdiomMay of Idiom = CatMay ** open Prelude, ResMay, VerbMay, QuestionMay, NounMay, StructuralMay in { -- This module defines constructions that are formed in fixed ways, -- often different even in closely related languages. @@ -14,10 +14,17 @@ concrete IdiomMay of Idiom = CatMay ** open Prelude, ResMay, VerbMay, NounMay, S subj = [] ; pred = \\vf,pol => vp.s ! Root ! pol -- force no prefix -- TODO check if legit? } ; -{- - -- GenericCl : VP -> Cl ; -- one sleeps - GenericCl = \vp -> predVP impersNP (passVP vp) ; + -- : NP -> Cl ; -- there is a house + ExistNP np = predVP np (useV copula) ; + + -- ExistIP : IP -> QCl ; -- which houses are there + ExistIP ip = QuestVP ip (useV copula) ; + + -- GenericCl : VP -> Cl ; -- one sleeps + GenericCl = \vp -> predVP emptyNP vp ; + +{- CleftNP : NP -> RS -> Cl ; -- it is I who did it CleftAdv : Adv -> S -> Cl ; -- it is here she slept diff --git a/src/malay/LexiconMay.gf b/src/malay/LexiconMay.gf index a74a89b8..ee6ee3bd 100644 --- a/src/malay/LexiconMay.gf +++ b/src/malay/LexiconMay.gf @@ -4,54 +4,54 @@ concrete LexiconMay of Lexicon = CatMay ** ---- -- A --- lin add_V3 = mkV3 "" ; --- lin airplane_N = mkN "" ; +-- lin add_V3 = mkV3 "tambah" ; +lin airplane_N = mkN "kapal terbang" ; -- lin alas_Interj = mkInterj "" ; --- lin already_Adv = mkA "" ; --- lin animal_N = mkN "동물" ; --- lin answer_V2S = mkV2S "" ; --- lin apartment_N = mkN "" ; --- lin apple_N = mkN "" ; --- lin art_N = mkN "" ; --- lin ashes_N = mkN "" ; --- lin ask_V2Q = mkV2 "" ; +lin already_Adv = mkA "sudah" ; +lin animal_N = mkN "haiwan" ; +-- lin answer_V2S = mkV2S "jawab" ; +lin apartment_N = mkN "pangsapuri" ; +lin apple_N = mkN "epal" ; +lin art_N = mkN "seni" ; +lin ashes_N = mkN "abu" ; +lin ask_V2Q = mkV2 "tanya" ; ---- -- B --- lin baby_N = mkN "" ; --- lin back_N = mkN "" ; +lin baby_N = mkN "bayi" Animate ; +lin back_N = mkN "belakang" ; -- lin bad_A = mkA "" ; --- lin bank_N = mkN "" ; +lin bank_N = mkN "bank" ; -- lin bark_N = mkN "" ; lin beautiful_A = mkA "cantik" ; --- lin become_VA = mkVA "" ; --- lin beer_N = mkN "" ; +-- lin become_VA = mkVA "jadi" ; +lin beer_N = mkN "bir" ; -- lin beg_V2V = mkV2 "" ; -- lin belly_N = mkN "" ; --- lin big_A = mkA "" ; --- lin bike_N = mkN "" ; --- lin bird_N = mkN "" ; +lin big_A = mkA "besar" ; +lin bike_N = mkN "basikal" ; +lin bird_N = mkN "burung" ; -- lin bite_V2 = mkV2 "" ; lin black_A = mkA "hitam" ; --- lin blood_N = mkN "" ; +lin blood_N = mkN "darah" ; -- lin blow_V = mkV "" ; --- lin blue_A = mkA "" ; --- lin boat_N = mkN "" ; --- lin bone_N = mkN "" ; +lin blue_A = mkA "biru" ; +lin boat_N = mkN "perahu" ; +lin bone_N = mkN "tulang" ; -- lin boot_N = mkN "" ; -- lin boss_N = mkN "" ; lin book_N = mkN "buku" ; -- lin boy_N = mkN "" ; --- lin bread_N = mkN "" ; -lin break_V2 = mkV2 "patahkan" ; -- TODO figure out if -kan needs to be separated +lin bread_N = mkN "roti" ; +lin break_V2 = mkV4 "patah" "kan"; -- TODO figure out if -kan needs to be separated -- lin breast_N = mkN "" ; -- lin breathe_V = mkV "" ; -- lin broad_A = mkA "" ; --- lin brother_N2 = mkN "" ; +-- lin brother_N2 = mkN "abang" Animate; -- lin brown_A = mkA "" ; --- lin burn_V = mkV "" ; --- lin butter_N = mkN "" ; +lin burn_V = mkV "bakar" ; +lin butter_N = mkN "mentega" ; lin buy_V2 = mkV2 "beli" ; ---- @@ -68,10 +68,10 @@ lin cat_N = mkN "kucing" ; -- lin child_N = mkN "" ; -- lin church_N = mkN "" ; -- lin city_N = mkN "" ; --- lin clean_A = mkA "" ; +lin clean_A = mkA "bersih" ; -- lin clever_A = mkA "" ; -- lin close_V2 = mkV2 "" ; --- lin cloud_N = mkN "" ; +lin cloud_N = mkN "awan" ; -- lin coat_N = mkN "" ; -- lin cold_A = mkA "" ; lin come_V = mkV "datang" ; @@ -80,7 +80,7 @@ lin come_V = mkV "datang" ; -- lin count_V2 = mkV2 "" ; -- lin country_N = mkN "" ; -- lin cousin_N = mkN "" ; --- lin cow_N = mkN "" ; +lin cow_N = mkN "embu" ; -- lin cut_V2 = mkV2 "" ; ---- @@ -94,8 +94,10 @@ lin come_V = mkV "datang" ; -- lin do_V2 = lin V2 egin_V ; -- lin doctor_N = mkN "" ; lin dog_N = mkN "anjing" ; --- lin door_N = mkN "" ; -lin drink_V2 = mkV2 "minum" ; +lin door_N = mkN "pintu" ; +lin drink_V2 = let drink' : V2 = mkV2 "minum" in drink' ** { + s = \\_ => "minum" ; +}; -- lin dry_A = mkA "" ; -- lin dull_A = mkA "" ; -- lin dust_N = mkN "" ; @@ -105,7 +107,9 @@ lin drink_V2 = mkV2 "minum" ; -- lin ear_N = mkN "" ; -- lin earth_N = mkN "" ; -lin eat_V2 = mkV2 "makan" ; +lin eat_V2 = let eat' : V2 = mkV2 "makan" in eat' ** { + s = \\_ => "makan" ; +}; -- lin egg_N = mkN "" ; -- lin empty_A = mkA "" ; -- lin enemy_N = mkN "" ; @@ -148,7 +152,7 @@ lin father_N2 = mkN2 "bapa" ; -- lin garden_N = mkN "" ; -- lin girl_N = mkN "" ; -lin give_V3 = mkV3 (mkV "beri" Meng) emptyPrep datPrep ; +lin give_V3 = mkV3 (mkV "beri" Meng) emptyPrep datPrep ; -- memberi for living and memberikan for nonliving -- lin glove_N = mkN "" ; lin go_V = mkV "pergi" ; -- lin gold_N = mkN "" ; @@ -186,7 +190,7 @@ lin house_N = mkN "rumah" ; -- lin ice_N = mkN "" ; -- lin industry_N = mkN "" ; -- lin iron_N = mkN "" ; --- lin john_PN = mkPN "" ; +lin john_PN = mkPN "Yohanes" ; -- lin jump_V = mkV "" ; -- lin kill_V2 = mkV2 "" ; lin king_N = mkN "raja" ; @@ -220,7 +224,11 @@ lin long_A = mkA "panjang" ; -- lin lose_V2 = mkV2 "" ; -- lin louse_N = mkN "" ; -- lin love_N = mkN "" ; -lin love_V2 = mkV2 "cinta" ; +-- lin love_V2 = let love' : V2 = mkV2 "cinta" in love' ** { +-- s = \\_ => "mencintai" ; +-- passive = "dicintai" ; +-- } ; +lin love_V2 = mkV4 "cinta" "i"; ---- -- M @@ -255,7 +263,7 @@ lin now_Adv = mkAdv "sekarang" ; -- lin oil_N = mkN "" ; lin old_A = mkA "tua" ; --- lin open_V2 = mkV2 "" ; +lin open_V2 = mkV2 "buka" ; lin paint_V2A = mkV2 "cat" ; -- lin paper_N = mkN "" ; -- lin paris_PN = mkPN "Paris" ; @@ -296,7 +304,7 @@ lin read_V2 = mkV2 "baca" ; -- lin round_A = mkA "" ; -- lin rub_V2 = mkV2 "" ; -- lin rubber_N = mkN "" ; --- lin rule_N = mkN "" ; +lin rule_N = mkN "peraturan" ; -- lin run_V = mkV "" ; ---- @@ -312,7 +320,7 @@ lin science_N = mkN "sains" ; lin see_V2 = mkV2 "lihat" ; -- lin seed_N = mkN "" ; -- lin seek_V2 = mkV2 "" ; -lin sell_V3 = mkV3 (mkV "jual" Meng) emptyPrep emptyPrep ; -- TODO +-- lin sell_V3 = mkV3 (mkV "jual" Meng) emptyPrep emptyPrep ; -- TODO -- lin send_V3 = mkV3 "" ; -- lin sew_V = mkV "" ; -- lin sharp_A = mkA "" ; @@ -347,7 +355,7 @@ lin song_N = mkN "lagu" ; -- lin steel_N = mkN "" ; -- lin stick_N = mkN "" ; -- lin stone_N = mkN "" ; --- lin stop_V = mkV "" ; +lin stop_V = mkV "henti" ; -- lin stove_N = mkN "" ; -- lin straight_A = mkA "" ; -- lin student_N = mkN "" ; @@ -414,7 +422,7 @@ lin woman_N = mkN "perempuan" ; -- lin wonder_VQ = mkVQ "" ; -- lin wood_N = mkN "" ; -- lin worm_N = mkN "" ; --- lin write_V2 = mkV2 "" ; +lin write_V2 = mkV2 "tulis" ; -- lin year_N = mkN "" ; -- lin yellow_A = mkA "" ; lin young_A = mkA "muda" ; diff --git a/src/malay/MissingMay.gf b/src/malay/MissingMay.gf index 133ff736..d1a55f58 100644 --- a/src/malay/MissingMay.gf +++ b/src/malay/MissingMay.gf @@ -9,8 +9,6 @@ oper AdjCN : AP -> CN -> CN = notYet "AdjCN" ; oper AdjDAP : DAP -> AP -> DAP = notYet "AdjDAP" ; oper AdjOrd : Ord -> AP = notYet "AdjOrd" ; oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ; -oper AdvAP : AP -> Adv -> AP = notYet "AdvAP" ; -oper AdvCN : CN -> Adv -> CN = notYet "AdvCN" ; oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ; oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ; oper AdvNP : NP -> Adv -> NP = notYet "AdvNP" ; @@ -114,7 +112,6 @@ oper Use2N3 : N3 -> N2 = notYet "Use2N3" ; oper Use3N3 : N3 -> N2 = notYet "Use3N3" ; oper UseA2 : A2 -> AP = notYet "UseA2" ; oper UseComparA : A -> AP = notYet "UseComparA" ; -oper UsePN : PN -> NP = notYet "UsePN" ; oper UseQCl : Temp -> Pol -> QCl -> QS = notYet "UseQCl" ; oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ; oper UttAP : AP -> Utt = notYet "UttAP" ; @@ -192,7 +189,6 @@ oper but_PConj : PConj = notYet "but_PConj" ; oper butter_N : N = notYet "butter_N" ; oper camera_N : N = notYet "camera_N" ; oper can8know_VV : VV = notYet "can8know_VV" ; -oper can_VV : VV = notYet "can_VV" ; oper cap_N : N = notYet "cap_N" ; oper carpet_N : N = notYet "carpet_N" ; oper ceiling_N : N = notYet "ceiling_N" ; @@ -363,7 +359,6 @@ oper mountain_N : N = notYet "mountain_N" ; oper mouth_N : N = notYet "mouth_N" ; oper much_Det : Det = notYet "much_Det" ; oper music_N : N = notYet "music_N" ; -oper must_VV : VV = notYet "must_VV" ; oper n_unit_CN : Card -> CN -> CN -> CN = notYet "n_unit_CN" ; oper n_units_AP : Card -> CN -> A -> AP = notYet "n_units_AP" ; oper n_units_of_NP : Card -> CN -> NP -> NP = notYet "n_units_of_NP" ; diff --git a/src/malay/NounMay.gf b/src/malay/NounMay.gf index 2bfed1f7..90f0b7d5 100644 --- a/src/malay/NounMay.gf +++ b/src/malay/NounMay.gf @@ -19,8 +19,7 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in { } ; -- : PN -> NP ; --- UsePN pn = pn ** { --- } ; + UsePN pn = MassNP (UseN pn) ; -- : Pron -> NP ; UsePron pron = pron ** { @@ -40,7 +39,9 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in { -- s = \\c => v2.s ! ??? ++ np.s ! c } ; ---- -- : NP -> Adv -> NP ; -- Paris today ; boys, such as .. - --AdvNP,ExtAdvNP = \np,adv -> np ** {} ; + AdvNP,ExtAdvNP = \np,adv -> np ** { + s = \\pos => np.s ! pos ++ adv.s + } ; -- : NP -> RS -> NP ; -- Paris, which is here RelNP np rs = np ** { @@ -51,7 +52,7 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in { -- : Det -> NP ; DetNP det = emptyNP ** { - s = \\_ => det.s ; + s = \\_ => linDet det ; } ; -- MassNP : CN -> NP ; @@ -68,13 +69,17 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in { DetQuant quant num = quant ** { pr = num.s ; -- if it's not a number or digit, num.s is empty s = quant.s ; - n = num.n + n = num.n ; + count = "ke" ++ BIND ++ num.s ++ BIND ++ "-" ++ BIND ++ num.s; } ; - -- : Quant -> Num -> Ord -> Det ; -- these five best - -- DetQuantOrd quant num ord = - -- let theseFive = DetQuant quant num in theseFive ** { - -- } ; + -- : Quant -> Num -> Ord -> Det ; + DetQuantOrd quant num ord = quant ** { + pr = num.s ; + n = num.n ; + s = ord.s ++ quant.s ; + count = "" ; + } ; -- Whether the resulting determiner is singular or plural depends on the -- cardinal. @@ -107,18 +112,21 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in { OrdDigits digs = digs ** { s = digs.s ! NOrd } ; -} -- : Numeral -> Ord ; - -- OrdNumeral num = num ** { - -- s = \\_ => num.ord - -- } ; + OrdNumeral num = { + s = num.ord + } ; -- : A -> Ord ; - -- OrdSuperl a = { - -- } ; + OrdSuperl a = { + s = "ter" ++ BIND ++ a.s + } ; -- One can combine a numeral and a superlative. -- : Numeral -> A -> Ord ; -- third largest - -- OrdNumeralSuperl num a = num ** { } ; + OrdNumeralSuperl num a = { + s = num.ord ++ "ter" ++ BIND ++ a.s + } ; -- : Quant DefArt = mkQuant [] ; @@ -167,6 +175,11 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in { heavyMod = cn.heavyMod ++ rs.s ! P3 } ; + -- : CN -> Adv -> CN ; + AdvCN cn adv = cn ** { + heavyMod = cn.heavyMod ++ adv.s + } ; + {- -- : CN -> Adv -> CN ; AdvCN cn adv = cn ** { } ; @@ -199,6 +212,14 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in { } } ; + + -- : Det -> NP -> NP ; + CountNP det np = np ** + { + s = \\pos => det.count ++ np.s ! pos; + } ; -- Nonsense for DefArt or IndefArt + + -- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples -- PartNP cn np = cn ** { -- } ; diff --git a/src/malay/NumeralMay.gf b/src/malay/NumeralMay.gf index 1367a5ed..a0d39193 100644 --- a/src/malay/NumeralMay.gf +++ b/src/malay/NumeralMay.gf @@ -96,6 +96,7 @@ oper } ; -- To make Sub* funs directly from a string. + -- ordnumeral from here mkNum : Str -> LinNumber = \s -> { n = Pl ; s = \\_ => s ; -- Indep vs. Attrib only matters for number 1 diff --git a/src/malay/ParadigmsMay.gf b/src/malay/ParadigmsMay.gf index 4e8cd867..2d20d248 100644 --- a/src/malay/ParadigmsMay.gf +++ b/src/malay/ParadigmsMay.gf @@ -9,6 +9,7 @@ oper -- should always use these constants instead of the constructors -- defined in $ResSom$. +noPrep : Prep = mkPrep "" ; --2 Nouns @@ -26,7 +27,9 @@ oper mkA : (adj : Str) -> A ; } ; - -- mkA2 : Str -> Prep -> A2 ; + mkA2 : overload { + mkA2 : (adj : Str) -> Prep -> A2 ; + } ; --2 Verbs @@ -56,8 +59,10 @@ oper -- = \s -> lin VA (regV s) ; -- mkVQ : Str -> VQ -- = \s -> lin VQ (regV s) ; - -- mkVS : Str -> VS - -- = \s -> lin VS (regV s) ; + mkVS : overload { + mkV : (root : Str) -> V ; -- Verb that takes meng as a active prefix + mkV : (root : Str) -> Prefix -> V -- Root and prefix + } ; -- -- mkV2A : Str -> V2A -- = \s -> lin V2A (regV s ** {c2 = noPrep}) ; @@ -93,6 +98,7 @@ oper mkN = overload { mkN : Str -> N = \s -> lin N (mkNoun s) ; + mkN : Str -> Animacy -> N = \s,a -> lin N (mkNoun s) ; } ; @@ -101,6 +107,12 @@ oper mkN2 : N -> N2 = \n -> lin N2 (n ** {c2 = dirPrep}) ; } ; + mkN3 = overload { + mkN3 : Str -> N3 = \s -> lin N3 (mkNoun s ** {c2,c3 = dirPrep}) ; + mkN3 : N -> N3 = \n -> lin N3 (n ** {c2,c3 = dirPrep}) ; + mkN3 : N -> Prep -> Prep -> N3 = \n,c2,c3 -> lin N3 (n ** {c2,c3 = dirPrep}) ; + } ; + mkPN = overload { mkPN : Str -> PN = \s -> lin PN {s = \\_ => s} ; } ; @@ -109,6 +121,11 @@ oper mkA : (adj : Str) -> A = \s -> lin A (mkAdj s) ; } ; + mkA2 = overload { + mkA2 : (adj : Str) -> A = \s -> lin A2 (mkAdj s) ; + mkA2 : A -> Prep -> A = \a,p -> lin A2 (a) ; + } ; + mkV = overload { mkV : Str -> V = \v -> lin V (mkVerb v Ber) ; mkV : Str -> Prefix -> V = \v,p -> lin V (mkVerb v p) @@ -133,6 +150,12 @@ oper lin V3 (mkVerb3 v p q) } ; + mkV4 = overload { + mkV4 : Str -> Str -> V2 = \v2,str -> + lin V2 (mkVerb4 (mkVerb v2 Meng) dirPrep str) ; + mkV4 : V -> Prep -> Str -> V2 = \v,p,str -> lin V2 (mkVerb4 v p str) + } ; + mkVV = overload { mkVV : Str -> VV = \vv -> lin VV (ss vv) } ; diff --git a/src/malay/ParamMay.gf b/src/malay/ParamMay.gf index abe7164d..0c153302 100644 --- a/src/malay/ParamMay.gf +++ b/src/malay/ParamMay.gf @@ -85,6 +85,8 @@ param NPAgr = NotPron | IsPron Person ; + Animacy = Animate | Inanimate ; + oper poss2str : Possession -> Str = \p -> case p of { Bare => [] ; @@ -130,12 +132,17 @@ param param PrepType = DirObj | EmptyPrep | OtherPrep ; + +-------------------------------------------------------------------------------- +-- Adverbs + -------------------------------------------------------------------------------- -- Verbs param VForm = Root -- infinitive, imperative, … | Active + | Imperative ; Prefix = diff --git a/src/malay/PhraseMay.gf b/src/malay/PhraseMay.gf index cb594393..6f5dd9ed 100644 --- a/src/malay/PhraseMay.gf +++ b/src/malay/PhraseMay.gf @@ -8,16 +8,15 @@ concrete PhraseMay of Phrase = CatMay ** open Prelude, ResMay in { UttIAdv iadv = iadv ; UttNP np = {s = np.s ! Bare} ; UttIP ip = {s = ip.sp ! NF Sg Bare} ; + UttImpSg pol imp = { s = pol.s ++ imp.s ! Sg ! pol.p } ; + UttImpPol pol imp = {s = pol.s ++ imp.s ! Sg ! pol.p} ; + UttVP vp = {s = linVP vp} ; + UttAP ap = { s = ap.s } ; {- - UttImpSg pol imp = UttImpPl pol imp = - UttImpPol = UttImpSg ; - - UttVP vp = {s = } ; UttAdv adv = {s = } ; UttCN n = {s = } ; UttCard n = {s = } ; - UttAP ap = { s = ap.s ! } ; UttInterj i = i ; -} NoPConj = {s = []} ; diff --git a/src/malay/QuestionMay.gf b/src/malay/QuestionMay.gf index ba6cab1a..17d03521 100644 --- a/src/malay/QuestionMay.gf +++ b/src/malay/QuestionMay.gf @@ -21,7 +21,8 @@ lin -- if isPre is True, then: "berapa kucing" s = case iquant.isPre of { False => iquant.s ; True => [] }; -- if isPre is False, use s: "kucing berapa" - n = num.n + n = num.n ; + count = "" ; } ; -- : IP -> ClSlash -> QCl ; -- whom does John love @@ -59,7 +60,6 @@ lin } ; } ; - -- : IP -> IComp ; CompIP ip = {s = ip.s ! Bare } ; -- who (is it) diff --git a/src/malay/RelativeMay.gf b/src/malay/RelativeMay.gf index d9cc71a0..b060c6eb 100644 --- a/src/malay/RelativeMay.gf +++ b/src/malay/RelativeMay.gf @@ -3,33 +3,36 @@ concrete RelativeMay of Relative = CatMay ** open lin - -- : Cl -> RCl ; -- such that John loves her - -- RelCl cl = ; + -- : Cl -> RCl ; -- such that John loves her + -- RelCl cl = cl ** { + -- subj = cl.subj ; + -- pred = cl.pred ; + -- }; -- : RP -> VP -> RCl ; RelVP rp vp = { subj = rp.s ; - pred = \\per => vp.s ! Root ; + pred = \\per,pol => vp.s ! Active ! pol; } ; -- : RP -> ClSlash -> RCl ; -- who I went with RelSlash rp cls = { subj = rp.s -- yang - ++ cls.subj ; -- saya + ++ cls.subj ; -- aku pred = \\per,pol => let object : Str = case cls.c2.prepType of { OtherPrep => cls.c2.obj ! per ; -- depends on the head, not known yet _ => [] -- if the preposition is dir.obj or empty, no obj. pronoun } ; - in cls.pred ! Root ! pol -- ikut sama + in cls.pred ! Active ! pol -- ikut sama ++ object -- dengan+nya } ; -- : RP ; IdRP = {s = "yang"} ; - -- Mintz page 49: Saya jumpa orang /yang kaki+nya/ patah. + -- Mintz page 49: aku jumpa orang /yang kaki+nya/ patah. -- 'I met a man /whose foot/ was broken.' -- : Prep -> NP -> RP -> RP ; -- the mother of whom -- FunRP prep np rp = {} ; diff --git a/src/malay/ResMay.gf b/src/malay/ResMay.gf index b2c0d878..307a7e6f 100644 --- a/src/malay/ResMay.gf +++ b/src/malay/ResMay.gf @@ -60,6 +60,12 @@ oper empty = [] } ; + mkNounPhrase : Str -> NounPhrase = \str -> { + s = \\_ => str ; + a = NotPron ; + empty = [] + } ; + mkIP : Str -> IPhrase = \str -> { s = \\_ => str ; a = NotPron ; @@ -81,9 +87,14 @@ oper isPre : Bool ; } ; + linDet : Determiner -> Str = \det -> det.pr ++ det.s ; + +-- add field in determiner for kedua-dua numbers + Determiner : Type = Quant ** { pr : Str ; -- prefix for numbers n : NumType ; -- number as in 5 (noun in singular), Sg or Pl + count: Str ; } ; CardNum : Type = { @@ -127,16 +138,17 @@ oper sp = \\_ => str } ; - mkDet : Str -> Number -> Determiner = \str, num -> mkQuant str ** { + mkDet : Str -> Str -> Number -> Determiner = \cnt, str, num -> mkQuant str ** { pr = "" ; n = NoNum num ; + count = "" ; } ; - mkIdet : Str -> Str -> Number -> Bool -> Determiner = \str, standalone, num, isPre -> mkDet str num ** { + mkIdet : Str -> Str -> Str -> Number -> Bool -> Determiner = \cnt, str, standalone, num, isPre -> mkDet cnt str num ** { pr = case isPre of {True => str ; False => [] } ; -- if isPre is True, then: "berapa kucing" s = case isPre of { False => str ; True => [] }; - + count = cnt ; sp = \\_ => standalone ; } ; @@ -209,23 +221,35 @@ oper c3 : Preposition } ; + Verb4 : Type = Verb ** { + c2 : Preposition ; + passive : Str + } ; + -- VV : Type = Verb ** {vvtype : VVForm} ; mkVerb : Str -> Prefix -> Verb = \str,p -> { s = table { Root => str ; - Active => prefix p str + Active => prefix p str ; + Imperative => str ++ BIND ++ "kan" } } ; mkVerb2 : Verb -> Preposition -> Verb2 = \v,pr -> v ** { c2 = pr ; - passive = "di" + v.s ! Root -- TODO check + passive = "di" ++ BIND ++ v.s ! Root } ; mkVerb3 : Verb -> (p,q : Preposition) -> Verb3 = \v,p,q -> mkVerb2 v p ** {c3 = q} ; + mkVerb4 : Verb -> Preposition -> Str -> Verb4 = \v,pr,str -> v ** { + s = \\_ => v.s ! Active ++ str; + c2 = pr ; + passive = "di" ++ BIND ++ v.s ! Root ++ str + } ; + copula : Verb = {s = \\_ => "ada"} ; -- TODO ------------------ -- Adv @@ -259,6 +283,9 @@ oper s = \\vf,pol => nounneg pol ++ s ; } ; + linVP : VerbPhrase -> Str = \vp -> vp.s ! Active ! Pos; + +-- https://www.reddit.com/r/indonesian/comments/gsizsv/when_to_use_tidak_bukan_jangan_belum/ verbneg : Polarity -> Str = \pol -> case pol of { Neg => "tidak" ; -- or "tak"? @@ -269,6 +296,11 @@ oper Neg => "bukan" ; Pos => [] } ; + + impneg : Polarity -> Str = \pol -> case pol of { + Neg => "jangan" ; + Pos => [] + } ; -------------------------------------------------------------------------------- -- Cl, S diff --git a/src/malay/SentenceMay.gf b/src/malay/SentenceMay.gf index 1222e02e..c82ae487 100644 --- a/src/malay/SentenceMay.gf +++ b/src/malay/SentenceMay.gf @@ -24,6 +24,19 @@ lin -- : Cl -> Prep -> ClSlash ; -- (with whom) he walks SlashPrep cl prep = cl ** {c2 = prep} ; + +--2 Imperatives + -- : VP -> Imp ; + ImpVP vp = { + s = \\num,pol => case pol of { + Neg => "jangan" ++ vp.s ! Imperative ! Pos; + Pos => vp.s ! Imperative ! Pos + } + } ; + + -- : VP -> SC ; + EmbedVP vp = {s = vp.s ! Root ! Pos} ; + {- -- : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves SlashVS np vs ss = {} ; @@ -34,7 +47,7 @@ lin --2 Imperatives -- : VP -> Imp ; - ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ; + -- ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ; --2 Embedded sentences diff --git a/src/malay/StructuralMay.gf b/src/malay/StructuralMay.gf index d41a0cd8..3a5430df 100644 --- a/src/malay/StructuralMay.gf +++ b/src/malay/StructuralMay.gf @@ -55,15 +55,14 @@ lin and_Conj = {s2 = "dan" ; s1 = [] ; n = Pl} ; ----------------- -- *Det and Quant - -lin how8many_IDet = mkIdet "berapa" "berapa banyak" Sg True; +lin how8many_IDet = mkIdet "berapa" "berapa banyak" "" Sg True; +lin every_Det = mkDet "semua" "semua" Sg ; -- to check {-} lin all_Predet = {s = ""} ; lin not_Predet = { s = "" } ; lin only_Predet = { s = "" } ; lin most_Predet = {s = ""} ; -lin every_Det = {s = ""} ; lin few_Det = R.indefDet "" pl ; lin many_Det = R.indefDet "" pl ; lin much_Det = R.indefDet "" sg ; @@ -78,6 +77,9 @@ lin which_IQuant = mkQuant "yang mana" ** {isPre = False} ; ----- -- NP + +lin somebody_NP = mkNounPhrase "seorang" ; --todo + {- lin everybody_NP = defNP "" N.NumPl ; lin everything_NP = defNP "" N.NumSg ; @@ -110,7 +112,18 @@ lin in_Prep = mkPrep "di" ; -- lin part_Prep = mkPrep ; lin possess_Prep = mkPrep [] ; -- TODO check Mintz p. 39-40, 2.2.1.2 -- lin through_Prep = mkPrep ; -lin to_Prep = mkPrep "ke" ; +-- lin to_Prep = mkPrep "ke" ; +lin to_Prep = + let ke : Preposition = mkPrep "ke"; + kepada : Preposition = mkPrep "kepada" ; + in ke ** { + obj = kepada.obj + } ; + +-- lin have_V2 = let have' : V2 = mkV2 "ada" in have' ** { +-- s = \\_ => "ada" ; +-- passive = "diadakan" ; +-- } ; -- lin under_Prep = mkPrep "" ; lin with_Prep = mkPrep "dengan" ; -- lin without_Prep = mkPrep "" ; @@ -120,9 +133,9 @@ lin with_Prep = mkPrep "dengan" ; -- Pronouns are closed class, no constructor in ParadigmsMay. lin it_Pron = mkPron "dia" P3 ; -lin i_Pron = mkPron "saya" P1 ; +lin i_Pron = mkPron "aku" P1 ; lin youPol_Pron = mkPron "kamu" P2 ; -lin youSg_Pron = mkPron "awak" P2 ; +lin youSg_Pron = mkPron "kamu" P2 ; lin he_Pron = mkPron "dia" P3 ; lin she_Pron = mkPron "dia" P3 ; -- inclusive we @@ -163,8 +176,8 @@ lin have_V2 = let have' : V2 = mkV2 "ada" in have' ** { passive = "diadakan" ; } ; -- lin can8know_VV = can_VV ; -- can (capacity) --- lin can_VV = mkVV "" ; -- can (possibility) --- lin must_VV = mkVV "" ; +lin can_VV = mkVV "boleh" ; -- can (possibility) +lin must_VV = mkVV "perlu" ; lin want_VV = mkVV "mahu" ; ------ diff --git a/src/malay/VerbMay.gf b/src/malay/VerbMay.gf index 3dbf8cba..b6985a83 100644 --- a/src/malay/VerbMay.gf +++ b/src/malay/VerbMay.gf @@ -16,7 +16,7 @@ lin -- : VV -> VP -> VP ; ComplVV vv vp = vp ** useV { - s = \\vf => vv.s ++ vp.s ! Root ! Pos + s = \\vf => vv.s ++ linVP vp } ; -- : VS -> S -> VP ; @@ -54,12 +54,11 @@ lin -- : V3 -> NP -> VPSlash ; -- give (it) to her Slash3V3 v3 iobj = useV { - s = \\vf => v3.s ! vf ++ iobj.s ! Bare ++ applyPrep v3.c3 emptyNP; + s = \\vf => v3.s ! vf ++ applyPrep v3.c3 emptyNP ++ iobj.s ! Bare; --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 adjCompl = [] - } ; -- insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp -> @@ -101,6 +100,13 @@ lin adjCompl = vps.adjCompl ; } ; + -- SlashVV vv vp = vp ** useV { + -- s = \\vf => vv.s ++ linVP vp ; + -- c2 = vp.c2 ; + -- passive = vv.s ++ vp.passive; + -- adjCompl = vp.adjCompl ; + -- } ; + -- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy -- SlashV2VNP v2v np vps = @@ -112,6 +118,11 @@ lin s = \\vf,pol => vp.s ! vf ! pol ++ adv.s } ; + -- : AdV -> VP -> VP ; -- always sleep + AdVVP adv vp = vp ** { + s = \\vf,pol => vp.s ! vf ! pol ++ adv.s + } ; + {- -- : VPSlash -> Adv -> VPSlash ; -- use (it) here AdvVPSlash = insertAdv ; @@ -119,9 +130,6 @@ lin -- : VP -> Adv -> VP ; -- sleep , even though ... ExtAdvVP vp adv = ; - -- : AdV -> VP -> VP ; -- always sleep - AdVVP adv vp = vp ** {adv = adv} ; - -- : AdV -> VPSlash -> VPSlash ; -- always use (it) AdVVPSlash adv vps = vps ** { adv = adv.s ++ vps.adv } ; -} diff --git a/src/malay/unittest/complements.gftest b/src/malay/unittest/complements.gftest index cc437dd3..04cfc950 100644 --- a/src/malay/unittest/complements.gftest +++ b/src/malay/unittest/complements.gftest @@ -3,4 +3,4 @@ Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlas LangMay: dia memberi kucing kepadaku Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (Slash3V3 give_V3 (UsePron i_Pron)) (MassNP (UseN cat_N))))) -LangMay: dia memberi saya kucing +LangMay: dia memberi aku kucing diff --git a/src/malay/unittest/numerals.gftest b/src/malay/unittest/numerals.gftest index b6bc7744..97472829 100644 --- a/src/malay/unittest/numerals.gftest +++ b/src/malay/unittest/numerals.gftest @@ -8,4 +8,32 @@ LangMay: lima kucing ini Lang: DetCN (DetQuant (PossPron i_Pron) (NumCard (NumNumeral (num (pot2as3 (pot2 (pot0 n7))))))) (UseN cat_N) LangEng: my seven hundred cats -LangMay: tujuh ratus kucing saya +LangMay: tujuh ratus kucing aku + +Lang: AdjCN (AdjOrd (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))))) (UseN cat_N) +LangEng: second cat +LangMay: kucing kedua + +Lang: DetQuantOrd IndefArt NumPl (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2)))))) +LangEng: second +LangMay: kedua + +Lang: UttNP (DetCN (DetQuantOrd (PossPron i_Pron) NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))))) (UseN cat_N)) +LangEng: my second cat +LangMay: kucing kedua aku + +Lang: UttNP (DetCN (DetQuantOrd (PossPron i_Pron) (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))))) (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))))) (UseN cat_N)) +LangEng: my two second cats +LangMay: dua kucing kedua aku + +Lang: CountNP (DetQuant IndefArt (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2)))))))) (DetCN (DetQuant (PossPron i_Pron) NumPl) (UseN cat_N)) +LangEng: two of my cats +LangMay: kedua-dua kucing aku + +Lang: MassNP (AdjCN (AdjOrd (OrdNumeralSuperl (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3))))) big_A)) (UseN cat_N)) +LangEng: third biggest cat +LangMay: kucing ketiga terbesar + +Lang: MassNP (AdjCN (AdjOrd (OrdSuperl big_A)) (UseN cat_N)) +LangEng: biggest cat +LangMay: kucing terbesar \ No newline at end of file diff --git a/src/malay/unittest/passive.gftest b/src/malay/unittest/passive.gftest index 4b69b4a3..d0df9e0f 100644 --- a/src/malay/unittest/passive.gftest +++ b/src/malay/unittest/passive.gftest @@ -1,11 +1,19 @@ Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN dog_N)) (PassV2 love_V2)) LangEng: that dog is loved -LangMay: anjing itu dicinta +LangMay: anjing itu dicintai Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN dog_N)) (PassV2 love_V2)) LangEng: that dog isn't loved -LangMay: anjing itu tidak dicinta +LangMay: anjing itu tidak dicintai Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN dog_N)) (ComplVV want_VV (PassV2 love_V2))) LangEng: that dog doesn't want to be loved -LangMay: anjing itu tidak mahu dicinta \ No newline at end of file +LangMay: anjing itu tidak mahu dicintai + +Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN book_N)) (PassV2 read_V2)) +LangEng: that book is read +LangMay: buku itu dibaca + +Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN book_N)) (AdvVP (PassV2 read_V2) (PrepNP to_Prep (UsePron youSg_Pron)))) +LangEng: that book is read to you +LangMay: buku itu dibacakan kepada kamu \ No newline at end of file diff --git a/src/malay/unittest/pronouns.gftest b/src/malay/unittest/pronouns.gftest index defa44a4..daededd0 100644 --- a/src/malay/unittest/pronouns.gftest +++ b/src/malay/unittest/pronouns.gftest @@ -14,18 +14,18 @@ LangMay: kucing-kucingku dengan orang itu -- to get "memukulnya", we need to define it in the entry of hit_V2 at the moment. -- if that should be variable on a more general level, let me know. Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a hit_V2) (UsePron he_Pron))) -LangMay: saya memukul dia +LangMay: aku memukul dia ------------- -- Possession -- that is my cat Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetNP (DetQuant that_Quant NumSg)) (UseComp (CompNP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N))))) -LangMay: itu kucing saya +LangMay: itu kucing aku -- that cat is mine Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN cat_N)) (UseComp (CompNP (DetNP (DetQuant (PossPron i_Pron) NumSg))))) -LangMay: kucing itu saya +LangMay: kucing itu aku -- his/her cat is green Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron he_Pron) NumSg) (UseN cat_N)) (UseComp (CompAP (PositA green_A)))) @@ -33,14 +33,14 @@ LangMay: kucing dia hijau -- I read his/her book -- two variants, different trees Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant IndefArt NumSg) (PossNP (UseN book_N) (UsePron she_Pron))))) -LangMay: saya membaca bukunya +LangMay: aku membaca bukunya Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant (PossPron he_Pron) NumSg) (UseN book_N)))) -LangMay: saya membaca buku dia +LangMay: aku membaca buku dia -- I read his/her father's book Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (PossNP (UseN book_N) (DetCN (DetQuant DefArt NumSg) (PossNP (UseN2 father_N2) (UsePron she_Pron))))))) -LangMay: saya membaca buku bapanya +LangMay: aku membaca buku bapanya -- Only the noun phrase Lang: MassNP (PossNP (UseN book_N) (UsePron he_Pron)) @@ -66,4 +66,4 @@ LangMay: kucingku dia Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (PossNP (UseN cat_N) (UsePron she_Pron)) LangEng: my cat of hers -LangMay: kucingnya saya +LangMay: kucingnya aku diff --git a/src/malay/unittest/questions.gftest b/src/malay/unittest/questions.gftest index cdac74cf..76c47836 100644 --- a/src/malay/unittest/questions.gftest +++ b/src/malay/unittest/questions.gftest @@ -16,11 +16,11 @@ LangMay: berapa banyak kucing Lang: UseQCl (TTAnt TPres ASimul) PPos (QuestCl (PredVP (UsePron youSg_Pron) (ComplSlash (SlashV2a teach_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))) LangEng: do you teach the cat -LangMay: adakah awak mengajar kucing +LangMay: adakah kamu mengajar kucing Lang: UseQCl (TTAnt TPres ASimul) PNeg (QuestCl (PredVP (UsePron youSg_Pron) (ComplSlash (SlashV2a teach_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))) LangEng: don't you teach the cat -LangMay: adakah awak tidak mengajar kucing +LangMay: adakah kamu tidak mengajar kucing Lang: UseQCl (TTAnt TPres ASimul) PPos (QuestVP (IdetCN (IdetQuant which_IQuant NumSg) (UseN cat_N)) (ComplSlash (SlashV2a teach_V2) (UsePron he_Pron))) LangEng: which cat teaches him @@ -28,19 +28,19 @@ LangMay: kucing yang mana mengajar dia Lang: UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv where_IAdv (PredVP (UsePron youSg_Pron) (UseV go_V))) LangEng: where did you go -LangMay: awak pergi mana +LangMay: kamu pergi mana Lang: UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv why_IAdv (PredVP (UsePron youSg_Pron) (UseV go_V))) LangEng: why did you go -LangMay: mengapa awak pergi +LangMay: mengapa kamu pergi Lang: UseQCl (TTAnt TPast ASimul) PNeg (QuestIAdv why_IAdv (PredVP (UsePron youSg_Pron) (UseV go_V))) LangEng: why didn't you go -LangMay: mengapa awak tidak pergi +LangMay: mengapa kamu tidak pergi Lang: UseQCl (TTAnt TPast ASimul) PPos (QuestSlash (IdetCN (IdetQuant which_IQuant NumSg) (UseN woman_N)) (SlashVP (UsePron youSg_Pron) (SlashV2a see_V2))) LangEng: which woman did you see -LangMay : awak melihat perempuan yang mana +LangMay : kamu 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))))) @@ -50,7 +50,7 @@ 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 +LangMay: ibu bercakap tentang daging dengan siapa Lang: UseQCl (TTAnt TPres ASimul) PPos (QuestVP whoSg_IP (ComplVV want_VV (UseV go_V))) LangEng: who wants to go @@ -62,7 +62,7 @@ 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 +LangMay: bagaimana ibu kamu 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 diff --git a/src/malay/unittest/relative.gftest b/src/malay/unittest/relative.gftest index 47b3b5fe..be6748d6 100644 --- a/src/malay/unittest/relative.gftest +++ b/src/malay/unittest/relative.gftest @@ -3,7 +3,7 @@ Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V)))) LangEng: a cat that walks -LangMay: kucing yang jalan +LangMay: kucing yang berjalan Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N)))))) LangEng: a cat that drinks milk @@ -17,7 +17,7 @@ LangMay: susu yang kucing minum -- We can find another RGL tree that produces the more natural variant. This tree produces this variant. Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashPrep (PredVP (DetCN (DetQuant DefArt NumSg) (UseN dog_N)) (UseV walk_V)) with_Prep)))) LangEng: the cat that the dog walks with -LangMay: kucing yang anjing jalan dengannya +LangMay: kucing yang anjing berjalan dengannya -------------------------------------------------------------- -- Determiner placement @@ -25,30 +25,31 @@ LangMay: kucing yang anjing jalan dengannya -- TODO check determiner placement? Lang: DetCN (DetQuant this_Quant NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V)))) LangEng: this cat that walks -LangMay: kucing ini yang jalan +LangMay: kucing ini yang berjalan Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N)))))) LangEng: my cat that drinks milk -LangMay: kucing saya yang minum susu +LangMay: kucing aku yang minum susu -- TODO verb form? Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetNP (DetQuant this_Quant NumSg)) (UseComp (CompNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V)))))))) LangEng: this is the cat that walks -LangMay: ini kucing yang jalan +LangMay: ini kucing yang berjalan -------------------------------------------------------------- -- Complex example: "the book that his/her father gave him/her" -- 1. His father gave him a book +-- should be "memberikan buku" as book is dead Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (MassNP (ComplN2 father_N2 (UsePron he_Pron))) (ComplSlash (Slash2V3 give_V3 (MassNP (UseN book_N))) (UsePron he_Pron))) LangMay: bapanya memberi buku kepadanya -- 2. A book that her father gave her -- TODO: would it be better as "buku yang bapanya beri kepadanya"? (Or any other variation?) Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron she_Pron))) (Slash3V3 give_V3 (UsePron she_Pron)))))) -LangMay: buku yang bapanya beri dia +LangMay: buku yang bapanya memberi kepada dia -- The preposition "kepada" comes from the definition of give_V3 in LexiconMay.gf. -- If "buku yang bapanya beri kepadanya" is correct in general, but sometimes @@ -61,14 +62,14 @@ LangMay: buku yang bapanya beri dia -- then we can do it in the resource grammar. -- I want to read the book that my father gave me --- TODO check: would "saya mahu baca buku yang bapaku beri kepadaku" be better? +-- TODO check: would "aku mahu baca buku yang bapaku beri kepadaku" be better? Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashVV want_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron i_Pron))) (Slash3V3 give_V3 (UsePron i_Pron))))))))) -LangMay: saya mahu baca buku yang bapaku beri saya +LangMay: aku mahu membaca buku yang bapaku memberi kepada aku -- I want to read the book that my father read Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashVV want_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron i_Pron))) (SlashV2a read_V2)))))))) -LangMay: saya mahu baca buku yang bapaku baca +LangMay: aku mahu membaca buku yang bapaku membaca --- bonus tree: we can also generate "bapa saya", not just "bapaku" +-- bonus tree: we can also generate "bapa aku", not just "bapaku" Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 father_N2)) (SlashV2a read_V2))))))))) -LangMay: saya mahu baca buku yang bapa saya baca \ No newline at end of file +LangMay: aku mahu membaca buku yang bapa aku membaca \ No newline at end of file diff --git a/src/malay/unittest/tenses.gftest b/src/malay/unittest/tenses.gftest index b0447dd1..51ef0bf6 100644 --- a/src/malay/unittest/tenses.gftest +++ b/src/malay/unittest/tenses.gftest @@ -18,8 +18,11 @@ LangMay: kucing akan berjalan Lang: ExtAdvS (SubjS if_Subj (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (UseV walk_V)))) (UseCl (TTAnt TCond ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V))) LangEng: if I walked , the cat would walk -LangMay: sekiranya saya berjalan , kucing akan berjalan +LangMay: sekiranya aku berjalan , kucing akan berjalan Lang: ExtAdvS (SubjS when_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV walk_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V))) LangEng: when I walk , the cat will walk -LangMay: kalau saya berjalan , kucing akan berjalan +LangMay: kalau aku berjalan , kucing akan berjalan + +--- + diff --git a/src/malay/unittest/verbal_affixes.gftest b/src/malay/unittest/verbal_affixes.gftest index 75359c63..26e1c5df 100644 --- a/src/malay/unittest/verbal_affixes.gftest +++ b/src/malay/unittest/verbal_affixes.gftest @@ -9,42 +9,41 @@ Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)) (UseV walk_V))) LangEng: my cat walks -LangMay: kucing saya berjalan +LangMay: kucing aku berjalan -- As a verbal complement Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)) (ComplVV want_VV (UseV walk_V)))) LangEng: my cat wants to walk -LangMay: kucing saya mahu jalan +LangMay: kucing aku mahu berjalan -- Transitive verbs Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant this_Quant NumSg) (UseN book_N))))) LangEng: I read this book -LangMay: saya membaca buku ini +LangMay: aku membaca buku ini -- As a verbal complement Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant this_Quant NumSg) (UseN book_N)))))) LangEng: I want to read this book -LangMay: saya mahu baca buku ini +LangMay: aku mahu membaca buku ini -- How about words like mengajar and belajar? Is the prefix more important here? Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplSlash (SlashV2a learn_V2) (MassNP (UseN science_N))) (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN school_N)))))) LangEng: I learn science in the school -LangMay: saya belajar sains di sekolah +LangMay: aku belajar sains di sekolah Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplSlash (SlashV2a teach_V2) (MassNP (UseN science_N))) (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN school_N)))))) LangEng: I teach science in the school -LangMay: saya mengajar sains di sekolah +LangMay: aku mengajar sains di sekolah --- The way the grammar is currently defined, we'd get the same output for both "I want to learn/study science". Is this correct, or should one or both of the verbs keep the ber/meng prefix in this context? Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplVV want_VV (ComplSlash (SlashV2a teach_V2) (MassNP (UseN science_N)))) (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN school_N)))))) LangEng: I want to teach science in the school -LangMay: saya mahu ajar sains di sekolah +LangMay: aku mahu mengajar sains di sekolah Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplVV want_VV (ComplSlash (SlashV2a learn_V2) (MassNP (UseN science_N)))) (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN school_N)))))) LangEng: I want to learn science in the school -LangMay: saya mahu belajar sains di sekolah +LangMay: aku mahu belajar sains di sekolah -- How about interaction with passive? These sentences are very artificial, but imagine they made sense: Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN book_N)) (AdvVP (PassV2 learn_V2) (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN school_N))))))) NoVoc @@ -62,12 +61,12 @@ LangMay: buku ini diajar di sekolah Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V)))) LangEng: a cat that walks -LangMay: kucing yang jalan +LangMay: kucing yang berjalan -- In a context Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V)))))))) LangEng: I buy a cat that walks -LangMay: saya membeli kucing yang jalan +LangMay: aku membeli kucing yang berjalan -- Transitive verbs @@ -84,11 +83,11 @@ LangMay: susu yang kucing minum -- Both in context Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N)))))))))) LangEng: I buy a cat that drinks milk -LangMay: saya membeli kucing yang minum susu +LangMay: aku membeli kucing yang minum susu Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a buy_V2) (MassNP (RelCN (UseN milk_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)) (SlashV2a drink_V2))))))))) LangEng: I buy milk that a cat drinks -LangMay: saya membeli susu yang kucing minum +LangMay: aku membeli susu yang kucing minum ---------------------------------------- @@ -102,11 +101,21 @@ LangMay: hujan sekarang -- In a context Lang: UttS (AdvS (SubjS if_Subj (UseCl (TTAnt TPast ASimul) PNeg (ImpersCl (UseV rain_V0)))) (ExtAdvS now_Adv (UseCl (TTAnt TCond ASimul) PPos (PredVP (UsePron i_Pron) (UseV walk_V))))) LangEng: if it didn't rain now , I would walk -LangMay: sekiranya tidak hujan sekarang , saya akan berjalan +LangMay: sekiranya tidak hujan sekarang , aku akan berjalan ---------------------------------------- -- Imperative +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a open_V2) (DetCN (DetQuant DefArt NumSg) (UseN door_N)))) +LangEng: open the door +LangMay: buka pintu +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a open_V2) (DetCN (DetQuant DefArt NumSg) (UseN door_N)))) +LangEng: don't open the door +LangMay: jangan buka pintu + +Lang: UttImpPol PPos (ImpVP (ComplSlash (SlashV2a open_V2) (DetCN (DetQuant DefArt NumSg) (UseN door_N)))) +LangEng: open the door +LangMay: bukakan pintu ---------------------------------------- -- Questions