(Kor) Relative clauses

This commit is contained in:
Inari Listenmaa
2020-04-01 18:44:11 +02:00
parent 7b09a6cf8b
commit c23016aaad
4 changed files with 20 additions and 12 deletions

View File

@@ -18,8 +18,8 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
IsDig => glue dets cn.c.s ; IsDig => glue dets cn.c.s ;
NoNum => dets } ; NoNum => dets } ;
in case isNum det of { in case isNum det of {
True => cns ++ detnum ; True => cn.rs ++ cns ++ detnum ;
False => detnum ++ cns } False => cn.rs ++ detnum ++ cns }
} ; } ;
-- : PN -> NP ; -- : PN -> NP ;
@@ -159,8 +159,9 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
} ; } ;
-- : CN -> RS -> CN ; -- : CN -> RS -> CN ;
-- RelCN cn rs = cn ** { RelCN cn rs = cn ** {
-- } ; rs = rs.s
} ;
{- {-
-- : CN -> Adv -> CN ; -- : CN -> Adv -> CN ;

View File

@@ -1,22 +1,26 @@
concrete RelativeKor of Relative = CatKor ** open concrete RelativeKor of Relative = CatKor ** open
ResKor, Prelude, (NS=NounKor), (SS=StructuralKor) in { ResKor, Prelude, (NS=NounKor), (SS=StructuralKor) in {
{-
lin lin
-- : Cl -> RCl ; -- such that John loves her -- : Cl -> RCl ; -- such that John loves her
-- RelCl cl = ; RelCl cl = {s = \\t,a,p => cl.s ! t ! a ! p ! Subord} ;
-- : RP -> VP -> RCl ; -- : RP -> VP -> RCl ;
RelVP rp vp = RelVP rp vp = {
s = \\t,a,p => vp.s ! VAttr p -- TODO no tenses yet in the grammar
++ rp.s ;
} ;
-- : RP -> ClSlash -> RCl ; -- whom John loves -- : RP -> ClSlash -> RCl ; -- whom John loves
RelSlash rp cls = RelSlash rp cls = {
s = \\t,a,p => cls.s ! t ! a ! p ! Subord
++ rp.s ;
} ;
-- : RP ; -- : RP ;
IdRP = {s = ""} ; IdRP = {s = ""} ;
-- : Prep -> NP -> RP -> RP ; -- the mother of whom -- : Prep -> NP -> RP -> RP ; -- the mother of whom
--FunRP prep np rp = {} ; --FunRP prep np rp = {} ;
-}
} }

View File

@@ -22,6 +22,7 @@ oper
Noun3 : Type = Noun ; Noun3 : Type = Noun ;
CNoun : Type = Noun ** { CNoun : Type = Noun ** {
rs : Str ; -- Relative clause comes before determiner
} ; } ;
PNoun : Type = Noun ; PNoun : Type = Noun ;
@@ -32,7 +33,9 @@ oper
c = baseCounter c = baseCounter
} ; } ;
useN : Noun -> CNoun = \n -> n ; useN : Noun -> CNoun = \n -> n ** {
rs = []
} ;
--------------------------------------------- ---------------------------------------------
-- NP -- NP
@@ -309,7 +312,7 @@ oper
QClause : Type = Clause ; QClause : Type = Clause ;
RClause : Type = {s : NForm => Tense => Anteriority => Polarity => Str} ; RClause : Type = {s : Tense => Anteriority => Polarity => Str} ;
Sentence : Type = {s : ClType => Str} ; Sentence : Type = {s : ClType => Str} ;

View File

@@ -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 cl = {s = } ; UseRCl t p rcl = {s = t.s ++ p.s ++ rcl.s ! t.t ! t.a ! p.p} ;
-- AdvS : Adv -> S -> S ; -- then I will go home -- AdvS : Adv -> S -> S ; -- then I will go home
AdvS = advS "" ; AdvS = advS "" ;