forked from GitHub/gf-rgl
(Ara) Add variable gender to IP
This commit is contained in:
@@ -11,7 +11,7 @@ concrete PhraseAra of Phrase = CatAra ** open
|
||||
UttImpSg pol imp = {s = \\g => imp.s ! pol.p ! g ! ResAra.Sg ++ pol.s} ;
|
||||
UttImpPl,UttImpPol = \pol,imp -> {s = \\g => imp.s ! pol.p ! g ! ResAra.Pl ++ pol.s} ;
|
||||
|
||||
UttIP ip = {s = \\_g => ip.s ! False ! Def ! Nom} ; --IL
|
||||
UttIP ip = {s = \\g => ip.s ! False ! g ! Def ! Nom} ; --IL
|
||||
UttAP ap = {s = ResAra.uttAP ap} ; --IL
|
||||
UttCard c = {s = ResAra.uttNum c} ; --IL
|
||||
|
||||
|
||||
@@ -29,14 +29,15 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
|
||||
-- : IComp -> NP -> QCl
|
||||
QuestIComp ic np =
|
||||
let vp = kaan (CompNP np) ;
|
||||
ip : ResAra.IP = np ** {
|
||||
s = \\_,_,_ => ic.s ! pgn2gn np.a.pgn } ;
|
||||
ip : ResAra.IP = np ** { -- NP's s is already present in VP, we only want its agr
|
||||
s = \\_,_,_,_ => ic.s ! pgn2gn np.a.pgn } ;
|
||||
in QuestVP ip vp ;
|
||||
|
||||
-- : IP -> IComp ;
|
||||
CompIP ip = ip ** {
|
||||
s = \\_ => ip.s ! True -- True=IP will be a subject of predicative sentence
|
||||
! Def ! Nom ; -- IP will be a subject
|
||||
s = \\gn => ip.s ! True -- True=IP will be a subject of predicative sentence
|
||||
! gn.g -- IComp agrees in gender with eventual head
|
||||
! Def ! Nom ; -- IP will be a subject
|
||||
} ;
|
||||
|
||||
CompIAdv iadv = { s = \\_ => iadv.s ; a = ResAra.Sg } ;
|
||||
@@ -46,28 +47,29 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
|
||||
s = \\t,p,qf =>
|
||||
let cl : ResAra.Cl = complClSlash cls ; -- dummy conversion to Cl
|
||||
o = case qf of { QDir => Nominal ; _ => Verbal } ; -- purely guessing
|
||||
in cls.c2.s ++ ip.s ! False ! Def ! Nom ++ cl.s ! t ! p ! o
|
||||
in cls.c2.s ++ ip.s ! False ! Masc ! Def ! Nom ++ cl.s ! t ! p ! o
|
||||
} ;
|
||||
|
||||
--IL guessed
|
||||
PrepIP p ip = {
|
||||
s = p.s ++ ip.s ! False -- not used as a subject of predicative sentence
|
||||
! Masc ----
|
||||
! Def ! Gen
|
||||
} ;
|
||||
|
||||
AdvIP ip adv = ip ** {
|
||||
s = \\g,s,c => ip.s ! g ! s ! c ++ adv.s ;
|
||||
s = \\isPred,g,s,c => ip.s ! isPred ! g ! s ! c ++ adv.s ;
|
||||
} ;
|
||||
|
||||
-- : IDet -> IP
|
||||
IdetIP idet = idet ** {
|
||||
s = \\isPred => idet.s ! Masc ;
|
||||
s = \\isPred => idet.s ;
|
||||
a = { pgn = agrP3 NoHum Masc idet.n ; isPron = False }
|
||||
} ;
|
||||
|
||||
-- : IDet -> CN -> IP
|
||||
IdetCN idet cn = {
|
||||
s = \\isPred,s,c
|
||||
s = \\isPred,g,s,c
|
||||
=> idet.s ! cn.g ! s ! c ++
|
||||
cn.s ! idet.n ! Indef ! Gen ; --idaafa
|
||||
a = { pgn = agrP3 NoHum cn.g idet.n ; isPron = False }
|
||||
|
||||
@@ -1141,12 +1141,12 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
|
||||
mkIP = overload {
|
||||
mkIP : Str -> Number -> IP = \maa,n -> {
|
||||
s = \\_p,_s,_c => maa ;
|
||||
s = \\_p,_g,_s,_c => maa ;
|
||||
a = { pgn = agrP3 NoHum Masc n ; isPron = False }
|
||||
} ;
|
||||
mkIP : (_,_ : Str) -> Number -> IP = \maa,maadhaa,n -> {
|
||||
s = table { True => \\_s,_c => maa ;
|
||||
False => \\_s,_c => maadhaa } ;
|
||||
s = table { True => \\_g,_s,_c => maa ;
|
||||
False => \\_g,_s,_c => maadhaa } ;
|
||||
a = { pgn = agrP3 NoHum Masc n ; isPron = False }
|
||||
}
|
||||
} ;
|
||||
@@ -1229,13 +1229,15 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
|
||||
IP : Type = {
|
||||
s : Bool -- different forms for "what is this" and "what do you do"
|
||||
=> State => Case -- because of PrepIP: e.g. "in which" chooses definite accusative
|
||||
=> Gender -- because an IP can be made into an IComp
|
||||
=> State => Case -- because of PrepIP: e.g. "in which" chooses definite accusative
|
||||
=> Str ;
|
||||
a : Agr -- can be both subject and object of a QCl, needs full agr. info
|
||||
a : Agr -- can be both subject and object of a QCl, needs full agr. info (stupid given that s depends on gender but meh)
|
||||
} ;
|
||||
|
||||
ip2np : IP -> Bool -> NP = \ip,isPred -> ip ** { s = ip.s ! isPred ! Def } ;
|
||||
|
||||
ip2np : IP -> Bool -> NP = \ip,isPred -> ip ** { s = ip.s ! isPred ! Masc ! Def ; empty = [] } ;
|
||||
np2ip : NP -> IP = \np -> np ** {s = \\_,_,_ => np.s} ;
|
||||
|
||||
IDet : Type = {
|
||||
s : Gender -- IdetCN needs to choose the gender of the CN
|
||||
=> State => Case => Str ;
|
||||
|
||||
Reference in New Issue
Block a user