1
0
forked from GitHub/gf-rgl

(May) WIP relative clauses

This commit is contained in:
Inari Listenmaa
2020-08-18 21:36:04 +02:00
parent 53eb8ab9df
commit 095f11abb7
5 changed files with 39 additions and 22 deletions

View File

@@ -9,12 +9,12 @@ concrete CatMay of Cat = CommonX ** open ResMay, Prelude in {
S = ResMay.Sentence ;
QS = SS ;
RS = SS ;
RS = ResMay.RClause ;
-- relative sentence. Tense and polarity fixed,
-- but agreement may depend on the CN/NP it modifies.
Cl = ResMay.Clause ;
ClSlash = ResMay.Clause ;
ClSlash = ResMay.ClSlash ;
SSlash = ResMay.Sentence ; -- sentence missing NP; e.g. "she has looked at"
Imp = {s : Number => Polarity => Str} ; -- imperative e.g. "look at this"
@@ -30,7 +30,7 @@ concrete CatMay of Cat = CommonX ** open ResMay, Prelude in {
--2 Subord clauses and pronouns
RCl = ResMay.Clause ;
RCl = ResMay.RClause ;
RP = SS ;
--2 Verb phrases

View File

@@ -38,8 +38,9 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in {
--AdvNP,ExtAdvNP = \np,adv -> np ** {} ;
-- : NP -> RS -> NP ; -- Paris, which is here
-- RelNP np rs = np ** {
-- } ;
RelNP np rs = np ** {
s = np.s ++ rs.subj ++ rs.pred ! np.p
} ;
-- Determiners can form noun phrases directly.
@@ -144,8 +145,9 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in {
-- } ;
-- : CN -> RS -> CN ;
-- RelCN cn rs = cn ** {
-- } ;
RelCN cn rs = cn ** {
s = \\nf => cn.s ! nf ++ rs.subj ++ rs.pred ! P3
} ;
{-
-- : CN -> Adv -> CN ;

View File

@@ -1,5 +1,5 @@
concrete RelativeMay of Relative = CatMay ** open
ResMay, Prelude, (NS=NounMay), (SS=StructuralMay) in {
ResMay, Prelude in {
lin
@@ -9,11 +9,17 @@ lin
-- : RP -> VP -> RCl ;
RelVP rp vp = {
subj = rp.s ;
pred = vp.s ! Root ; -- TODO
pred = \\_ => vp.s ! Root ; -- TODO
} ;
-- : RP -> ClSlash -> RCl ; -- whom John loves
-- RelSlash rp cls =
-- : RP -> ClSlash -> RCl ; -- who I went with
RelSlash rp cls = {
subj = rp.s -- yang
++ cls.subj ; -- saya
pred =
\\p => cls.pred -- ikut sama
++ cls.c2.obj ! p -- dengan+nya (depends on the head, not known yet)
} ;
-- : RP ;
IdRP = {s = "yang"} ;
@@ -23,5 +29,4 @@ lin
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
-- FunRP prep np rp = {} ;
}

View File

@@ -156,6 +156,12 @@ oper
Clause : Type = {subj, pred : Str} ;
RClause : Type = {
subj : Str ;
pred : Person => Str} ;
ClSlash : Type = Clause ** {c2 : Preposition} ;
Sentence : Type = {s : Str} ;
predVP : NounPhrase -> VerbPhrase -> Clause = \np,vp -> {
@@ -163,6 +169,9 @@ oper
pred = vp.s ! Active ; -- TODO
} ;
predVPSlash : NounPhrase -> VPSlash -> ClSlash = \np,vps ->
predVP np <vps : VerbPhrase> ** {c2 = vps.c2} ;
--------------------------------------------------------------------------------
-- linrefs

View File

@@ -15,20 +15,21 @@ lin
--2 Clauses missing object noun phrases
-- : NP -> VPSlash -> ClSlash ;
SlashVP = predVP ;
{-
SlashVP = predVPSlash ;
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
AdvSlash cls adv = cls ** insertAdv adv cls ;
-- AdvSlash cls adv = cls ** insertAdv adv cls ;
-- SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks
-- : Cl -> Prep -> ClSlash ; -- (with whom) he walks
SlashPrep cl prep = cl ** {c2 = prep} ;
{-
-- : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves
-- SlashVS np vs ss = {} ;
SlashVS np vs ss = {} ;
-- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen
UseSlash t p cls = {
} ;
UseSlash t p cls = {} ;
--2 Imperatives
-- : VP -> Imp ;
@@ -58,8 +59,8 @@ lin
} ;
-- : Temp -> Pol -> RCl -> RS ;
UseRCl t p cl = {
s = cl.subj ++ t.s ++ p.s ++ cl.pred ;
UseRCl t p cl = cl ** {
pred = \\per => t.s ++ p.s ++ cl.pred ! per ;
} ;
-- AdvS : Adv -> S -> S ; -- then I will go home