From 9e8de44fa96b297d1b3b85ef5432e48a0f41f8a1 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 25 Nov 2005 17:40:51 +0000 Subject: [PATCH] questions and transfer in shell state --- resource-1.0/gf/Cat.gf | 17 ++++++++++++---- resource-1.0/gf/CatEng.gf | 16 +++++++++++---- resource-1.0/gf/Lex.gf | 15 ++++++++++++++ resource-1.0/gf/LexEng.gf | 5 ++++- resource-1.0/gf/Noun.gf | 6 ------ resource-1.0/gf/NounEng.gf | 6 +----- resource-1.0/gf/Question.gf | 17 ++++++++++++++++ resource-1.0/gf/QuestionEng.gf | 37 ++++++++++++++++++++++++++++++++++ resource-1.0/gf/ResEng.gf | 3 +++ resource-1.0/gf/Test.gf | 1 + resource-1.0/gf/TestEng.gf | 1 + resource-1.0/gf/Untensed.gf | 3 ++- resource-1.0/gf/UntensedEng.gf | 3 +++ resource-1.0/gf/VerbEng.gf | 2 +- 14 files changed, 110 insertions(+), 22 deletions(-) create mode 100644 resource-1.0/gf/Question.gf create mode 100644 resource-1.0/gf/QuestionEng.gf diff --git a/resource-1.0/gf/Cat.gf b/resource-1.0/gf/Cat.gf index a5f283b12..b74198ad5 100644 --- a/resource-1.0/gf/Cat.gf +++ b/resource-1.0/gf/Cat.gf @@ -1,15 +1,13 @@ abstract Cat = { cat S ; - Cl ; QS ; + + Cl ; QCl ; Slash ; - VP ; - AP ; - Comp ; V ; V2 ; @@ -18,6 +16,9 @@ abstract Cat = { VS ; VQ ; + AP ; + Comp ; + Adv ; CN ; @@ -33,4 +34,12 @@ abstract Cat = { Quant ; Num ; + Prep ; + + IP ; + IAdv ; + IDet ; + + RP ; + } \ No newline at end of file diff --git a/resource-1.0/gf/CatEng.gf b/resource-1.0/gf/CatEng.gf index 3715e7504..a63134af5 100644 --- a/resource-1.0/gf/CatEng.gf +++ b/resource-1.0/gf/CatEng.gf @@ -1,22 +1,26 @@ concrete CatEng of Cat = open ResEng in { lincat - S = {s : Str} ; + S = {s : Str} ; + QS = {s : QForm => Str} ; + Cl = {s : Tense => Anteriority => Polarity => Ord => Str} ; Slash = {s : Tense => Anteriority => Polarity => Ord => Str} ** {c2 : Str} ; + QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ; + VP = { s : Tense => Anteriority => Polarity => Ord => Agr => {fin, inf : Str} ; s2 : Agr => Str } ; - AP = {s : Str} ; - Comp = {s : Agr => Str} ; - V, VS, VQ = Verb ; -- = {s : VForm => Str} ; V2, VV = Verb ** {c2 : Str} ; V3 = Verb ** {c2, c3 : Str} ; + AP = {s : Str} ; + Comp = {s : Agr => Str} ; + Adv = {s : Str} ; Det, Quant = {s : Str ; n : Number} ; @@ -28,4 +32,8 @@ concrete CatEng of Cat = open ResEng in { N2 = {s : Number => Case => Str} ** {c2 : Str} ; N3 = {s : Number => Case => Str} ** {c2,c3 : Str} ; + IP = {s : Case => Str ; n : Number} ; + IDet = {s : Str ; n : Number} ; + IAdv = {s : Str} ; + } diff --git a/resource-1.0/gf/Lex.gf b/resource-1.0/gf/Lex.gf index 6fcd22c04..5e3b6bdb0 100644 --- a/resource-1.0/gf/Lex.gf +++ b/resource-1.0/gf/Lex.gf @@ -1,4 +1,5 @@ abstract Lex = Cat ** { + fun walk_V : V ; kill_V2 : V2 ; @@ -11,8 +12,22 @@ abstract Lex = Cat ** { dog_N : N ; son_N2 : N2 ; way_N3 : N3 ; + +-- structural + + + only_Predet : Predet ; + + this_Quant : Quant ; + 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 ; } diff --git a/resource-1.0/gf/LexEng.gf b/resource-1.0/gf/LexEng.gf index a2a29beee..434f6162d 100644 --- a/resource-1.0/gf/LexEng.gf +++ b/resource-1.0/gf/LexEng.gf @@ -14,11 +14,14 @@ concrete LexEng of Lex = CatEng ** open ResEng in { here_Adv = {s = "here"} ; --- structural + only_Predet = {s = "only"} ; + this_Quant = {s = "this" ; n = Sg} ; i_Pron = mkNP "I" "me" "my" Sg P1 ; he_Pron = mkNP "he" "him" "his" Sg P3 ; we_Pron = mkNP "we" "us" "our" Pl P1 ; + whoSg_IP = mkIP "who" "whom" "whose" Sg ; + whoPl_IP = mkIP "who" "whom" "whose" Pl ; } diff --git a/resource-1.0/gf/Noun.gf b/resource-1.0/gf/Noun.gf index e99bd1154..6c3dca9f8 100644 --- a/resource-1.0/gf/Noun.gf +++ b/resource-1.0/gf/Noun.gf @@ -4,7 +4,6 @@ abstract Noun = Cat ** { DetCN : Det -> CN -> NP ; UsePN : PN -> NP ; UsePron : Pron -> NP ; - UsePron2 : Pron -> NP ; MkDet : Predet -> Quant -> Num -> Det ; @@ -31,9 +30,4 @@ abstract Noun = Cat ** { UseN : N -> CN ; --- structural - - only_Predet : Predet ; - this_Quant : Quant ; - } ; diff --git a/resource-1.0/gf/NounEng.gf b/resource-1.0/gf/NounEng.gf index 700ff567d..68de2e676 100644 --- a/resource-1.0/gf/NounEng.gf +++ b/resource-1.0/gf/NounEng.gf @@ -5,8 +5,7 @@ concrete NounEng of Noun = CatEng ** open ResEng in { lin DetCN det cn = {s = \\c => det.s ++ cn.s ! det.n ! c} ** agrP3 det.n ; UsePN pn = pn ** agrP3 Sg ; --- UsePron p = p ; --- causes mcfg error, even if expanded - UsePron2 p = {s=p.s; a={n=p.a.n;p=p.a.p}} ; --- causes mcfg error, even if expanded + UsePron p = p ; MkDet pred quant num = { 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} ; ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ; --- structural - - only_Predet = {s = "only"} ; } diff --git a/resource-1.0/gf/Question.gf b/resource-1.0/gf/Question.gf new file mode 100644 index 000000000..db47f0e53 --- /dev/null +++ b/resource-1.0/gf/Question.gf @@ -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 ; + +} + diff --git a/resource-1.0/gf/QuestionEng.gf b/resource-1.0/gf/QuestionEng.gf new file mode 100644 index 000000000..215f19e0d --- /dev/null +++ b/resource-1.0/gf/QuestionEng.gf @@ -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 ; +-} + +} + diff --git a/resource-1.0/gf/ResEng.gf b/resource-1.0/gf/ResEng.gf index 51ce3247b..75c0258d9 100644 --- a/resource-1.0/gf/ResEng.gf +++ b/resource-1.0/gf/ResEng.gf @@ -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} = \i,me,my,n,p -> { s = table { diff --git a/resource-1.0/gf/Test.gf b/resource-1.0/gf/Test.gf index f4887015c..dfb43e693 100644 --- a/resource-1.0/gf/Test.gf +++ b/resource-1.0/gf/Test.gf @@ -2,6 +2,7 @@ abstract Test = Noun, Verb, Sentence, + Question, Untensed, -- Tensed, Lex diff --git a/resource-1.0/gf/TestEng.gf b/resource-1.0/gf/TestEng.gf index 6f4af7ea1..b006ebf28 100644 --- a/resource-1.0/gf/TestEng.gf +++ b/resource-1.0/gf/TestEng.gf @@ -2,6 +2,7 @@ concrete TestEng of Test = NounEng, VerbEng, SentenceEng, + QuestionEng, UntensedEng, -- TensedEng, LexEng diff --git a/resource-1.0/gf/Untensed.gf b/resource-1.0/gf/Untensed.gf index 1528e5983..d3e6c08a0 100644 --- a/resource-1.0/gf/Untensed.gf +++ b/resource-1.0/gf/Untensed.gf @@ -1,6 +1,7 @@ abstract Untensed = Cat ** { fun - PosCl, NegCl : Cl -> S ; + PosCl, NegCl : Cl -> S ; + PosQCl, NegQCl : QCl -> QS ; } diff --git a/resource-1.0/gf/UntensedEng.gf b/resource-1.0/gf/UntensedEng.gf index 4ebb195fc..041cf6dfa 100644 --- a/resource-1.0/gf/UntensedEng.gf +++ b/resource-1.0/gf/UntensedEng.gf @@ -6,4 +6,7 @@ concrete UntensedEng of Untensed = CatEng ** open ResEng in { PosCl cl = {s = cl.s ! Pres ! Simul ! Pos ! 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} ; + } diff --git a/resource-1.0/gf/VerbEng.gf b/resource-1.0/gf/VerbEng.gf index b192125f1..de951c08c 100644 --- a/resource-1.0/gf/VerbEng.gf +++ b/resource-1.0/gf/VerbEng.gf @@ -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) ; ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (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) ; AdvVP vp adv = insertObj (\\_ => adv.s) vp ;