forked from GitHub/gf-core
working on questions
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
concrete LexEng of Lex = CatEng ** open ResEng in {
|
concrete LexEng of Lex = CatEng ** open ResEng in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
walk_V = regV "walk" ;
|
walk_V = regV "walk" ;
|
||||||
kill_V2 = regV "kill" ** {c2 = []} ;
|
kill_V2 = regV "kill" ** {c2 = []} ;
|
||||||
@@ -24,4 +25,8 @@ concrete LexEng of Lex = CatEng ** open ResEng in {
|
|||||||
whoSg_IP = mkIP "who" "whom" "whose" Sg ;
|
whoSg_IP = mkIP "who" "whom" "whose" Sg ;
|
||||||
whoPl_IP = mkIP "who" "whom" "whose" Pl ;
|
whoPl_IP = mkIP "who" "whom" "whose" Pl ;
|
||||||
|
|
||||||
|
when_IAdv = {s = "when"} ;
|
||||||
|
|
||||||
|
whichSg_IDet = {s = "which" ; n = Sg} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ abstract Question = Cat, Sentence ** {
|
|||||||
FunIP : N2 -> IP -> IP ;
|
FunIP : N2 -> IP -> IP ;
|
||||||
AdvIP : IP -> Adv -> IP ;
|
AdvIP : IP -> Adv -> IP ;
|
||||||
|
|
||||||
IDetCN : IDet -> Num -> IP ;
|
IDetCN : IDet -> Num -> CN -> IP ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ concrete QuestionEng of Question = CatEng, SentenceEng ** open ResEng in {
|
|||||||
in table {
|
in table {
|
||||||
QDir => cls ! OQuest ;
|
QDir => cls ! OQuest ;
|
||||||
QIndir => "if" ++ cls ! ODir
|
QIndir => "if" ++ cls ! ODir
|
||||||
} ---- "whether" in exts
|
} ---- "whether" in ExtEng
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestVP qp vp = {
|
QuestVP qp vp = {
|
||||||
@@ -22,16 +22,40 @@ concrete QuestionEng of Question = CatEng, SentenceEng ** open ResEng in {
|
|||||||
subj ++ verb.fin ++ verb.inf ++ compl
|
subj ++ verb.fin ++ verb.inf ++ compl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{-
|
QuestSlash ip slash = {
|
||||||
QuestSlash : IP -> Slash -> QCl ;
|
s = \\t,a,p =>
|
||||||
QuestIAdv : IAdv -> Cl -> QCl ;
|
let
|
||||||
|
cls = slash.s ! t ! a ! p ;
|
||||||
|
who = slash.c2 ++ ip.s ! Acc --- stranding in ExtEng
|
||||||
|
in table {
|
||||||
|
QDir => who ++ cls ! OQuest ;
|
||||||
|
QIndir => who ++ cls ! ODir
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
PrepIP : Prep -> IP -> IAdv ;
|
QuestIAdv iadv cl = {
|
||||||
FunIP : N2 -> IP -> IP ;
|
s = \\t,a,p =>
|
||||||
AdvIP : IP -> Adv -> IP ;
|
let
|
||||||
|
cls = cl.s ! t ! a ! p ;
|
||||||
|
why = iadv.s
|
||||||
|
in table {
|
||||||
|
QDir => why ++ cls ! OQuest ;
|
||||||
|
QIndir => why ++ cls ! ODir
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PrepIP p ip = {s = p.s ++ ip.s ! Nom} ;
|
||||||
|
|
||||||
|
---- FunIP : N2 -> IP -> IP ;
|
||||||
|
AdvIP ip adv = {
|
||||||
|
s = \\c => ip.s ! c ++ adv.s ;
|
||||||
|
n = ip.n
|
||||||
|
} ;
|
||||||
|
|
||||||
IDetCN : IDet -> Num -> IP ;
|
IDetCN idet num cn = {
|
||||||
-}
|
s = \\c => idet.s ++ num.s ++ cn.s ! idet.n ! c ;
|
||||||
|
n = idet.n
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,5 +6,6 @@ abstract Sentence = Cat ** {
|
|||||||
|
|
||||||
SlashV2 : NP -> V2 -> Slash ;
|
SlashV2 : NP -> V2 -> Slash ;
|
||||||
|
|
||||||
|
AdvSlash : Slash -> Adv -> Slash ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,4 +17,23 @@ concrete SentenceEng of Sentence = CatEng ** open ResEng in {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
SlashV2 np v2 = {
|
||||||
|
s = \\t,a,b,o =>
|
||||||
|
let
|
||||||
|
agr = np.a ;
|
||||||
|
verb = (predV v2).s ! t ! a ! b ! o ! agr ;
|
||||||
|
subj = np.s ! Nom
|
||||||
|
in
|
||||||
|
case o of {
|
||||||
|
ODir => subj ++ verb.fin ++ verb.inf ;
|
||||||
|
OQuest => verb.fin ++ subj ++ verb.inf
|
||||||
|
} ;
|
||||||
|
c2 = v2.c2
|
||||||
|
} ;
|
||||||
|
--- PredVP (np ** {lock_NP =<>}) (UseV (v2 ** {lock_V = <>})) ** {c2 = v2.c2} ;
|
||||||
|
|
||||||
|
AdvSlash slash adv = {
|
||||||
|
s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ;
|
||||||
|
c2 = slash.c2
|
||||||
|
} ;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user