forked from GitHub/gf-rgl
(Hun) Add relative clauses
This commit is contained in:
@@ -9,7 +9,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in {
|
|||||||
|
|
||||||
S = ResHun.Sentence ;
|
S = ResHun.Sentence ;
|
||||||
QS = SS ;
|
QS = SS ;
|
||||||
RS = SS ;
|
RS = ResHun.RP ;
|
||||||
-- relative sentence. Tense and polarity fixed,
|
-- relative sentence. Tense and polarity fixed,
|
||||||
-- but agreement may depend on the CN/NP it modifies.
|
-- 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
|
--2 Subord clauses and pronouns
|
||||||
|
|
||||||
--RCl = ResHun.RClause ;
|
RCl = ResHun.RClause ;
|
||||||
--RP = SS ;
|
RP = ResHun.RP ;
|
||||||
|
|
||||||
--2 Verb phrases
|
--2 Verb phrases
|
||||||
|
|
||||||
|
|||||||
@@ -167,8 +167,9 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : CN -> RS -> CN ;
|
-- : 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 ;
|
-- : CN -> Adv -> CN ;
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ oper
|
|||||||
Ins => ins ;
|
Ins => ins ;
|
||||||
Tra => tra } ;
|
Tra => tra } ;
|
||||||
|
|
||||||
|
sc2case : SubjCase -> Case = \sc ->
|
||||||
|
case sc of {
|
||||||
|
SCNom => Nom ;
|
||||||
|
SCDat => Dat
|
||||||
|
} ;
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Numerals
|
-- Numerals
|
||||||
|
|||||||
@@ -1,22 +1,31 @@
|
|||||||
concrete RelativeHun of Relative = CatHun ** open
|
concrete RelativeHun of Relative = CatHun ** open
|
||||||
ResHun, Prelude, (NS=NounHun), (SS=StructuralHun) in {
|
ResHun, Prelude, (NS=NounHun), (SS=StructuralHun) in {
|
||||||
|
|
||||||
{-
|
|
||||||
lin
|
lin
|
||||||
-- : Cl -> RCl ; -- such that John loves her
|
-- : Cl -> RCl ; -- such that John loves her
|
||||||
-- RelCl cl = ;
|
-- RelCl cl = ;
|
||||||
|
|
||||||
-- : RP -> VP -> RCl ;
|
-- : RP -> VP -> RCl ;
|
||||||
RelVP rp vp =
|
RelVP = relVP ;
|
||||||
|
|
||||||
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
||||||
RelSlash rp cls =
|
RelSlash = relSlash ;
|
||||||
|
|
||||||
-- : RP ;
|
-- : 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
|
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
|
||||||
--FunRP prep np rp = {} ;
|
--FunRP prep np rp = {} ;
|
||||||
-}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -301,25 +301,61 @@ oper
|
|||||||
{- After PredVP, we might still want to add more adverbs (QuestIAdv),
|
{- After PredVP, we might still want to add more adverbs (QuestIAdv),
|
||||||
but we're done with verb inflection.
|
but we're done with verb inflection.
|
||||||
-}
|
-}
|
||||||
ClSlash : Type = Clause ;
|
ClSlash : Type = Clause ** {
|
||||||
|
sc : SubjCase ; -- For RelSlash
|
||||||
|
} ;
|
||||||
|
|
||||||
QClause : Type = Clause ;
|
QClause : Type = Clause ;
|
||||||
|
|
||||||
-- RClause : Type = {s : NForm => Tense => Anteriority => Polarity => Str} ;
|
|
||||||
|
|
||||||
Sentence : Type = {s : 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 ** {
|
predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** {
|
||||||
s = \\t,a,p => let subjcase : Case = case vp.sc of {
|
s = let rel : RClause = relVP' (np2rp np) vp ;
|
||||||
SCNom => Nom ;
|
in \\t,a,p => rel.s ! t ! a ! p ! np.agr.p2 ! sc2case vp.sc
|
||||||
SCDat => Dat }
|
++ np.empty ; -- standard trick for prodrop+metavariable problem
|
||||||
in np.s ! subjcase
|
|
||||||
++ np.empty -- standard trick for prodrop
|
|
||||||
++ vp.s ! agr2vf np.agr
|
|
||||||
++ vp.obj
|
|
||||||
++ vp.adv
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- 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
|
-- linrefs
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ lin
|
|||||||
|
|
||||||
--2 Clauses missing object noun phrases
|
--2 Clauses missing object noun phrases
|
||||||
-- : NP -> VPSlash -> ClSlash ;
|
-- : NP -> VPSlash -> ClSlash ;
|
||||||
-- SlashVP = predVP ;
|
SlashVP np vps = predVP np (vps ** {s = vps.s ! Def ; obj = []}) ;
|
||||||
{-
|
{-
|
||||||
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
|
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
|
||||||
AdvSlash cls adv = cls ** insertAdv adv cls ;
|
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} ;
|
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
|
||||||
|
|
||||||
-- : Temp -> Pol -> RCl -> RS ;
|
-- : 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 : Adv -> S -> S ; -- then I will go home
|
||||||
AdvS = advS "" ;
|
AdvS = advS "" ;
|
||||||
|
|||||||
Reference in New Issue
Block a user