diff --git a/src/english/NounEng.gf b/src/english/NounEng.gf index 7b254250..848b2196 100644 --- a/src/english/NounEng.gf +++ b/src/english/NounEng.gf @@ -56,7 +56,7 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in { DetNP det = { -- s = case det.hasNum of {True => \\_ => det.s ; _ => \\c => det.sp ! c} ; - s = det.sp ! Neutr ! False ; + s = \\c => det.sp ! Neutr ! False ! c ++ "whatevr" ; a = agrP3 det.n } ; diff --git a/src/malay/CatMay.gf b/src/malay/CatMay.gf index 35478cb2..4496f52b 100644 --- a/src/malay/CatMay.gf +++ b/src/malay/CatMay.gf @@ -25,8 +25,8 @@ concrete CatMay of Cat = CommonX ** open ResMay, Prelude in { QCl = ResMay.Clause ; IComp = SS ; -- interrogative complement of copula e.g. "where" IDet = ResMay.Determiner ; -- interrogative determiner e.g. "how many" - IQuant = ResMay.Quant ; -- interrogative quantifier e.g. "which" - IP = ResMay.NounPhrase ; -- interrogative pronoun e.g. "who" + IQuant = ResMay.IQuant ; -- interrogative quantifier e.g. "which" + IP = ResMay.IPhrase ; -- interrogative pronoun e.g. "who" --2 Subord clauses and pronouns diff --git a/src/malay/QuestionMay.gf b/src/malay/QuestionMay.gf index 3a1f0b2e..48757061 100644 --- a/src/malay/QuestionMay.gf +++ b/src/malay/QuestionMay.gf @@ -8,13 +8,24 @@ concrete QuestionMay of Question = CatMay ** open -- determiners, with or without a noun. lin -- : IDet -> CN -> IP ; -- which five songs - IdetCN idet cn = NM.DetCN idet cn ; + IdetCN idet cn = NM.DetCN idet cn ** {sp = idet.sp} ; -- : IDet -> IP ; -- which five - IdetIP idet = NM.DetNP idet ; + IdetIP idet = NM.DetNP idet ** {sp = idet.sp}; -- : IQuant -> Num -> IDet ; -- which (five) - IdetQuant = NM.DetQuant ; + IdetQuant iquant num = iquant ** { + pr = num.s ++ case iquant.isPre of {True => iquant.s ; False => [] } ; + -- 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 + } ; + + -- : IP -> ClSlash -> QCl ; -- whom does John love + QuestSlash ip cls = cls ** { + pred = \\vf,pol => cls.pred ! vf ! pol ++ ip.s ! Bare + } ; {- lin @@ -24,9 +35,6 @@ lin -- : IP -> VP -> QCl ; QuestVP ip vp = - -- : IP -> ClSlash -> QCl ; -- whom does John love - QuestSlash ip cls = - -- : IAdv -> Cl -> QCl ; -- why does John walk QuestIAdv iadv cls = diff --git a/src/malay/ResMay.gf b/src/malay/ResMay.gf index 447726d4..99629be9 100644 --- a/src/malay/ResMay.gf +++ b/src/malay/ResMay.gf @@ -50,6 +50,10 @@ oper empty : Str ; -- need to avoid GF being silly. See https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#metavariables-or-those-question-marks-that-appear-when-parsing } ; + IPhrase : Type = NounPhrase ** { + sp : NForm => Str ; -- standalone berapa banyak kucing + } ; + emptyNP : NounPhrase = { s = \\_ => [] ; a = NotPron ; @@ -60,11 +64,15 @@ oper -- Det, Quant, Card, Ord Quant : Type = { - s : Str ; - sp : NForm => Str ; + s : Str ; -- quantifier in a context, eg. 'berapa (kucing)' + sp : NForm => Str ; -- a standalone, eg. '(kucing) berapa banyak' poss : Possession ; } ; + IQuant : Type = Quant ** { + isPre : Bool ; + } ; + Determiner : Type = Quant ** { pr : Str ; -- prefix for numbers n : NumType ; -- number as in 5 (noun in singular), Sg or Pl @@ -102,6 +110,18 @@ oper sp = \\_ => str } ; + mkDet : Str -> Number -> Determiner = \str, num -> mkQuant str ** { + pr = "" ; + n = NoNum num ; + } ; + + mkIdet : Str -> Number -> Bool -> Determiner = \str, num, isPre -> mkDet str num ** { + pr = case isPre of {True => str ; False => [] } ; + -- if isPre is True, then: "berapa kucing" + s = case isPre of { False => str ; True => [] }; + + } ; + -------------------------------------------------------------------------------- -- Prepositions diff --git a/src/malay/StructuralMay.gf b/src/malay/StructuralMay.gf index 275137d7..23013531 100644 --- a/src/malay/StructuralMay.gf +++ b/src/malay/StructuralMay.gf @@ -52,9 +52,9 @@ lin and_Conj = {s2 = "dan" ; s1 = [] ; n = Pl} ; ----------------- -- *Det and Quant -{- -lin how8many_IDet = ; +lin how8many_IDet = mkIdet "berapa banyak" Pl True; +{-} lin all_Predet = {s = ""} ; lin not_Predet = { s = "" } ; lin only_Predet = { s = "" } ; @@ -71,7 +71,7 @@ lin someSg_Det = lin no_Quant = -} lin that_Quant = mkQuant "itu" ; lin this_Quant = mkQuant "ini" ; -lin which_IQuant = mkQuant "apa" ; +lin which_IQuant = mkQuant "apa" ** {isPre = False} ; ----- @@ -154,7 +154,10 @@ lin language_title_Utt = ss "bahasa Melayu" ; ------- -- Verb ---lin have_V2 = mkV2 have_V ; +lin have_V2 = let have' : V2 = mkV2 "ada" in have' ** { + s = \\_ => "ada" ; + passive = "diadakan" ; +} ; -- lin can8know_VV = can_VV ; -- can (capacity) -- lin can_VV = mkVV "" ; -- can (possibility) -- lin must_VV = mkVV "" ;