1
0
forked from GitHub/gf-rgl

(Hun) Add relative clauses

This commit is contained in:
Inari Listenmaa
2020-04-17 18:23:21 +02:00
parent 8c9e8e35dd
commit 6de0fe95ec
6 changed files with 73 additions and 22 deletions

View File

@@ -9,7 +9,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in {
S = ResHun.Sentence ;
QS = SS ;
RS = SS ;
RS = ResHun.RP ;
-- relative sentence. Tense and polarity fixed,
-- but agreement may depend on the CN/NP it modifies.
@@ -30,8 +30,8 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in {
--2 Subord clauses and pronouns
--RCl = ResHun.RClause ;
--RP = SS ;
RCl = ResHun.RClause ;
RP = ResHun.RP ;
--2 Verb phrases

View File

@@ -167,8 +167,9 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in {
} ;
-- : CN -> RS -> CN ;
-- RelCN cn rs = cn ** {
-- } ;
RelCN cn rs = cn ** {
s = \\n,c => cn.s ! n ! c ++ rs.s ! n ! c
} ;
{-
-- : CN -> Adv -> CN ;

View File

@@ -46,6 +46,11 @@ oper
Ins => ins ;
Tra => tra } ;
sc2case : SubjCase -> Case = \sc ->
case sc of {
SCNom => Nom ;
SCDat => Dat
} ;
--------------------------------------------------------------------------------
-- Numerals

View File

@@ -1,22 +1,31 @@
concrete RelativeHun of Relative = CatHun ** open
ResHun, Prelude, (NS=NounHun), (SS=StructuralHun) in {
{-
lin
-- : Cl -> RCl ; -- such that John loves her
-- RelCl cl = ;
-- : RP -> VP -> RCl ;
RelVP rp vp =
RelVP = relVP ;
-- : RP -> ClSlash -> RCl ; -- whom John loves
RelSlash rp cls =
RelSlash = relSlash ;
-- : RP ;
IdRP = {s = ""} ;
IdRP = {s =
table {Sg => caseTable "ami" "amit" "aminek" -- nom, acc, dat
"amibe" "amiben" "amiből" -- ill, ine, ela
"amihez" "aminél" "amitől" -- all, ade, abl
"amire" "amin" "amiről" -- sub, sup, del
"amiért" "amivel" "amivé" ; -- cau, ins, tra
Pl => caseTable "amik" "amiket" "amiknek" -- nom, acc, dat
"amikbe" "amikben" "amikből" -- ill, ine, ela
"amikhez" "amiknél" "amiktől" -- all, ade, abl
"amikre" "amiken" "amikről" -- sub, sup, del
"amikért" "amikkel" "amikké"}; -- cau, ins, tra
} ;
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
--FunRP prep np rp = {} ;
-}
}

View File

@@ -301,25 +301,61 @@ oper
{- After PredVP, we might still want to add more adverbs (QuestIAdv),
but we're done with verb inflection.
-}
ClSlash : Type = Clause ;
ClSlash : Type = Clause ** {
sc : SubjCase ; -- For RelSlash
} ;
QClause : Type = Clause ;
-- RClause : Type = {s : NForm => Tense => Anteriority => Polarity => Str} ;
Sentence : Type = {s : Str} ;
-- predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** {
-- s = \\t,a,p => let subjcase : Case = case vp.sc of {
-- SCNom => Nom ;
-- SCDat => Dat }
-- in np.s ! subjcase
-- ++ np.empty -- standard trick for prodrop
-- ++ vp.s ! agr2vf np.agr
-- ++ vp.obj
-- ++ vp.adv
-- } ;
predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** {
s = \\t,a,p => let subjcase : Case = case vp.sc of {
SCNom => Nom ;
SCDat => Dat }
in np.s ! subjcase
++ np.empty -- standard trick for prodrop
++ vp.s ! agr2vf np.agr
++ vp.obj
++ vp.adv
s = let rel : RClause = relVP' (np2rp np) vp ;
in \\t,a,p => rel.s ! t ! a ! p ! np.agr.p2 ! sc2case vp.sc
++ np.empty ; -- standard trick for prodrop+metavariable problem
} ;
-- Relative
RP : Type = {s : Number => Case => Str} ;
RClause : Type = {s : Tense => Anteriority => Polarity => Number => Case => Str} ;
np2rp : NounPhrase -> RP ** {agr : Person*Number} = \np -> np ** {
s = \\n => np.s ;
} ;
relVP : RP -> VerbPhrase -> RClause = \rp -> relVP' (rp ** {agr=<P3,Sg>}) ;
relVP' : RP ** {agr : Person*Number} -> VerbPhrase -> RClause = \rp,vp -> {
s = \\t,a,p,n,c => let subjcase : Case = case vp.sc of {
SCNom => c ;
SCDat => Dat }
in rp.s ! n ! subjcase
++ vp.s ! VFin rp.agr.p1 n -- variable by number
++ vp.obj
++ vp.adv
} ;
relSlash : RP -> ClSlash -> RClause = \rp,cls -> {
s = \\t,a,p,n,c => let subjcase : Case = case cls.sc of {
SCNom => c ;
SCDat => Dat }
in rp.s ! n ! subjcase
++ cls.s ! t ! a ! p
} ;
--------------------------------------------------------------------------------
-- linrefs

View File

@@ -15,7 +15,7 @@ lin
--2 Clauses missing object noun phrases
-- : NP -> VPSlash -> ClSlash ;
-- SlashVP = predVP ;
SlashVP np vps = predVP np (vps ** {s = vps.s ! Def ; obj = []}) ;
{-
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
AdvSlash cls adv = cls ** insertAdv adv cls ;
@@ -56,7 +56,7 @@ lin
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
-- : Temp -> Pol -> RCl -> RS ;
-- UseRCl t p cl = {s = } ;
UseRCl t p cl = {s = \\n,c => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! n ! c} ;
-- AdvS : Adv -> S -> S ; -- then I will go home
AdvS = advS "" ;