mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
@@ -1,4 +1,4 @@
|
|||||||
concrete ConjunctionEst of Conjunction =
|
concrete ConjunctionEst of Conjunction =
|
||||||
CatEst ** open ResEst, Coordination, Prelude in {
|
CatEst ** open ResEst, Coordination, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ; coding=utf8;
|
flags optimize=all_subs ; coding=utf8;
|
||||||
@@ -9,16 +9,14 @@ concrete ConjunctionEst of Conjunction =
|
|||||||
|
|
||||||
ConjAdv = conjunctDistrSS ;
|
ConjAdv = conjunctDistrSS ;
|
||||||
|
|
||||||
|
ConjCN = conjunctDistrTable NForm ;
|
||||||
|
|
||||||
ConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
|
ConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
|
||||||
a = conjAgr (Ag conj.n P3) ss.a ; -- P3 is the maximum
|
a = conjAgr (Ag conj.n P3) ss.a ; -- P3 is the maximum
|
||||||
isPron = False
|
isPron = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- ConjAP conj ss = conjunctDistrTable2 Bool NForm conj ss ** {
|
ConjAP conj ss = conjunctDistrTableAdj conj ss ;
|
||||||
ConjAP conj ss = conjunctDistrTableAdj conj ss ** {
|
|
||||||
infl = ss.s2.infl ; ---- was: True, which is of wrong type. AR 1/2/2014
|
|
||||||
lock_AP = <>
|
|
||||||
} ;
|
|
||||||
|
|
||||||
ConjRS conj ss = conjunctDistrTable Agr conj ss ** {
|
ConjRS conj ss = conjunctDistrTable Agr conj ss ** {
|
||||||
c = ss.c
|
c = ss.c
|
||||||
@@ -30,80 +28,78 @@ concrete ConjunctionEst of Conjunction =
|
|||||||
ConsS = consrSS comma ;
|
ConsS = consrSS comma ;
|
||||||
BaseAdv = twoSS ;
|
BaseAdv = twoSS ;
|
||||||
ConsAdv = consrSS comma ;
|
ConsAdv = consrSS comma ;
|
||||||
|
BaseCN = twoTable NForm ;
|
||||||
|
ConsCN = consrTable NForm comma ;
|
||||||
BaseNP x y = twoTable NPForm x y ** {a = conjAgr x.a y.a} ;
|
BaseNP x y = twoTable NPForm x y ** {a = conjAgr x.a y.a} ;
|
||||||
ConsNP xs x = consrTable NPForm comma xs x ** {a = conjAgr xs.a x.a} ;
|
ConsNP xs x = consrTable NPForm comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||||
BaseAP x y = twoTableAdj x y ;
|
BaseAP x y = twoTableAdj x y ;
|
||||||
ConsAP xs x = consrTableAdj comma x xs ;
|
ConsAP xs x = consrTableAdj comma x xs ;
|
||||||
-- BaseAP x y = twoTable2 Bool NForm x y ;
|
|
||||||
-- ConsAP xs x = consrTable2 Bool NForm comma xs x ;
|
|
||||||
BaseRS x y = twoTable Agr x y ** {c = y.c} ;
|
BaseRS x y = twoTable Agr x y ** {c = y.c} ;
|
||||||
ConsRS xs x = consrTable Agr comma xs x ** {c = xs.c} ;
|
ConsRS xs x = consrTable Agr comma xs x ** {c = xs.c} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[S] = {s1,s2 : Str} ;
|
[S] = {s1,s2 : Str} ;
|
||||||
[Adv] = {s1,s2 : Str} ;
|
[Adv] = {s1,s2 : Str} ;
|
||||||
|
[CN] = {s1,s2 : NForm => Str} ;
|
||||||
[NP] = {s1,s2 : NPForm => Str ; a : Agr} ;
|
[NP] = {s1,s2 : NPForm => Str ; a : Agr} ;
|
||||||
[AP] = {s1,s2 : {s : Bool => NForm => Str ; infl : Infl }} ;
|
[AP] = {s1,s2 : {s : Bool => NForm => Str ; infl : Infl }} ;
|
||||||
[RS] = {s1,s2 : Agr => Str ; c : NPForm} ;
|
[RS] = {s1,s2 : Agr => Str ; c : NPForm} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
--Modified from prelude/Coordination.gf generic functions
|
--Modified from prelude/Coordination.gf generic functions
|
||||||
twoTableAdj : (_,_ : AP) -> [AP] = \x,y ->
|
twoTableAdj : (_,_ : AP) -> [AP] = \x,y ->
|
||||||
lin ListAP {
|
lin ListAP {
|
||||||
s1 = x ;
|
s1 = x ;
|
||||||
s2 = y ;
|
s2 = y
|
||||||
lock_ListAP = <>
|
} ;
|
||||||
} ;
|
|
||||||
|
|
||||||
consrTableAdj : Str -> [AP] -> {s : Bool => NForm => Str ; infl : Infl} -> [AP] = \c,xs,x ->
|
consrTableAdj : Str -> [AP] -> {s : Bool => NForm => Str ; infl : Infl} -> [AP] = \c,xs,x ->
|
||||||
let
|
let
|
||||||
ap1 = xs.s1 ;
|
ap1 = xs.s1 ;
|
||||||
ap2 = xs.s2
|
ap2 = xs.s2
|
||||||
in
|
in
|
||||||
lin ListAP {s1 =
|
lin ListAP {s1 =
|
||||||
{s = \\isMod,nf =>
|
{s = \\isMod,nf =>
|
||||||
case isMod of {
|
case isMod of {
|
||||||
True => case <ap1.infl, ap2.infl> of {
|
True => case <ap1.infl, ap2.infl> of {
|
||||||
<(Participle|Invariable),(Participle|Invariable)> =>
|
<(Participle|Invariable),(Participle|Invariable)> =>
|
||||||
ap1.s ! isMod ! (NCase Sg Nom) ++ c ++ ap2.s ! isMod ! (NCase Sg Nom) ; --valmis ja täis kassid
|
ap1.s ! isMod ! (NCase Sg Nom) ++ c ++ ap2.s ! isMod ! (NCase Sg Nom) ; --valmis ja täis kassid
|
||||||
<(Participle|Invariable),Regular> =>
|
<(Participle|Invariable),Regular> =>
|
||||||
ap1.s ! isMod ! (NCase Sg Nom) ++ c++ ap2.s ! isMod ! nf ; --valmis ja suured kassid
|
ap1.s ! isMod ! (NCase Sg Nom) ++ c++ ap2.s ! isMod ! nf ; --valmis ja suured kassid
|
||||||
<Regular,(Participle|Invariable)> =>
|
<Regular,(Participle|Invariable)> =>
|
||||||
ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! (NCase Sg Nom) ; --suured ja valmis kassid
|
ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! (NCase Sg Nom) ; --suured ja valmis kassid
|
||||||
_ => ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! nf --suured ja mustad kassid
|
_ => ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! nf --suured ja mustad kassid
|
||||||
} ;
|
} ;
|
||||||
False => ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! nf --kassid on valmid ja suured
|
False => ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! nf --kassid on valmid ja suured
|
||||||
} ;
|
} ;
|
||||||
infl = Regular ;
|
infl = Regular } ;
|
||||||
lock_AP = <> } ;
|
|
||||||
s2 = x ;
|
s2 = x ;
|
||||||
lock_ListAP = <>
|
lock_ListAP = <>
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
conjunctDistrTableAdj : ConjunctionDistr -> [AP] -> AP = \or,xs ->
|
conjunctDistrTableAdj : ConjunctionDistr -> [AP] -> AP = \or,xs ->
|
||||||
let
|
let
|
||||||
ap1 = xs.s1 ;
|
ap1 = xs.s1 ;
|
||||||
ap2 = xs.s2 ;
|
ap2 = xs.s2 ;
|
||||||
in
|
in
|
||||||
lin AP {s = \\isMod,nf =>
|
lin AP {s = \\isMod,nf =>
|
||||||
case isMod of {
|
case isMod of {
|
||||||
True => case <ap1.infl, ap2.infl> of {
|
True => case <ap1.infl, ap2.infl> of {
|
||||||
<(Participle|Invariable),(Participle|Invariable)> =>
|
<(Participle|Invariable),(Participle|Invariable)> =>
|
||||||
or.s1 ++ ap1.s ! isMod ! (NCase Sg Nom) ++
|
or.s1 ++ ap1.s ! isMod ! (NCase Sg Nom) ++
|
||||||
or.s2 ++ ap2.s ! isMod ! (NCase Sg Nom) ;
|
or.s2 ++ ap2.s ! isMod ! (NCase Sg Nom) ;
|
||||||
<(Participle|Invariable),Regular> =>
|
<(Participle|Invariable),Regular> =>
|
||||||
or.s1 ++ ap1.s ! isMod ! (NCase Sg Nom) ++
|
or.s1 ++ ap1.s ! isMod ! (NCase Sg Nom) ++
|
||||||
or.s2 ++ ap2.s ! isMod ! nf ;
|
or.s2 ++ ap2.s ! isMod ! nf ;
|
||||||
<Regular,(Participle|Invariable)> =>
|
<Regular,(Participle|Invariable)> =>
|
||||||
or.s1 ++ ap1.s ! isMod ! nf ++
|
or.s1 ++ ap1.s ! isMod ! nf ++
|
||||||
or.s2 ++ ap2.s ! isMod ! (NCase Sg Nom) ;
|
or.s2 ++ ap2.s ! isMod ! (NCase Sg Nom) ;
|
||||||
_ => or.s1 ++ ap1.s ! isMod ! nf ++ or.s2 ++ ap2.s ! isMod ! nf
|
_ => or.s1 ++ ap1.s ! isMod ! nf ++ or.s2 ++ ap2.s ! isMod ! nf
|
||||||
} ;
|
} ;
|
||||||
False => or.s1 ++ ap1.s ! isMod ! nf ++ or.s2 ++ ap2.s ! isMod ! nf
|
False => or.s1 ++ ap1.s ! isMod ! nf ++ or.s2 ++ ap2.s ! isMod ! nf
|
||||||
} ;
|
} ;
|
||||||
infl = Regular ;
|
infl = Regular
|
||||||
lock_AP = <>
|
} ;
|
||||||
} ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,9 @@ param
|
|||||||
|
|
||||||
param
|
param
|
||||||
Preposition = U | Ku | Ka | La | NoPrep ;
|
Preposition = U | Ku | Ka | La | NoPrep ;
|
||||||
PrepositionPlus = P Preposition | Passive ; -- Hack: RGL only supports V2s as passive, so I can reuse V2's preposition slot for passives as well, and save >200 parameters. (Don't ask.)
|
PrepositionPlus = P Preposition
|
||||||
|
| Passive ; -- Hack: RGL only supports V2s as passive, so I can reuse V2's preposition slot for passives as well, and save >200 parameters. (Don't ask.)
|
||||||
|
|
||||||
PrepCombination = Ugu | Uga | Ula | Kaga | Kula | Kala
|
PrepCombination = Ugu | Uga | Ula | Kaga | Kula | Kala
|
||||||
| Single PrepositionPlus ;
|
| Single PrepositionPlus ;
|
||||||
|
|
||||||
@@ -194,7 +196,7 @@ oper
|
|||||||
z => z } ;
|
z => z } ;
|
||||||
|
|
||||||
pp2prep : PrepositionPlus -> Preposition = \pp ->
|
pp2prep : PrepositionPlus -> Preposition = \pp ->
|
||||||
case pp of {P p => p ; Passive => NoPrep} ;
|
case pp of {P p => p ; _ => NoPrep} ;
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Verbs
|
-- Verbs
|
||||||
|
|
||||||
|
|||||||
@@ -639,6 +639,7 @@ oper
|
|||||||
obj2 : {s : Str ; a : AgreementPlus} ;
|
obj2 : {s : Str ; a : AgreementPlus} ;
|
||||||
secObj : Str ; -- if two overt pronoun objects
|
secObj : Str ; -- if two overt pronoun objects
|
||||||
vComp : Str ; -- VV complement
|
vComp : Str ; -- VV complement
|
||||||
|
refl : Str ; -- reflexive is put here, if the verb has an obj2.
|
||||||
miscAdv : Str ; -- dump for any other kind of adverb, that isn't
|
miscAdv : Str ; -- dump for any other kind of adverb, that isn't
|
||||||
} ; -- in a closed class of particles or made with PrepNP.
|
} ; -- in a closed class of particles or made with PrepNP.
|
||||||
|
|
||||||
@@ -647,7 +648,7 @@ oper
|
|||||||
useV : Verb -> VerbPhrase = \v -> v ** {
|
useV : Verb -> VerbPhrase = \v -> v ** {
|
||||||
comp = \\_ => <[],[]> ;
|
comp = \\_ => <[],[]> ;
|
||||||
pred = NoPred ;
|
pred = NoPred ;
|
||||||
vComp,berri,miscAdv = [] ;
|
vComp,berri,miscAdv,refl = [] ;
|
||||||
c2 = P NoPrep ;
|
c2 = P NoPrep ;
|
||||||
c3 = NoPrep ;
|
c3 = NoPrep ;
|
||||||
obj2 = {s = [] ; a = Unassigned} ;
|
obj2 = {s = [] ; a = Unassigned} ;
|
||||||
@@ -667,13 +668,19 @@ oper
|
|||||||
comp = \\agr => let cmp = vps.comp ! agr in
|
comp = \\agr => let cmp = vps.comp ! agr in
|
||||||
{p1 = np.s ++ cmp.p1 ; -- if object is a noun, it will come before verb in the sentence.
|
{p1 = np.s ++ cmp.p1 ; -- if object is a noun, it will come before verb in the sentence.
|
||||||
-- if object is a pronoun, np.s is empty.
|
-- if object is a pronoun, np.s is empty.
|
||||||
p2 = cmp.p2 ++ compl np.a vps} -- object combines with the preposition of the verb.
|
p2 = cmp.p2 ++ vps.refl ++ compl np.a vps} -- object combines with the preposition of the verb.
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
compl : AgreementPlus -> VerbPhrase -> Str = \a,vp ->
|
compl : AgreementPlus -> VerbPhrase -> Str = \a,vp ->
|
||||||
let agr = case a of {IsPron x => x ; _ => Pl3} ;
|
let agr = case a of {IsPron x => x ; _ => Pl3} ;
|
||||||
in prepCombTable ! agr ! combine vp.c2 vp.c3 ;
|
in prepCombTable ! agr ! combine vp.c2 vp.c3 ;
|
||||||
|
|
||||||
|
insertRefl : VPSlash -> VPSlash = \vps ->
|
||||||
|
case <vps.c2,vps.c3> of {
|
||||||
|
<P NoPrep,NoPrep> => vps ** {refl = "is"} ; -- not bound
|
||||||
|
_ => vps ** {refl = "is" ++ BIND}
|
||||||
|
} ;
|
||||||
|
|
||||||
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
|
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
|
||||||
let noun : Str = case <np.isPron,np.a> of {
|
let noun : Str = case <np.isPron,np.a> of {
|
||||||
<False,_> => np.s ! Abs ;
|
<False,_> => np.s ! Abs ;
|
||||||
@@ -760,7 +767,7 @@ oper
|
|||||||
} where {
|
} where {
|
||||||
vp = case vps.c2 of {
|
vp = case vps.c2 of {
|
||||||
Passive => complSlash (insertComp vps np) ;
|
Passive => complSlash (insertComp vps np) ;
|
||||||
_ => complSlash vps } ;
|
_ => complSlash vps } ;
|
||||||
subj = case vps.c2 of {Passive => impersNP ; _ => np} ;
|
subj = case vps.c2 of {Passive => impersNP ; _ => np} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ lin
|
|||||||
-- : V2 -> VP ; -- be loved
|
-- : V2 -> VP ; -- be loved
|
||||||
PassV2 = ResSom.passV2 ;
|
PassV2 = ResSom.passV2 ;
|
||||||
|
|
||||||
|
-- : VPSlash -> VP ;
|
||||||
|
ReflVP = ResSom.insertRefl ;
|
||||||
|
|
||||||
-- : VV -> VP -> VP ;
|
-- : VV -> VP -> VP ;
|
||||||
ComplVV vv vp = useV vv ** { -- check Sayeed p. 169
|
ComplVV vv vp = useV vv ** { -- check Sayeed p. 169
|
||||||
vComp = infVP vp
|
vComp = infVP vp
|
||||||
@@ -67,14 +70,8 @@ lin
|
|||||||
post = vps.post ;
|
post = vps.post ;
|
||||||
iobj = np ** { s = np.s ! Dat } } ;
|
iobj = np ** { s = np.s ! Dat } } ;
|
||||||
|
|
||||||
--2 Other ways of forming verb phrases
|
|
||||||
|
|
||||||
-- Verb phrases can also be constructed reflexively and from
|
|
||||||
-- copula-preceded complements.
|
|
||||||
|
|
||||||
-- : VPSlash -> VP ;
|
|
||||||
ReflVP vps = ;
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
-- : Comp -> VP ;
|
-- : Comp -> VP ;
|
||||||
UseComp comp = UseCopula ** comp ;
|
UseComp comp = UseCopula ** comp ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user