From ee01aa1cd5021826aeb740f73d8a131453817529 Mon Sep 17 00:00:00 2001 From: Meowyam Date: Thu, 23 Feb 2023 14:08:14 +0800 Subject: [PATCH] add ListS and ComplVA --- src/malay/ConjunctionMay.gf | 102 ++++-------------------------------- src/malay/ExtendMay.gf | 1 + src/malay/ParadigmsMay.gf | 6 ++- src/malay/ResMay.gf | 11 +++- src/malay/StructuralMay.gf | 4 +- src/malay/VerbMay.gf | 15 ++++-- 6 files changed, 38 insertions(+), 101 deletions(-) diff --git a/src/malay/ConjunctionMay.gf b/src/malay/ConjunctionMay.gf index 1bc122ff4..2d817f4ca 100644 --- a/src/malay/ConjunctionMay.gf +++ b/src/malay/ConjunctionMay.gf @@ -3,99 +3,17 @@ concrete ConjunctionMay of Conjunction = flags optimize=all_subs ; - {- Conjunction for category X needs four things: - lincat [X] - lin BaseX - lin ConsX - lin ConjX - - For example, if X is defined as - - lincat X = {s : Number => Str ; g : Gender} ; - - then [X] will split its s field into two, and retain its other fields as is: - - lincat [X] = {s1,s2 : Number => Str ; g : Gender} ; - - Let us look at a simple case: Adv is of type {s : Str} - Then [Adv] is {s1,s2 : Str}. - BaseAdv, ConsAdv and ConjAdv can all use functions defined in prelude/Coordination: - - BaseAdv = twoSS ; - ConsAdv = consrSS comma ; - ConjAdv = conjunctSS ; - - --} + lincat + [Adv],[AdV] = {s1,s2 : Str} ; + [S] = {s1,s2 : Str} ; --- Adverb and other simple {s : Str} types. -lincat - [Adv],[AdV],[IAdv] = {s1,s2 : Str} ; - [S] = {s1,s2 : Str} ; + lin + BaseAdv, BaseAdV = twoSS ; + ConsAdv, ConsAdV = consrSS comma ; + ConjAdv, ConjAdV = conjunctDistrSS ; + BaseS = twoSS ; + ConsS = consrSS comma ; + ConjS = conjunctDistrSS ; -lin - BaseAdv, BaseAdV, BaseIAdv = twoSS ; - ConsAdv, ConsAdV, ConsIAdv = consrSS comma ; - ConjAdv, ConjAdV, ConjIAdv = conjunctDistrSS ; - BaseS = twoSS ; - ConsS = consrSS comma ; - ConjS = conjunctDistrSS ; - - -{- --- RS depends on X, Y and Z, otherwise exactly like previous. --- RS can modify CNs, which are open for …, and have inherent … -lincat - [RS] = {s1,s2 : … => Str} ; - -lin - BaseRS = twoTable3 … ; - ConsRS = consrTable3 … comma ; - ConjRS = conjunctRSTable ; - - -lincat - [S] = {} ; - -lin - BaseS x y = y ** { } ; - ConsS x xs = - xs ** { } ; - ConjS co xs = {} ; - -lincat - [AP] = {} ; - -lin - BaseAP x y = twoTable … x y ** y ; --choose all the other fields from second argument - ConsAP as a = consrTable … comma as a ** as ; - ConjAP co as = conjunctDistrTable … co as ** as ; - -lincat - [CN] = { } ; - -lin - BaseCN = {} ; - ConsCN = {} ; - ConjCN co cs = conjunctDistrTable Agr co cs ** cs ; - -lincat - [DAP] = - -lin - BaseDAP x y = x ** - ConsDAP xs x = xs ** - ConjDet conj xs = xs ** - - --- Noun phrases -lincat - [NP] = - -lin - BaseNP x y = - ConsNP x xs = - ConjNP conj xs = - --} } diff --git a/src/malay/ExtendMay.gf b/src/malay/ExtendMay.gf index 5e14dccc9..58ae1ef58 100644 --- a/src/malay/ExtendMay.gf +++ b/src/malay/ExtendMay.gf @@ -49,6 +49,7 @@ concrete ExtendMay of Extend = CatMay s = np.s ! Bare ++ vps.s ; } ; -- SQuestVPS : NP -> VPS -> QS ; -- has she walked + SQuestVPS np vps = {s = np.s ++ vps.s} ; -- QuestVPS : IP -> VPS -> QS ; -- who has walked -- RelVPS : RP -> VPS -> RS ; -- which won't sleep diff --git a/src/malay/ParadigmsMay.gf b/src/malay/ParadigmsMay.gf index 2d20d248c..ac781e5da 100644 --- a/src/malay/ParadigmsMay.gf +++ b/src/malay/ParadigmsMay.gf @@ -55,8 +55,9 @@ noPrep : Prep = mkPrep "" ; } ; -- - -- mkVA : Str -> VA - -- = \s -> lin VA (regV s) ; + mkVA : overload { + mkVA : V -> VA ; + } ; -- mkVQ : Str -> VQ -- = \s -> lin VQ (regV s) ; mkVS : overload { @@ -123,6 +124,7 @@ noPrep : Prep = mkPrep "" ; mkA2 = overload { mkA2 : (adj : Str) -> A = \s -> lin A2 (mkAdj s) ; + mkA2 : A -> A2 = \a -> lin A2 (a ** {c2 = emptyPrep}) ; mkA2 : A -> Prep -> A = \a,p -> lin A2 (a) ; } ; diff --git a/src/malay/ResMay.gf b/src/malay/ResMay.gf index 307a7e6f7..2be6ab522 100644 --- a/src/malay/ResMay.gf +++ b/src/malay/ResMay.gf @@ -251,6 +251,16 @@ oper } ; copula : Verb = {s = \\_ => "ada"} ; -- TODO + + -- insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp -> + -- insertObj obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ; + insertObj : Str -> VerbPhrase -> VerbPhrase = \str,vp -> vp ** { + s = \\vf,pol => vp.s ! Active ! Pos ++ str ; + } ; + + insertComp : AdjPhrase -> VerbPhrase -> VerbPhrase = \ap,vp -> vp ** { + s = \\vf,pol => vp.s ! Active ! Pos ++ ap.s ; + } ; ------------------ -- Adv @@ -328,7 +338,6 @@ 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 3a5430dfe..88c2cedb5 100644 --- a/src/malay/StructuralMay.gf +++ b/src/malay/StructuralMay.gf @@ -42,7 +42,7 @@ lin there_Adv = ss "" ; -- Conj lin and_Conj = {s2 = "dan" ; s1 = [] ; n = Pl} ; --- lin or_Conj = {s2 = \\_ => "" ; s1 = [] ; n = Sg} ; +lin or_Conj = {s2 = "atau" ; s1 = [] ; n = Sg} ; -- lin if_then_Conj = mkConj -- lin both7and_DConj = mkConj "" "" pl ; -- lin either7or_DConj = {s2 = \\_ => "" ; s1 = "" ; n = Sg} ; @@ -108,7 +108,7 @@ lin by8means_Prep = mkPrep "dengan" ; -- lin from_Prep = mkPrep "" ; -- lin in8front_Prep = mkPrep "" ; lin in_Prep = mkPrep "di" ; --- lin on_Prep = mkPrep "" ; +lin on_Prep = mkPrep "pada" ; -- lin part_Prep = mkPrep ; lin possess_Prep = mkPrep [] ; -- TODO check Mintz p. 39-40, 2.2.1.2 -- lin through_Prep = mkPrep ; diff --git a/src/malay/VerbMay.gf b/src/malay/VerbMay.gf index cf5497c00..8bbf55b88 100644 --- a/src/malay/VerbMay.gf +++ b/src/malay/VerbMay.gf @@ -19,6 +19,9 @@ lin s = \\vf => vv.s ++ linVP vp } ; + -- : VA -> AP -> VP ; -- they become red + ComplVA va ap = ResMay.insertComp ap (useV va) ; + -- : VS -> S -> VP ; -- ComplVS vs s = -- let vps = useV vs ; @@ -29,8 +32,6 @@ lin -- : VQ -> QS -> VP ; ComplVQ vq qs = ; - -- : VA -> AP -> VP ; -- they become red - ComplVA va ap = ResMay.insertComp (CompAP ap).s (useV va) ; -} -------- @@ -61,8 +62,6 @@ lin adjCompl = [] } ; - -- insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp -> - -- insertObj obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ; SlashV2A v2 adj = useV { @@ -72,6 +71,14 @@ lin adjCompl = adj.s } ; + -- : V2S -> S -> VPSlash ; -- answer (to him) that it is good + -- SlashV2S v2 s = useV { + -- s = \\vf => v2.s ! vf; + -- } ** { + -- c2 = v2.c2; + -- sCompl = s.s + -- } ; + -- : V2V -> VP -> VPSlash ; -- beg (her) to go -- SlashV2V v2v vp = ;