mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 08:58:55 -06:00
add ListS and ComplVA
This commit is contained in:
@@ -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 ;
|
||||
|
||||
--}
|
||||
|
||||
|
||||
-- Adverb and other simple {s : Str} types.
|
||||
lincat
|
||||
[Adv],[AdV],[IAdv] = {s1,s2 : Str} ;
|
||||
lincat
|
||||
[Adv],[AdV] = {s1,s2 : Str} ;
|
||||
[S] = {s1,s2 : Str} ;
|
||||
|
||||
lin
|
||||
BaseAdv, BaseAdV, BaseIAdv = twoSS ;
|
||||
ConsAdv, ConsAdV, ConsIAdv = consrSS comma ;
|
||||
ConjAdv, ConjAdV, ConjIAdv = conjunctDistrSS ;
|
||||
|
||||
lin
|
||||
BaseAdv, BaseAdV = twoSS ;
|
||||
ConsAdv, ConsAdV = consrSS comma ;
|
||||
ConjAdv, ConjAdV = 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 =
|
||||
|
||||
-}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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) ;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -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 <vps : VerbPhrase> ** {c2 = vps.c2} ;
|
||||
|
||||
|
||||
-- mkClause : Str -> NounPhrase -> VPSlash -> Clause = \str,np,vp -> {
|
||||
-- subj = str ++ np.s ! Bare;
|
||||
-- pred = vp.s
|
||||
|
||||
@@ -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 ;
|
||||
|
||||
@@ -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 = ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user