Skip to content

Commit

Permalink
Merge pull request #449 from Meowyam/master
Browse files Browse the repository at this point in the history
Updates of passive, SlashV verbs in Malay rgl
  • Loading branch information
inariksit authored Jan 30, 2024
2 parents 9367344 + 196bdcb commit 61bc8e7
Show file tree
Hide file tree
Showing 19 changed files with 130 additions and 61 deletions.
1 change: 1 addition & 0 deletions src/malay/AdjectiveMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ concrete AdjectiveMay of Adjective = CatMay ** open ResMay, Prelude in {

-- : AdA -> AP -> AP ;
-- AdAP ada ap = ap ** { } ;



-- It can also be postmodified by an adverb, typically a prepositional phrase.
Expand Down
4 changes: 4 additions & 0 deletions src/malay/AdverbMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ lin
--AdAdv : AdA -> Adv -> Adv ; -- very quickly
-- AdAdv ada adv = adv **
-- Like adverbs, adadjectives can be produced by adjectives.
AdAdv ada adv = adv ** {
s = ada.s ++ adv.s ;
} ;

-- : A -> AdA ; -- extremely
-- PositAdAAdj a = { } ;
-- PositAdAAdj a = {s = a.s} ;

-- Subordinate clauses can function as adverbs.

Expand Down
18 changes: 18 additions & 0 deletions src/malay/ExtendMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ concrete ExtendMay of Extend = CatMay
, ListVPI -- infinitive VP's (TODO: with anteriority and polarity)
, MkVPS
, PredVPS, RelVPS, QuestVPS, SQuestVPS
, PassVPSlash, PassAgentVPSlash

-- excluded because RGL funs needed for them not implemented yet
, PredAPVP
Expand Down Expand Up @@ -79,6 +80,7 @@ concrete ExtendMay of Extend = CatMay
PastPartAP vp = {
s = linVP vp
} ;

-- GenModNP : Num -> NP -> CN -> NP ; -- this man's car(s)
GenModNP n np cn = variants {};

Expand All @@ -100,6 +102,22 @@ concrete ExtendMay of Extend = CatMay

ByVP vp = cc2 by8means_Prep (GerundAdv vp) ;

-- PassVPSlash : VPS -> VP ;
-- be begged to sleep
PassVPSlash vps = vps ** {
s = \\vf,pol => vps.s ! Passive ! pol ++ vps.adjCompl;
};

-- PassAgentVPSlash : VPSlash -> NP -> VP ; -- be begged by her to go
PassAgentVPSlash vps np = {
s = \\vf,pol => vps.s ! Passive ! pol ++ vps.adjCompl ++ (applyPrep by8agent_Prep np);
};
-- PassAgentVPSlash vps np = {
-- s = \\vf,pol => vps.s ! Passive ! pol ++ (applyPrep by8agent_Prep np) ;
-- };



-- 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
Expand Down
42 changes: 24 additions & 18 deletions src/malay/LexiconMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lin bank_N = mkN "bank" ;
lin beautiful_A = mkA "cantik" ;
-- lin become_VA = mkVA "jadi" ;
lin beer_N = mkN "bir" ;
-- lin beg_V2V = mkV2 "" ;
lin beg_V2V = mkV2 "rayu" ;
-- lin belly_N = mkN "" ;
lin big_A = mkA "besar" ;
lin bike_N = mkN "basikal" ;
Expand Down Expand Up @@ -95,8 +95,9 @@ lin day_N = mkN "hari" ;
-- lin doctor_N = mkN "" ;
lin dog_N = mkN "anjing" ;
lin door_N = mkN "pintu" ;
lin drink_V2 = let drink' : V2 = mkV2 "minum" in drink' ** {
s = \\_ => "minum" ;
lin drink_V2 = let drink' : V2 = mkV2 "minum" in drink' ** { s = table {
Passive => "diminum" ;
_ => "minum"} ;
};
-- lin dry_A = mkA "" ;
-- lin dull_A = mkA "" ;
Expand All @@ -108,7 +109,9 @@ lin drink_V2 = let drink' : V2 = mkV2 "minum" in drink' ** {
-- lin ear_N = mkN "" ;
-- lin earth_N = mkN "" ;
lin eat_V2 = let eat' : V2 = mkV2 "makan" in eat' ** {
s = \\_ => "makan" ;
s = table {
Passive => "dimakan" ;
_ => "makan"} ;
};
-- lin egg_N = mkN "" ;
-- lin empty_A = mkA "" ;
Expand Down Expand Up @@ -208,27 +211,29 @@ lin king_N = mkN "raja" ;
-- lin language_N = mkN "" ;
-- lin laugh_V = mkV "" ;
-- lin leaf_N = mkN "" ;
lin learn_V2 = mkV2 (prefixV (mkV "ajar" Ber)) emptyPrep ;
lin learn_V2 = mkV2 (prefixV (mkV "belajar" NoPrefix)) emptyPrep ;
-- lin leather_N = mkN "" ;
-- lin leave_V2 = mkV2 "" ;
-- lin leg_N = mkN "" ;
-- lin lie_V = mkV "" ;
lin like_V2 = let like' : V2 = mkV2 "suka" in like' ** {
s = \\_ => "suka" ;
passive = "disukai" ;
} ;
s = table {
Passive => "disukai" ;
_ => "suka"} ;
};
-- lin listen_V2 = mkV2 "" ;
-- lin live_V = mkV "";
-- lin liver_N = mkN "" ;
lin long_A = mkA "panjang" ;
-- lin lose_V2 = mkV2 "" ;
-- lin louse_N = mkN "" ;
-- lin love_N = mkN "" ;
-- lin love_V2 = let love' : V2 = mkV2 "cinta" in love' ** {
-- s = \\_ => "mencintai" ;
-- passive = "dicintai" ;
-- } ;
lin love_V2 = mkV4 "cinta" "i";
lin love_V2 = let love' : V2 = mkV2 "cinta" in love' ** {
s = table {
Passive => "dicintai" ;
_ => "mencintai" };
};
-- lin love_V2 = mkV4 "cinta" "i";

----
-- M
Expand Down Expand Up @@ -288,7 +293,7 @@ lin queen_N = mkN "ratu" ;
-- lin radio_N = mkN "" ;
lin rain_N = mkN "hujan" ;
lin rain_V0 = mkV "hujan" ;
lin read_V2 = mkV2 "baca" ;
lin read_V2 = mkV2 (prefixV (mkV "baca" Meng)) emptyPrep ;
-- lin ready_A = mkA "" ;
-- lin reason_N = mkN "" ;
-- lin red_A = mkA "" ;
Expand Down Expand Up @@ -336,7 +341,7 @@ lin sing_V = mkV "nyanyi" ;
-- lin sit_V = mkV "" ;
-- lin skin_N = mkN "" ;
-- lin sky_N = mkN "" ;
-- lin sleep_V = mkV "" ;
lin sleep_V = mkV "tidur" ;
lin small_A = mkA "kecil" ;
-- lin smell_V = mkV "" ;
-- lin smoke_N = mkN "" ;
Expand All @@ -345,7 +350,8 @@ lin small_A = mkA "kecil" ;
-- lin snow_N = mkN "" ;
-- lin sock_N = mkN "" ;
lin song_N = mkN "lagu" ;
-- lin speak_V2 = mkV2 "" ;
lin speak_V2 = mkV2 (prefixV (mkV "cakap" Ber)) emptyPrep ;

-- lin spit_V = mkV "" ;
-- lin split_V2 = mkV2 "" ;
-- lin squeeze_V2 = mkV2 "" ;
Expand All @@ -372,7 +378,7 @@ lin stop_V = mkV "henti" ;
-- lin table_N = mkN "" ;
-- lin tail_N = mkN "" ;
lin talk_V3 = mkV3 (mkV "cakap" Ber) (mkPrep "tentang") (mkPrep "dengan") ;
lin teach_V2 = mkV2 "ajar" ;
lin teach_V2 = mkV2 (prefixV (mkV "ajar" Meng)) emptyPrep;
-- lin teacher_N = mkN "" ;
-- lin television_N = mkN "" ;
-- lin thick_A = mkA "" ;
Expand Down Expand Up @@ -402,7 +408,7 @@ lin ugly_A = mkA "jelek" ;
-- W - Y

-- lin wait_V2 = mkV2 "" ;
lin walk_V = mkV "jalan" ;
lin walk_V = (prefixV (mkV "jalan" Ber)) ;
-- lin war_N = mkN "" ;
-- lin warm_A = mkA "" ;
-- lin wash_V2 = mkV2 "" ;
Expand Down
2 changes: 1 addition & 1 deletion src/malay/NounMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in {
-- TODO classifier is necessary if numeral comes after noun. See Mintz p. 298.
-- ++ if_then_Str (isNum det.n) "buah" [] -- TODO store classifier in CN
++ case det.poss of {
Bare => cn.s ! NF (toNum det.n) poss ;
Bare => cn.s ! NF (toNum det.n) det.poss ;
_ => cn.s ! NF (toNum det.n) det.poss -- TODO check if this make sense
} ++ det.s ++ cn.heavyMod ;
} ;
Expand Down
10 changes: 7 additions & 3 deletions src/malay/ParadigmsMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,16 @@ oper
-- mkVQ : Str -> VQ
-- = \s -> lin VQ (regV s) ;


mkV2A : overload {
mkV2A : Str -> V2A ;
} ;
--
-- mkV2A : Str -> V2A
-- = \s -> lin V2A (regV s ** {c2 = noPrep}) ;
-- mkV2Q : Str -> V2Q
-- = \s -> lin V2Q (regV s ** {c2 = noPrep}) ;
mkV2Q : overload {
mkV2Q : Str -> V2Q ;
mkV2Q : V -> Prep -> V2Q ;
} ;

-----

Expand Down
8 changes: 5 additions & 3 deletions src/malay/ParamMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ oper

prefix : Prefix -> Str -> Str = \p -> case p of {
Meng => prefixMeng ;
Ber => prefixBer
Ber => prefixBer ;
NoPrefix => prefixNone
} ;

prefixNone : Str -> Str = \belajar -> belajar ;

prefixMeng : Str -> Str = \makan -> case makan of {

Expand Down Expand Up @@ -63,8 +66,6 @@ oper
} ;

prefixBer : Str -> Str = \jalan -> case jalan of {
-- Exception
"ajar" => "belajar" ;

-- Drop the r
(#c + "er" + _ -- be+kerja
Expand Down Expand Up @@ -149,6 +150,7 @@ param
Prefix =
Meng
| Ber
| NoPrefix
; -- TODO more?

--------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/malay/PhraseMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ concrete PhraseMay of Phrase = CatMay ** open Prelude, ResMay in {
UttQS qs = qs ;
UttIAdv iadv = iadv ;
UttNP np = {s = np.s ! Bare} ;
UttIP ip = {s = ip.sp ! NF Sg Bare} ;
UttIP ip = {s = ip.s ! Bare} ;
UttImpSg pol imp = {s = pol.s ++ imp.s ! Sg ! pol.p } ;
UttImpPol pol imp = {s = pol.s ++ imp.s ! Sg ! pol.p} ;
UttImpPol pol imp = {s = "tolong" ++ pol.s ++ imp.s ! Sg ! pol.p} ;
UttImpPl pol imp = {s = pol.s ++ imp.s ! Pl ! pol.p} ;
UttVP vp = {s = linVP vp} ;
UttAP ap = {s = ap.s} ;
Expand Down
15 changes: 12 additions & 3 deletions src/malay/QuestionMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ 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 ** {
sp = \\nf => idet.sp ! nf ++ cn.s ! nf
} ;
-- IdetCN idet cn = NM.DetCN idet cn ** {
-- sp = \\nf => idet.sp ! nf ++ cn.s ! nf
-- } ;
IdetCN idet cn = emptyNP ** {
s = \\poss =>
idet.pr
++ case idet.poss of {
Bare => cn.s ! NF (toNum idet.n) idet.poss ;
_ => cn.s ! NF (toNum idet.n) idet.poss -- TODO check if this make sense
} ++ idet.s ++ cn.heavyMod ;
sp = \\nf => idet.sp ! nf ++ cn.s ! nf;
} ;

-- : IDet -> IP ; -- which five
IdetIP idet = NM.DetNP idet ** {sp = idet.sp};
Expand Down
9 changes: 6 additions & 3 deletions src/malay/ResMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ oper
-- VV : Type = Verb ** {vvtype : VVForm} ;

regVerb : Str -> Prefix -> Verb = \str,p ->
mkVerb str (prefix p str) ("di" + str) (str + "kan") ;
mkVerb str (prefix p str) ("di" + str) (str ++ BIND ++ "kan") ;

mkVerb : (makan, memakan, dimakan, makankan : Str) -> Verb = \rt,act,pass,imp -> {
s = table {
Expand All @@ -251,7 +251,7 @@ oper
mkVerb4 : Verb -> Preposition -> Str -> Verb4 = \v,pr,str -> v ** {
s = \\_ => v.s ! Active ++ str;
c2 = pr ;
passive = "di" ++ BIND ++ v.s ! Root ++ str
-- passive = "di" ++ BIND ++ v.s ! Root ++ str
} ;

copula : Verb = {s = \\_ => "ada"} ; -- TODO
Expand Down Expand Up @@ -292,8 +292,11 @@ oper
useV : Verb -> VerbPhrase = \v -> v ** {
s = \\vf,pol => verbneg pol ++ v.s ! vf
} ;

useComp : Str -> VerbPhrase = \s -> {
s = \\vf,pol => verbneg pol ++ s ;
} ;
useCompN : Str -> VerbPhrase = \s -> {
s = \\vf,pol => nounneg pol ++ s ;
} ;

Expand Down
2 changes: 1 addition & 1 deletion src/malay/SentenceMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ lin
oper

advS : (comma : Str) -> Adverb -> S -> S = \comma,a,sent -> sent ** {
s = sent.s ++ comma ++ a.s
s = a.s ++ comma ++ sent.s
} ;

}
6 changes: 3 additions & 3 deletions src/malay/StructuralMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ lin or_Conj = {s2 = "atau" ; s1 = [] ; n = Sg} ;
-- lin both7and_DConj = mkConj "" "" pl ;
-- lin either7or_DConj = {s2 = \\_ => "" ; s1 = "" ; n = Sg} ;
--
-- lin but_PConj = ss "" ;
lin but_PConj = ss "tetapi" ;
-- lin otherwise_PConj = ss "" ;
-- lin therefore_PConj = ss "" ;
lin therefore_PConj = ss "oleh itu" ;


-----------------
Expand Down Expand Up @@ -104,7 +104,7 @@ lin by8agent_Prep = mkPrep "oleh" ; -- for pronoun agent, see Mintz p. 170, 5.4.
lin by8means_Prep = mkPrep "dengan" ;
-- lin during_Prep = mkPrep ;
-- lin except_Prep = mkPrep ;
-- lin for_Prep = mkPrep ;
lin for_Prep = mkPrep "untuk" ;
-- lin from_Prep = mkPrep "" ;
-- lin in8front_Prep = mkPrep "" ;
lin in_Prep = mkPrep "di" ;
Expand Down
Loading

0 comments on commit 61bc8e7

Please sign in to comment.