1
0
forked from GitHub/gf-rgl

Merge branch 'master' of github.com:GrammaticalFramework/gf-rgl

This commit is contained in:
Krasimir Angelov
2022-08-02 16:08:01 +02:00
205 changed files with 48554 additions and 2730 deletions

View File

@@ -89,8 +89,6 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
Prep = {
s : Str ; -- "with", "ago"
isPre : Bool ; -- whether it's pre- or postposition: "with"=True, "ago"=False
isPoss : Bool ; -- whether it becomes "whose" in FunRP: "John, whose mother is wise"
empty : Str ; -- dummy empty string to avoid issues with parsing, if s field is replaced by "whose" in FunRP
} ;
CAdv = {s : Polarity => Str; p : Str} ;

View File

@@ -185,7 +185,7 @@ concrete ExtendEng of Extend =
mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS {
s = \\o,a =>
let
verb = vp.s ! t.t ! t.a ! p.p ! o ! a ; -- choice of Order determines aux or not
verb = mkVerbForms a vp ! t.t ! t.a ! p.p ! o ! a ; -- choice of Order determines aux or not
compl = vp.s2 ! a ++ vp.ext
in {fin = verb.aux ++ t.s ++ p.s ;
inf = verb.adv ++ vp.ad ! a ++ verb.fin ++ verb.inf ++ vp.p ++ compl} ;
@@ -288,16 +288,12 @@ lin BaseImp = twoTable2 CPolarity ImpForm ;
let
be = predAux auxBe ;
ppt = vps.ptp
in {
s = be.s ;
p = [] ;
prp = be.prp ;
ptp = be.ptp ;
inf = be.inf ;
ad = \\_ => [] ;
s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ vps.s2 ! a ++ ag ++ vps.c2 ; ---- place of agent
isSimple = False ;
ext = vps.ext
in be ** {
p = [] ;
ad = \\_ => [] ;
s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ vps.s2 ! a ++ ag ++ vps.c2 ; ---- place of agent
isSimple = False ;
ext = vps.ext
} ;
lin

View File

@@ -75,7 +75,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
MkVPS t p vp = {
s = \\a =>
let
verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ;
verb = mkVerbForms a vp ! t.t ! t.a ! p.p ! oDir ! a ;
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
in t.s ++ p.s ++ vp.ad ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext
} ;
@@ -180,17 +180,13 @@ lin
let
be = predAux auxBe ;
ppt = vps.ptp
in {
s = be.s ;
p = [] ;
prp = be.prp ;
ptp = be.ptp ;
inf = be.inf ;
ad = \\_ => [] ;
s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ vps.s2 ! a ++ ag ++ vps.c2 ; ---- place of agent
isSimple = False ;
ext = vps.ext
} ;
in be ** {
p = [] ;
ad = \\_ => [] ;
s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ vps.s2 ! a ++ ag ++ vps.c2 ; ---- place of agent
isSimple = False ;
ext = vps.ext
} ;
lin
PassVPSlash vps = passVPSlash vps [] ;
@@ -242,7 +238,7 @@ lin
let
subj = np.s ! npNom ;
agr = np.a ;
verb = vp.s ! t ! a ! b ! o ! agr ;
verb = mkVerbForms agr vp ! t ! a ! b ! o ! agr ;
compl = vp.s2 ! agr
in
case o of {
@@ -256,7 +252,7 @@ lin
let
subj = np.s ! npNom ;
agr = np.a ;
verb = vp.s ! t ! a ! b ! o ! agr ;
verb = mkVerbForms agr vp ! t ! a ! b ! o ! agr ;
compl = vp.s2 ! agr
in
case o of {

View File

@@ -44,4 +44,3 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in {
} ;
}

View File

@@ -3,13 +3,13 @@ UseV,ComplVV,ComplVS,ComplVQ,ComplVA,SlashV2a,SlashV2V,SlashV2A,SlashV2S,Slash2V
UseV,UseComp {"to"} PART mark head
UseComp,CompAdv,CompAP,CompNP,CompCN,ProgrVP,QuestIComp {"is","are","am","was","were","been","be"} VERB cop head
CompCN {"a","an"} DET det head
PassV2 {"is","are","am","was","were""been","be"} VERB auxpass head
PassV2 {"is","are","am","was","were""been","be"} VERB aux:pass head
ComplVV {"to"} PART mark xcomp
ComplVS {"that"} PART mark ccomp
EmbedVP {"to"} PART mark head
EmbedS {"that"} PART mark head
SentCN {"that","to"} PART mark acl
ExtAdvS,SubjS {","} PUNCT punct head
ConsNP,ExtAdvS,SSubjS,VocNP {","} PUNCT punct head
ExistNPAdv,ExistNP {"not","don't","doesn't","didn't","haven't","hasn't","hadn't","wouldn't","won't","isn't","aren't","wasn't","weren't"} PART neg head
ExistNPAdv,ExistNP {"has","had","have","will","would","do","does","did"} AUX aux head
ExistNPAdv,ExistNP {"is","are","am","was","were""been","be"} VERB cop head
@@ -34,9 +34,3 @@ PossNP,PartNP {"of"} ADP case nmod
@"am" PresSg1
@"is" PresSg3
@"are" PresPl

View File

@@ -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 ;
a = agrP3 det.n
} ;

View File

@@ -539,18 +539,12 @@ mkVoc s = lin Voc (ss s) ;
mkPrep p = lin Prep {
s = p ; -- the string: "with", "in front of"
isPre = True ; -- default case: it is a preposition, not postposition
isPoss = False ; -- default case: not possessive (i.e. no change in FunRP)
empty = [] -- dummy field to prevent an issue with parsing. only relevant when isPoss=True, and FunRP overrides the s field with "whose". for explanation of the issue, see https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#metavariables-or-those-question-marks-that-appear-when-parsing
} ;
mkPost p = mkPrep p ** {
isPre = False -- postposition: e.g. "ago"
} ;
noPrep = mkPrep [] ;
possPrep : Str -> Prep = \p -> mkPrep p ** {
isPoss = True -- for possessive, FunRP overrides the Prep's string with "whose":
} ; -- e.g. "whose mother" instead of "mother of which"
mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ;
regV cry =
@@ -624,7 +618,7 @@ mkVoc s = lin Voc (ss s) ;
auxVV, infVV = \v -> lin VV {
s = table {
VVF vf => v.s ! vf ;
VVPresNeg => v.s ! VPres ++ "not"
VVPresNeg => v.s ! VPres ++ "not"
; VVPastNeg => v.s ! VPast ++ "not" --# notpresent
} ;
p = v.p ;
@@ -703,7 +697,7 @@ mkVoc s = lin Voc (ss s) ;
mkA : (fat,fatter : Str) -> A = \fat,fatter ->
lin A (mkAdjective fat fatter (init fatter + "st") (adj2adv fat)) ;
mkA : (good,better,best,well : Str) -> A = \a,b,c,d ->
lin A (mkAdjective a b c d)
lin A (mkAdjective a b c d)
} ;
invarA s = lin A {

View File

@@ -32,16 +32,10 @@ concrete RelativeEng of Relative = CatEng ** open ResEng, Prelude in {
c = NPAcc
} ;
-- John , whose every friend is right
-- a number, [the square of which] is 4
-- For a construction like "John , [whose every friend] is right", use Extend.GenRP
FunRP p np rp = {
s = \\c =>
let npGender : Gender = (fromAgr np.a).g in
case p.isPoss of {
True => rp.s ! RC npGender NPNomPoss ++ -- whose
p.empty ++ -- empty string to avoid metavariables
np.s ! NCase Nom ; -- NP in nom: "whose every friend"
False => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep npGender
} ;
s = \\c => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ;
a = RAg np.a
} ;

View File

@@ -159,12 +159,12 @@ param
s = table {
AAdj Posit c => adjCompar.s ! AAdj Posit c ;
AAdv => adjCompar.s ! AAdv ;
_ => nonExist } ; -- IL 06/2021. Replace with an actual string, if this causes problems.
_ => nonExist } ; -- IL 2021-06. Replace with an actual string, if this causes problems.
isMost = True } ;
_ => adjCompar
} ;
-- IL 06/2021: remove "more" and "most" from A & A2's inflection table
-- IL 2021-06: remove "more" and "most" from A & A2's inflection table
getCompar : Case -> Adjective -> Str = \c,a -> case a.isMost of {
True => "more" ++ a.s ! AAdj Posit c ;
False => a.s ! AAdj Compar c
@@ -252,18 +252,59 @@ param
Tense => Anteriority => CPolarity => Order => Agr =>
{aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept
VP : Type = {
s : VerbForms ;
p : Str ; -- verb particle
prp : Str ; -- present participle
ptp : Str ; -- past participle
inf : Str ; -- the infinitive form ; VerbForms would be the logical place
ad : Agr => Str ; -- sentence adverb (can be Xself, hence Agr)
s2 : Agr => Str ; -- complement
ext : Str ; -- extreposed field such as S, QS, VP
isSimple : Bool -- regulates the place of participle used as adjective
} ;
{- IL 2022-04: reduce the fields in VP and make the grammar better suited for morphological analysis
All verbs except auxiliaries only need 6 forms inside VP, and other forms can be built in PredVP.
Auxiliaries need more forms. So we make VP an extension of Aux, and add a parameter that tells
which strategy to use when building a Cl: use the 4 forms, or use the fields in Aux.
(If we treat auxiliaries as normal verbs, we get "you don't be __" for "you aren't __".)
If we didn't care about morphological lexicon, we could just fill the Aux fields for all verbs:
morphologically distinct forms like "can't" for auxiliaries, and periphrastic constructions
like "doesn't sing/eat/play" for other verbs. However, then morphologically analysing the word
"doesn't" returns every single function that constructs a VP, which clutters morpho analysis.
So we use two sets of fields and a parameter for which strategy to choose in PredVP. This results
in significantly fewer fields than previously, and is better for morphological analysis.
-}
VP : Type = {
-- The common parts
p : Str ; -- verb particle
ad : Agr => Str ; -- sentence adverb (can be Xself, hence Agr)
s2 : Agr => Str ; -- complement
ext : Str ; -- extreposed field such as S, QS, VP
prp : Str ; -- present participle
ptp : Str ; -- past participle
inf : Str ; -- the infinitive form
isSimple : Bool ; -- regulates the place of participle used as adjective
-- The variable parts, depending on whether the main verb of the VP is auxiliary or not
isAux : Bool ;
auxForms : { -- nonExist when isAux=False
past, --# notpresent
contr,
pres : Polarity => Agr => Str ;
} ;
nonAuxForms : { -- nonExist when isAux=True
pres : Agr => Str ; -- sing/sings ; can be streamlined into two forms if needed
past : Str ; --# notpresent
}
} ;
-- called from mkClause, when we finally put together all forms for a Cl
mkVerbForms : Agr -> VP -> VerbForms = \agr,vp -> case vp.isAux of {
True =>
let aux : Aux = vp.auxForms ** {
inf = vp.inf ;
ppart = vp.ptp ;
prpart = vp.prp } ;
in auxVerbForms aux ;
False =>
let fin : Str = vp.nonAuxForms.pres ! agr ;
inf : Str = vp.inf ;
part : Str = vp.ptp ;
in nonAuxVerbForms fin inf part
vp.nonAuxForms.past --# notpresent
} ;
SlashVP = VP ** {c2 : Str ;
gapInMiddle : Bool;
@@ -276,20 +317,57 @@ param
cBind : Str -> Str = \s -> Predef.BIND ++ ("'" + s) ;
predV : Verb -> VP = \verb -> {
s = \\t,ant,b,ord,agr =>
let
inf = verb.s ! VInf ;
fin = presVerb verb agr ;
part = verb.s ! VPPart ;
in
case <t,ant,b,ord> of {
p = verb.p ; -- Common to all verbs
prp = verb.s ! VPresPart ;
ptp = verb.s ! VPPart ;
inf = verb.s ! VInf ;
ad = \\_ => [] ;
ext = [] ;
isSimple = True ; ---- but really depends on whether p == []
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) [] ;
isAux = False ; -- Specific to non-Aux verbs
auxForms = {
contr,
past, --# notpresent
pres = \\_,_ => nonExist} ;
nonAuxForms = {
pres = \\agr => presVerb verb agr ;
past = verb.s ! VPast ; --# notpresent
}
} ;
predAux : Aux -> VP = \aux -> {
p = [] ; -- Common to all verbs
prp = aux.prpart ;
ptp = aux.ppart ;
inf = aux.inf ;
ad = \\_ => [] ;
ext = [] ;
isSimple = True ;
s2 = \\_ => [] ;
isAux = True ; -- Specific to Aux verbs
auxForms = aux ;
nonAuxForms = {
past = nonExist ; --# notpresent
pres = \\_ => nonExist}
} ;
nonAuxVerbForms : (fin,inf,part : Str) ->
(past : Str) -> --# notpresent
VerbForms = \fin,inf,part
,past --# notpresent
->
\\tns,ant,pol,ord,agr =>
case <tns,ant,pol,ord> of {
<Pres,Simul,CPos,ODir _> => vff fin [] ;
<Pres,Simul,CPos,OQuest> => vf (does agr) inf ;
<Pres,Anter,CPos,ODir True> => vf (haveContr agr) part ; --# notpresent
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
<Pres,Anter,CNeg c,ODir True> => vfn c (haveContr agr) (haventContr agr) part ; --# notpresent
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
<Past,Simul,CPos,ODir _> => vff (verb.s ! VPast) [] ; --# notpresent
<Past,Simul,CPos,ODir _> => vff past [] ; --# notpresent
<Past,Simul,CPos,OQuest> => vf "did" inf ; --# notpresent
<Past,Simul,CNeg c,_> => vfn c "did" "didn't" inf ; --# notpresent
<Past,Anter,CPos,ODir True> => vf (cBind "d") part ; --# notpresent
@@ -314,18 +392,9 @@ param
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
<Pres,Simul,CNeg c,_> => vfn c (does agr) (doesnt agr) inf
} ;
p = verb.p ;
prp = verb.s ! VPresPart ;
ptp = verb.s ! VPPart ;
inf = verb.s ! VInf ;
ad = \\_ => [] ;
ext = [] ;
isSimple = True ; ---- but really depends on whether p == []
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
} ;
predAux : Aux -> VP = \verb -> {
s = \\t,ant,cb,ord,agr =>
auxVerbForms : Aux -> VerbForms = \verb ->
\\t,ant,cb,ord,agr =>
let
b = case cb of {
CPos => Pos ;
@@ -371,17 +440,7 @@ param
<Pres,Simul,CPos, _> => vf fin [] ;
<Pres,Simul,CNeg c,ODir True> => vfn c cfinp fin [] ;
<Pres,Simul,CNeg c, _> => vfn c finp fin []
} ;
p = [] ;
prp = verb.prpart ;
ptp = verb.ppart ;
inf = verb.inf ;
ad = \\_ => [] ;
ext = [] ;
isSimple = True ;
s2 = \\_ => []
} ;
} ;
vff : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y ->
{aux = [] ; adv = [] ; fin = x ; inf = y} ;
@@ -395,7 +454,7 @@ param
False => {aux = x ; adv = "not" ; fin = [] ; inf = z}
} ;
{- IL 24/04/2018 To fix scope of reflexives:
{- IL 2018-04 To fix scope of reflexives:
a) ComplSlash ( … ReflVP … ) X: reflexive should agree with X
LangEng> l PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (ReflVP (SlashV2a like_V2))) (UsePron he_Pron))
I beg him to like /himself/
@@ -421,42 +480,22 @@ param
insertExtra obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ;
--- AR 7/3/2013 move the particle after the object
insertObjPartLast : (Agr => Str) -> VP -> VP = \obj,vp -> {
s = vp.s ;
insertObjPartLast : (Agr => Str) -> VP -> VP = \obj,vp -> vp ** {
p = [] ; -- remove particle from here
prp = vp.prp ;
ptp = vp.ptp ;
inf = vp.inf ;
ad = vp.ad ;
s2 = \\a => obj ! a ++ vp.s2 ! a ++ vp.p ; -- and put it here ; corresponds to insertObjPre
isSimple = False ;
ext = vp.ext
} ;
--- The adverb should be before the finite verb.
insertAdV : Str -> VP -> VP = \ad -> insertAdVAgr (\\_ => ad) ;
insertAdVAgr : (Agr => Str) -> VP -> VP = \ad,vp -> {
s = vp.s ;
p = vp.p ;
prp = vp.prp ;
ptp = vp.ptp ;
inf = vp.inf ;
insertAdVAgr : (Agr => Str) -> VP -> VP = \ad,vp -> vp ** {
ad = \\a => vp.ad ! a ++ ad ! a ;
s2 = \\a => vp.s2 ! a ;
isSimple = False ;
ext = vp.ext
} ;
insertExtra : Str -> VP -> VP = \e,vp -> {
s = vp.s ;
p = vp.p ;
prp = vp.prp ;
ptp = vp.ptp ;
inf = vp.inf ;
ad = vp.ad ;
s2 = vp.s2 ;
insertExtra : Str -> VP -> VP = \e,vp -> vp ** {
isSimple = False ;
ext = vp.ext ++ e --- there should be at most one, one might think; but: I would say that it will be raining if I saw clouds
} ;
@@ -523,7 +562,7 @@ param
haveContr = agrVerb (cBind "s") (cBind "ve") ;
haventContr = agrVerb (cBind "s not") (cBind "ve not") ;
Aux = {
Aux : Type = {
pres : Polarity => Agr => Str ;
contr : Polarity => Agr => Str ; -- contracted forms
past : Polarity => Agr => Str ; --# notpresent
@@ -589,7 +628,7 @@ param
\subj,agr,vp -> {
s = \\t,a,b,o =>
let
verb = vp.s ! t ! a ! b ! o ! agr ;
verb = mkVerbForms agr vp ! t ! a ! b ! o ! agr ;
compl = vp.s2 ! agr ++ vp.ext
in
case o of {

View File

@@ -99,7 +99,7 @@ concrete StructuralEng of Structural = CatEng **
otherwise_PConj = ss "otherwise" ;
part_Prep = mkPrep "of" ;
please_Voc = ss "please" ;
possess_Prep = possPrep "of" ;
possess_Prep = mkPrep "of" ;
quite_Adv = mkAdv "quite" ;
she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ;
so_AdA = mkAdA "so" ;
@@ -159,4 +159,3 @@ concrete StructuralEng of Structural = CatEng **
lin language_title_Utt = ss "English" ;
}

View File

@@ -1,33 +1,37 @@
-- IdRP: no difference between animate/inanimate
Lang: RelCN (UseN friend_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP everybody_NP (SlashV2a love_V2))))
LangEng: friend that everybody loves
AllEngAbs: RelCN (UseN friend_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP everybody_NP (SlashV2a love_V2))))
AllEng: friend that everybody loves
Lang: RelCN (UseN computer_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP everybody_NP (SlashV2a love_V2))))
LangEng: computer that everybody loves
AllEngAbs: RelCN (UseN computer_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP everybody_NP (SlashV2a love_V2))))
AllEng: computer that everybody loves
-- IdRP possessive, RelVP
Lang: RelCN (UseN teacher_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP (FunRP possess_Prep (DetCN every_Det (UseN friend_N)) IdRP) (UseV run_V)))
LangEng: teacher whose every friend runs
-- IdRP + possess_Prep, RelSlash
AllEngAbs: PredVP (RelNP (DetCN (DetQuant DefArt NumSg) (UseN boss_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (FunRP possess_Prep (MassNP (UseN computer_N)) IdRP) (SlashVP everybody_NP (SlashV2a love_V2))))) (UseComp (CompAdv here_Adv))
AllEng: the boss , computer of which everybody loves , is here
Lang: RelCN (UseN car_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP (FunRP possess_Prep (MassNP (UseN oil_N)) IdRP) (UseV run_V)))
LangEng: car whose oil runs
-- IdRP + part_Prep, RelSlash
AllEngAbs: RelNP (MassNP (UseN butter_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (FunRP part_Prep (DetCN (DetQuant IndefArt NumSg) (UseN stick_N)) IdRP) (SlashVP (UsePron i_Pron) (SlashV2a eat_V2))))
AllEng: butter , a stick of which I eat
-- IdRP possessive, RelSlash
Lang: RelNP (DetCN (DetQuant DefArt NumSg) (UseN boss_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (FunRP possess_Prep (MassNP (UseN computer_N)) IdRP) (SlashVP everybody_NP (SlashV2a love_V2))))
LangEng: the boss , whose computer everybody loves
-- GenRP + RelVP
-- NB. with GenRP, can't parse "teacher whose every friend runs", because GenRP takes only a CN
AllEngAbs: RelCN (UseN teacher_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP (GenRP NumSg (UseN friend_N)) (UseV run_V)))
AllEng: teacher whose friend runs
Lang: RelNP (DetCN (DetQuant DefArt NumSg) (UseN restaurant_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (FunRP possess_Prep (MassNP (UseN fruit_N)) IdRP) (SlashVP everybody_NP (SlashV2a love_V2))))
LangEng: the restaurant , whose fruit everybody loves
AllEngAbs: RelCN (UseN car_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP (GenRP NumSg (UseN oil_N)) (UseV run_V)))
AllEng: car whose oil runs
-- Note that every instance of "of" is not possessive—with part_Prep, we get "beer, a glass of which I drink"
-- unfortunately glass_N is not in lexicon, so I substituted words with others
Lang: RelNP (MassNP (UseN butter_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (FunRP part_Prep (DetCN (DetQuant IndefArt NumSg) (UseN stick_N)) IdRP) (SlashVP (UsePron i_Pron) (SlashV2a eat_V2))))
LangEng: butter , a stick of which I eat
-- GenRP + RelSlash
AllEngAbs: PredVP (RelNP (DetCN (DetQuant DefArt NumSg) (UseN boss_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (GenRP NumSg (UseN computer_N)) (SlashVP everybody_NP (SlashV2a love_V2))))) (UseComp (CompAdv here_Adv))
AllEng: the boss , whose computer everybody loves , is here
AllEngAbs: PredVP (RelNP (DetCN (DetQuant DefArt NumSg) (UseN restaurant_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (GenRP NumSg (UseN fruit_N)) (SlashVP everybody_NP (SlashV2a love_V2))))) (UseComp (CompAdv here_Adv))
AllEng: the restaurant , whose fruit everybody loves , is here
-- IdRP other, RelSlash
-- RelVP really doesn't make sensethe preposition in FunRP looks like an object complement?
-- e.g. "Paris , the best city *in* which *I have lived* -- gap: "I have loved *in Paris*
-- e.g. "Paris , the best city *in* which *I have lived* -- gap: "I have lived *in Paris*
-- for RelVP, the noun is a subject:
-- e.g. "Paris , the best city ∅ which sleeps" -- no gap: "Paris sleeps"
@@ -38,16 +42,18 @@ LangEng: butter , a stick of which I eat
-- Transitive verb + preposition in RP
-- The RP is the whole [the best city in which]
Lang: RelNP (UsePN paris_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP in_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdSuperl good_A)) (UseN city_N)) IdRP) (SlashVP (UsePron i_Pron) (SlashV2a love_V2))))
LangEng: Paris , the best city in which I have loved
-- We can't even do "lived in", because because live_V is intransitive and RelSlash requires transitive.
-- So let's switch to love_V2 instead.
AllEngAbs: RelNP (UsePN paris_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP in_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdSuperl good_A)) (UseN city_N)) IdRP) (SlashVP (UsePron i_Pron) (SlashV2a love_V2))))
AllEng: Paris , the best city in which I have loved
-- Intransitive verb + preposition in ClSlash
-- The RP is just [that]
Lang: RelNP (UsePN paris_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (UseV live_V)) in_Prep)))
LangEng: Paris , that I have lived in
AllEngAbs: RelNP (UsePN paris_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (UseV live_V)) in_Prep)))
AllEng: Paris , that I have lived in
Lang: PredVP (UsePN paris_PN) (UseComp (CompNP (DetCN (DetQuantOrd DefArt NumSg (OrdSuperl good_A)) (RelCN (UseN city_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (UseV live_V)) in_Prep)))))))
LangEng: Paris is the best city that I have lived in
AllEngAbs: PredVP (UsePN paris_PN) (UseComp (CompNP (DetCN (DetQuantOrd DefArt NumSg (OrdSuperl good_A)) (RelCN (UseN city_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (UseV live_V)) in_Prep)))))))
AllEng: Paris is the best city that I have lived in
-- to get "… city I have lived in", use Extend.EmptyRelSlash in place of RelSlash
@@ -55,36 +61,33 @@ LangEng: Paris is the best city that I have lived in
-- Now let's do complicated structures!
-- FunRP + ditransitive verb. The whole string is the RS, and the substring [the first car to which] is the RP.
Lang: UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN car_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N)))))
LangEng: the first car to which I have given oil
AllEngAbs: UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN car_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N)))))
AllEng: the first car to which I have given oil
-- IdRP + ditransitive verb. The whole string is now a NP, and RS is just a small part of it: [[that]:RP I have given oil]:RS
Lang: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN car_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N)))))))
LangEng: the first car that I have given oil
AllEngAbs: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN car_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N)))))))
AllEng: the first car that I have given oil
-- IdRP + ditransitive verb, but the verb has an inherent preposition
Lang: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN country_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 sell_V3 (MassNP (UseN oil_N)))))))
LangEng: the first country that I have sold oil to
AllEngAbs: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN country_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 sell_V3 (MassNP (UseN oil_N)))))))
AllEng: the first country that I have sold oil to
-- let's test with Slash3V3 for completeness' sake
Lang: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN oil_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash3V3 sell_V3 (DetCN (DetQuant IndefArt NumSg) (UseN country_N)))))))
LangEng: the first oil that I have sold to a country
AllEngAbs: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN oil_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash3V3 sell_V3 (DetCN (DetQuant IndefArt NumSg) (UseN country_N)))))))
AllEng: the first oil that I have sold to a country
-- FunRP + ditransitive verb, now in a context
-- Suppose that I have a car named John. Now the relative pronoun "which" is chosen after the noun "car".
Lang: RelNP (UsePN john_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN car_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N))))))
LangEng: John , the first car to which I have given oil
AllEngAbs: RelNP (UsePN john_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN car_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N))))))
AllEng: John , the first car to which I have given oil
-- Suppose that I have a friend named John. Now the relative pronoun "who" is chosen after the noun "friend".
Lang: RelNP (UsePN john_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd (PossPron i_Pron) NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN friend_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN beer_N))))))
LangEng: John , my first friend to who I have given beer
AllEngAbs: RelNP (UsePN john_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd (PossPron i_Pron) NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN friend_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN beer_N))))))
AllEng: John , my first friend to who I have given beer
-- If I really wanted to describe "John , my first friend […]", I would prefer using Extend.ApposNP to get a tree that makes more sense
-- this doesn't linearise in core RGL, but here's the tree:
-- ApposNP (UsePN john_PN) (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN friend_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN beer_N))))))))
-- approximating with ApposCN (which doesn't add comma):
Lang: ApposCN (UseN boy_N) (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN friend_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN beer_N))))))))
LangEng: boy the first friend that I have given beer
AllEngAbs: ApposNP (UsePN john_PN) (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN friend_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN beer_N))))))))
AllEng: John , the first friend that I have given beer