forked from GitHub/gf-rgl
questions and transfer in shell state
This commit is contained in:
@@ -1,15 +1,13 @@
|
|||||||
abstract Cat = {
|
abstract Cat = {
|
||||||
cat
|
cat
|
||||||
S ;
|
S ;
|
||||||
Cl ;
|
|
||||||
QS ;
|
QS ;
|
||||||
|
|
||||||
|
Cl ;
|
||||||
QCl ;
|
QCl ;
|
||||||
Slash ;
|
Slash ;
|
||||||
|
|
||||||
|
|
||||||
VP ;
|
VP ;
|
||||||
AP ;
|
|
||||||
Comp ;
|
|
||||||
|
|
||||||
V ;
|
V ;
|
||||||
V2 ;
|
V2 ;
|
||||||
@@ -18,6 +16,9 @@ abstract Cat = {
|
|||||||
VS ;
|
VS ;
|
||||||
VQ ;
|
VQ ;
|
||||||
|
|
||||||
|
AP ;
|
||||||
|
Comp ;
|
||||||
|
|
||||||
Adv ;
|
Adv ;
|
||||||
|
|
||||||
CN ;
|
CN ;
|
||||||
@@ -33,4 +34,12 @@ abstract Cat = {
|
|||||||
Quant ;
|
Quant ;
|
||||||
Num ;
|
Num ;
|
||||||
|
|
||||||
|
Prep ;
|
||||||
|
|
||||||
|
IP ;
|
||||||
|
IAdv ;
|
||||||
|
IDet ;
|
||||||
|
|
||||||
|
RP ;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,26 @@
|
|||||||
concrete CatEng of Cat = open ResEng in {
|
concrete CatEng of Cat = open ResEng in {
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
S = {s : Str} ;
|
S = {s : Str} ;
|
||||||
|
QS = {s : QForm => Str} ;
|
||||||
|
|
||||||
Cl = {s : Tense => Anteriority => Polarity => Ord => Str} ;
|
Cl = {s : Tense => Anteriority => Polarity => Ord => Str} ;
|
||||||
Slash = {s : Tense => Anteriority => Polarity => Ord => Str} ** {c2 : Str} ;
|
Slash = {s : Tense => Anteriority => Polarity => Ord => Str} ** {c2 : Str} ;
|
||||||
|
|
||||||
|
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
|
||||||
|
|
||||||
VP = {
|
VP = {
|
||||||
s : Tense => Anteriority => Polarity => Ord => Agr => {fin, inf : Str} ;
|
s : Tense => Anteriority => Polarity => Ord => Agr => {fin, inf : Str} ;
|
||||||
s2 : Agr => Str
|
s2 : Agr => Str
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AP = {s : Str} ;
|
|
||||||
Comp = {s : Agr => Str} ;
|
|
||||||
|
|
||||||
V, VS, VQ = Verb ; -- = {s : VForm => Str} ;
|
V, VS, VQ = Verb ; -- = {s : VForm => Str} ;
|
||||||
V2, VV = Verb ** {c2 : Str} ;
|
V2, VV = Verb ** {c2 : Str} ;
|
||||||
V3 = Verb ** {c2, c3 : Str} ;
|
V3 = Verb ** {c2, c3 : Str} ;
|
||||||
|
|
||||||
|
AP = {s : Str} ;
|
||||||
|
Comp = {s : Agr => Str} ;
|
||||||
|
|
||||||
Adv = {s : Str} ;
|
Adv = {s : Str} ;
|
||||||
|
|
||||||
Det, Quant = {s : Str ; n : Number} ;
|
Det, Quant = {s : Str ; n : Number} ;
|
||||||
@@ -28,4 +32,8 @@ concrete CatEng of Cat = open ResEng in {
|
|||||||
N2 = {s : Number => Case => Str} ** {c2 : Str} ;
|
N2 = {s : Number => Case => Str} ** {c2 : Str} ;
|
||||||
N3 = {s : Number => Case => Str} ** {c2,c3 : Str} ;
|
N3 = {s : Number => Case => Str} ** {c2,c3 : Str} ;
|
||||||
|
|
||||||
|
IP = {s : Case => Str ; n : Number} ;
|
||||||
|
IDet = {s : Str ; n : Number} ;
|
||||||
|
IAdv = {s : Str} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
abstract Lex = Cat ** {
|
abstract Lex = Cat ** {
|
||||||
|
|
||||||
fun
|
fun
|
||||||
walk_V : V ;
|
walk_V : V ;
|
||||||
kill_V2 : V2 ;
|
kill_V2 : V2 ;
|
||||||
@@ -11,8 +12,22 @@ abstract Lex = Cat ** {
|
|||||||
dog_N : N ;
|
dog_N : N ;
|
||||||
son_N2 : N2 ;
|
son_N2 : N2 ;
|
||||||
way_N3 : N3 ;
|
way_N3 : N3 ;
|
||||||
|
|
||||||
|
-- structural
|
||||||
|
|
||||||
|
|
||||||
|
only_Predet : Predet ;
|
||||||
|
|
||||||
|
this_Quant : Quant ;
|
||||||
|
|
||||||
|
|
||||||
i_Pron, he_Pron, we_Pron : Pron ;
|
i_Pron, he_Pron, we_Pron : Pron ;
|
||||||
|
|
||||||
|
whoSg_IP, whoPl_IP, whatSg_IP, whatPl_IP : IP ;
|
||||||
|
|
||||||
|
when_IAdv, where_IAdv, why_IAdv : IAdv ;
|
||||||
|
|
||||||
|
whichSg_IDet, whichPl_IDet : IDet ;
|
||||||
|
|
||||||
here_Adv : Adv ;
|
here_Adv : Adv ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,14 @@ concrete LexEng of Lex = CatEng ** open ResEng in {
|
|||||||
|
|
||||||
here_Adv = {s = "here"} ;
|
here_Adv = {s = "here"} ;
|
||||||
|
|
||||||
-- structural
|
only_Predet = {s = "only"} ;
|
||||||
|
this_Quant = {s = "this" ; n = Sg} ;
|
||||||
|
|
||||||
i_Pron = mkNP "I" "me" "my" Sg P1 ;
|
i_Pron = mkNP "I" "me" "my" Sg P1 ;
|
||||||
he_Pron = mkNP "he" "him" "his" Sg P3 ;
|
he_Pron = mkNP "he" "him" "his" Sg P3 ;
|
||||||
we_Pron = mkNP "we" "us" "our" Pl P1 ;
|
we_Pron = mkNP "we" "us" "our" Pl P1 ;
|
||||||
|
|
||||||
|
whoSg_IP = mkIP "who" "whom" "whose" Sg ;
|
||||||
|
whoPl_IP = mkIP "who" "whom" "whose" Pl ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ abstract Noun = Cat ** {
|
|||||||
DetCN : Det -> CN -> NP ;
|
DetCN : Det -> CN -> NP ;
|
||||||
UsePN : PN -> NP ;
|
UsePN : PN -> NP ;
|
||||||
UsePron : Pron -> NP ;
|
UsePron : Pron -> NP ;
|
||||||
UsePron2 : Pron -> NP ;
|
|
||||||
|
|
||||||
MkDet : Predet -> Quant -> Num -> Det ;
|
MkDet : Predet -> Quant -> Num -> Det ;
|
||||||
|
|
||||||
@@ -31,9 +30,4 @@ abstract Noun = Cat ** {
|
|||||||
|
|
||||||
UseN : N -> CN ;
|
UseN : N -> CN ;
|
||||||
|
|
||||||
-- structural
|
|
||||||
|
|
||||||
only_Predet : Predet ;
|
|
||||||
this_Quant : Quant ;
|
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ concrete NounEng of Noun = CatEng ** open ResEng in {
|
|||||||
lin
|
lin
|
||||||
DetCN det cn = {s = \\c => det.s ++ cn.s ! det.n ! c} ** agrP3 det.n ;
|
DetCN det cn = {s = \\c => det.s ++ cn.s ! det.n ! c} ** agrP3 det.n ;
|
||||||
UsePN pn = pn ** agrP3 Sg ;
|
UsePN pn = pn ** agrP3 Sg ;
|
||||||
-- UsePron p = p ; --- causes mcfg error, even if expanded
|
UsePron p = p ;
|
||||||
UsePron2 p = {s=p.s; a={n=p.a.n;p=p.a.p}} ; --- causes mcfg error, even if expanded
|
|
||||||
|
|
||||||
MkDet pred quant num = {
|
MkDet pred quant num = {
|
||||||
s = pred.s ++ quant.s ++ num.s ;
|
s = pred.s ++ quant.s ++ num.s ;
|
||||||
@@ -30,8 +29,5 @@ concrete NounEng of Noun = CatEng ** open ResEng in {
|
|||||||
ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
|
ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
|
||||||
ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
|
ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
|
||||||
|
|
||||||
-- structural
|
|
||||||
|
|
||||||
only_Predet = {s = "only"} ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
17
resource-1.0/gf/Question.gf
Normal file
17
resource-1.0/gf/Question.gf
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
abstract Question = Cat, Sentence ** {
|
||||||
|
|
||||||
|
fun
|
||||||
|
|
||||||
|
QuestCl : Cl -> QCl ;
|
||||||
|
QuestVP : IP -> VP -> QCl ;
|
||||||
|
QuestSlash : IP -> Slash -> QCl ;
|
||||||
|
QuestIAdv : IAdv -> Cl -> QCl ;
|
||||||
|
|
||||||
|
PrepIP : Prep -> IP -> IAdv ;
|
||||||
|
FunIP : N2 -> IP -> IP ;
|
||||||
|
AdvIP : IP -> Adv -> IP ;
|
||||||
|
|
||||||
|
IDetCN : IDet -> Num -> IP ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
37
resource-1.0/gf/QuestionEng.gf
Normal file
37
resource-1.0/gf/QuestionEng.gf
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
concrete QuestionEng of Question = CatEng, SentenceEng ** open ResEng in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
QuestCl cl = {
|
||||||
|
s = \\t,a,p =>
|
||||||
|
let cls = cl.s ! t ! a ! p
|
||||||
|
in table {
|
||||||
|
QDir => cls ! OQuest ;
|
||||||
|
QIndir => "if" ++ cls ! ODir
|
||||||
|
} ---- "whether" in exts
|
||||||
|
} ;
|
||||||
|
|
||||||
|
QuestVP qp vp = {
|
||||||
|
s = \\t,a,b,q =>
|
||||||
|
let
|
||||||
|
agr = {n = qp.n ; p = P3} ;
|
||||||
|
verb = vp.s ! t ! a ! b ! ODir ! agr ;
|
||||||
|
subj = qp.s ! Nom ;
|
||||||
|
compl = vp.s2 ! agr
|
||||||
|
in
|
||||||
|
subj ++ verb.fin ++ verb.inf ++ compl
|
||||||
|
} ;
|
||||||
|
|
||||||
|
{-
|
||||||
|
QuestSlash : IP -> Slash -> QCl ;
|
||||||
|
QuestIAdv : IAdv -> Cl -> QCl ;
|
||||||
|
|
||||||
|
PrepIP : Prep -> IP -> IAdv ;
|
||||||
|
FunIP : N2 -> IP -> IP ;
|
||||||
|
AdvIP : IP -> Adv -> IP ;
|
||||||
|
|
||||||
|
IDetCN : IDet -> Num -> IP ;
|
||||||
|
-}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -36,6 +36,9 @@ resource ResEng = ParamX ** {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} =
|
||||||
|
\i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ;
|
||||||
|
|
||||||
mkNP : (i,me,my : Str) -> Number -> Person -> {s : Case => Str ; a : Agr} =
|
mkNP : (i,me,my : Str) -> Number -> Person -> {s : Case => Str ; a : Agr} =
|
||||||
\i,me,my,n,p -> {
|
\i,me,my,n,p -> {
|
||||||
s = table {
|
s = table {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ abstract Test =
|
|||||||
Noun,
|
Noun,
|
||||||
Verb,
|
Verb,
|
||||||
Sentence,
|
Sentence,
|
||||||
|
Question,
|
||||||
Untensed,
|
Untensed,
|
||||||
-- Tensed,
|
-- Tensed,
|
||||||
Lex
|
Lex
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ concrete TestEng of Test =
|
|||||||
NounEng,
|
NounEng,
|
||||||
VerbEng,
|
VerbEng,
|
||||||
SentenceEng,
|
SentenceEng,
|
||||||
|
QuestionEng,
|
||||||
UntensedEng,
|
UntensedEng,
|
||||||
-- TensedEng,
|
-- TensedEng,
|
||||||
LexEng
|
LexEng
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
abstract Untensed = Cat ** {
|
abstract Untensed = Cat ** {
|
||||||
|
|
||||||
fun
|
fun
|
||||||
PosCl, NegCl : Cl -> S ;
|
PosCl, NegCl : Cl -> S ;
|
||||||
|
PosQCl, NegQCl : QCl -> QS ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,7 @@ concrete UntensedEng of Untensed = CatEng ** open ResEng in {
|
|||||||
PosCl cl = {s = cl.s ! Pres ! Simul ! Pos ! ODir} ;
|
PosCl cl = {s = cl.s ! Pres ! Simul ! Pos ! ODir} ;
|
||||||
NegCl cl = {s = cl.s ! Pres ! Simul ! Neg ! ODir} ;
|
NegCl cl = {s = cl.s ! Pres ! Simul ! Neg ! ODir} ;
|
||||||
|
|
||||||
|
PosQCl cl = {s = cl.s ! Pres ! Simul ! Pos} ;
|
||||||
|
NegQCl cl = {s = cl.s ! Pres ! Simul ! Neg} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ concrete VerbEng of Verb = CatEng ** open ResEng in {
|
|||||||
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ;
|
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ;
|
||||||
ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ;
|
ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ;
|
||||||
ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
|
ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
|
||||||
ComplVQ v q = insertObj (\\_ => q.s) (predV v) ;
|
ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
|
||||||
UseComp comp = insertObj comp.s (predAux auxBe) ;
|
UseComp comp = insertObj comp.s (predAux auxBe) ;
|
||||||
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user