mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
(Kor) Add inflection table to RCl and RS, change other funs accordingly
This commit is contained in:
@@ -8,8 +8,8 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in {
|
|||||||
-- Constructed in SentenceKor, and also in IdiomKor
|
-- Constructed in SentenceKor, and also in IdiomKor
|
||||||
|
|
||||||
S = ResKor.Sentence ;
|
S = ResKor.Sentence ;
|
||||||
QS = SS ;
|
QS = SS ; -- Questions not implemented yet
|
||||||
RS = SS ;
|
RS = ResKor.Sentence ;
|
||||||
-- 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.
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ concrete ConjunctionKor of Conjunction =
|
|||||||
|
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[Adv],[AdV],[IAdv],[RS] = ConjSS ;
|
[Adv],[AdV],[IAdv] = ConjSS ;
|
||||||
lin
|
lin
|
||||||
BaseAdv, BaseAdV, BaseIAdv, BaseRS = baseSS ;
|
BaseAdv, BaseAdV, BaseIAdv = baseSS ;
|
||||||
ConsAdv, ConsAdV, ConsIAdv, ConsRS = consSS ;
|
ConsAdv, ConsAdV, ConsIAdv = consSS ;
|
||||||
ConjAdv, ConjAdV, ConjIAdv, ConjRS = conjSS ;
|
ConjAdv, ConjAdV, ConjIAdv = conjSS ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
ConjSS : Type = SS ** {firstSS : ConjType => Str} ;
|
ConjSS : Type = SS ** {firstSS : ConjType => Str} ;
|
||||||
@@ -71,20 +71,22 @@ oper
|
|||||||
mkFirstSS : SS -> ConjType => Str = \s ->
|
mkFirstSS : SS -> ConjType => Str = \s ->
|
||||||
\\conj => glue s.s (conjTable ! VStar ! conj) ;
|
\\conj => glue s.s (conjTable ! VStar ! conj) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[S] = ResKor.Sentence ** {firstS : ConjType => Str} ;
|
[S], [RS] = ResKor.Sentence ** {firstS : ConjType => Str} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
BaseS s1 s2 = s2 ** {
|
BaseS,BaseRS = \s1,s2 -> s2 ** {
|
||||||
firstS = mkFirstS s1
|
firstS = mkFirstS s1
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConsS s ss = ss ** {
|
ConsS,ConsRS = \s,ss -> ss ** {
|
||||||
firstS = \\conj =>
|
firstS = \\conj =>
|
||||||
mkFirstS s ! conj ++ ss.firstS ! conj ;
|
mkFirstS s ! conj ++ ss.firstS ! conj ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConjS co ss = ss ** {
|
ConjS,ConjRS = \co,ss -> ss ** {
|
||||||
s = \\st => co.s1 ++ ss.firstS ! co.c ++ ss.s ! st
|
s = \\st => co.s1 ++ ss.firstS ! co.c ++ ss.s ! st
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
|
|||||||
|
|
||||||
-- : CN -> RS -> CN ;
|
-- : CN -> RS -> CN ;
|
||||||
RelCN cn rs = cn ** {
|
RelCN cn rs = cn ** {
|
||||||
rs = cn.rs ++ rs.s
|
rs = cn.rs ++ rs.s ! Subord
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,21 +3,20 @@ concrete RelativeKor of Relative = CatKor ** open
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
-- : Cl -> RCl ; -- such that John loves her
|
-- : Cl -> RCl ; -- such that John loves her
|
||||||
RelCl cl = {s = \\t,a,p => cl.s ! t ! a ! p ! Subord} ;
|
RelCl = relSlash (ss "") ;
|
||||||
|
|
||||||
-- : RP -> VP -> RCl ;
|
-- : RP -> VP -> RCl ;
|
||||||
RelVP rp vp = {
|
RelVP rp vp = { -- TODO no tenses yet in the grammar
|
||||||
s = \\t,a,p => vp.adv
|
s = \\t,a,p,cltyp =>
|
||||||
++ vp.nObj
|
rp.s ++ vp.adv ++ vp.nObj ++
|
||||||
++ vp.s ! VAttr p -- TODO no tenses yet in the grammar
|
case cltyp of {
|
||||||
++ rp.s ;
|
WithConj => vp.s ! VStem ;
|
||||||
} ;
|
_ => vp.s ! VAttr p } ;
|
||||||
|
} ;
|
||||||
|
|
||||||
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
||||||
RelSlash rp cls = {
|
RelSlash = relSlash ;
|
||||||
s = \\t,a,p => cls.s ! t ! a ! p ! Subord
|
|
||||||
++ rp.s ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- : RP ;
|
-- : RP ;
|
||||||
IdRP = {s = ""} ;
|
IdRP = {s = ""} ;
|
||||||
@@ -25,4 +24,12 @@ lin
|
|||||||
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
|
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
|
||||||
--FunRP prep np rp = {} ;
|
--FunRP prep np rp = {} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
relSlash : SS -> ClSlash -> ResKor.RClause = \rp,cls -> {
|
||||||
|
s = \\t,a,p,cltyp => rp.s ++
|
||||||
|
case cltyp of {
|
||||||
|
WithConj => cls.s ! t ! a ! p ! WithConj ;
|
||||||
|
_ => cls.s ! t ! a ! p ! Subord } ;
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ oper
|
|||||||
|
|
||||||
QClause : Type = Clause ;
|
QClause : Type = Clause ;
|
||||||
|
|
||||||
RClause : Type = {s : Tense => Anteriority => Polarity => Str} ;
|
RClause : Type = Clause ;
|
||||||
|
|
||||||
Sentence : Type = {s : ClType => Str} ;
|
Sentence : Type = {s : ClType => Str} ;
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ lin
|
|||||||
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! Statement} ;
|
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! Statement} ;
|
||||||
|
|
||||||
-- : Temp -> Pol -> RCl -> RS ;
|
-- : Temp -> Pol -> RCl -> RS ;
|
||||||
UseRCl t p rcl = {s = t.s ++ p.s ++ rcl.s ! t.t ! t.a ! p.p} ;
|
UseRCl t p rcl = {s = \\c => t.s ++ p.s ++ rcl.s ! t.t ! t.a ! p.p ! 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