1
0
forked from GitHub/gf-core

IComp questions in resource added

This commit is contained in:
aarne
2006-04-20 15:32:48 +00:00
parent fe0d2f4896
commit 34a8f1b12f
15 changed files with 142 additions and 64 deletions

View File

@@ -35,6 +35,7 @@ abstract Cat = Common ** {
QCl ; -- question clause, with all tenses e.g. "why does she walk"
IP ; -- interrogative pronoun e.g. "who"
IAdv ; -- interrogative adverb e.g. "why"
IComp ; -- interrogative complement of copula e.g. "where"
IDet ; -- interrogative determiner e.g. "which"
--2 Relative clauses and pronouns

View File

@@ -6,10 +6,11 @@ abstract Question = Cat ** {
-- with an interrogative.
fun
QuestCl : Cl -> QCl ; -- does John walk
QuestVP : IP -> VP -> QCl ; -- who walks
QuestSlash : IP -> Slash -> QCl ; -- who does John love
QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk
QuestCl : Cl -> QCl ; -- does John walk
QuestVP : IP -> VP -> QCl ; -- who walks
QuestSlash : IP -> Slash -> QCl ; -- who does John love
QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk
QuestIComp : IComp -> NP -> QCl ; -- where is John
-- Interrogative pronouns can be formed with interrogative
-- determiners.
@@ -19,6 +20,9 @@ abstract Question = Cat ** {
PrepIP : Prep -> IP -> IAdv ; -- with whom
CompIAdv : IAdv -> IComp ; -- where
-- More $IP$, $IDet$, and $IAdv$ are defined in
-- [Structural Structural.html].

View File

@@ -6,26 +6,29 @@
</HEAD><BODY BGCOLOR="white" TEXT="black">
<P ALIGN="center"><CENTER><H1> The category system</H1>
<FONT SIZE="4">
<I>Last update: Sat Feb 25 22:35:53 2006</I><BR>
% NOTE: this is a txt2tags file.
<I>Author: </I><BR>
Last update: Thu Apr 20 17:30:07 2006
</FONT></CENTER>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
<UL>
<LI><A HREF="#toc1">The category system</A>
<UL>
<LI><A HREF="#toc1">Top-level units</A>
<LI><A HREF="#toc2">Sentences and clauses</A>
<LI><A HREF="#toc3">Questions and interrogatives</A>
<LI><A HREF="#toc4">Relative clauses and pronouns</A>
<LI><A HREF="#toc5">Verb phrases</A>
<LI><A HREF="#toc6">Adjectival phrases</A>
<LI><A HREF="#toc7">Nouns and noun phrases</A>
<LI><A HREF="#toc8">Adverbs</A>
<LI><A HREF="#toc9">Numerals</A>
<LI><A HREF="#toc10">Structural words</A>
<LI><A HREF="#toc11">Words of open classes</A>
<LI><A HREF="#toc2">Top-level units</A>
<LI><A HREF="#toc3">Sentences and clauses</A>
<LI><A HREF="#toc4">Questions and interrogatives</A>
<LI><A HREF="#toc5">Relative clauses and pronouns</A>
<LI><A HREF="#toc6">Verb phrases</A>
<LI><A HREF="#toc7">Adjectival phrases</A>
<LI><A HREF="#toc8">Nouns and noun phrases</A>
<LI><A HREF="#toc9">Adverbs</A>
<LI><A HREF="#toc10">Numerals</A>
<LI><A HREF="#toc11">Structural words</A>
<LI><A HREF="#toc12">Words of open classes</A>
</UL>
</UL>
<P></P>
<HR NOSHADE SIZE=1>
@@ -35,6 +38,8 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
</P>
<A NAME="toc1"></A>
<H1>The category system</H1>
<P>
Some categories are inherited from <A HREF="Common.html">Common</A>.
</P>
@@ -44,7 +49,7 @@ Some categories are inherited from <A HREF="Common.html">Common</A>.
cat
</PRE>
<P></P>
<A NAME="toc1"></A>
<A NAME="toc2"></A>
<H2>Top-level units</H2>
<P>
Constructed in <A HREF="Text.html">Text</A>: <CODE>Text</CODE>.
@@ -55,7 +60,7 @@ Constructed in <A HREF="Phrase.html">Phrase</A>: <CODE>Phr</CODE> and
Voc ; -- vocative or "please" e.g. "my darling"
</PRE>
<P></P>
<A NAME="toc2"></A>
<A NAME="toc3"></A>
<H2>Sentences and clauses</H2>
<P>
Constructed in <A HREF="Sentence.html">Sentence</A>, and also in
@@ -71,7 +76,7 @@ Constructed in <A HREF="Sentence.html">Sentence</A>, and also in
SC ; -- embedded sentence or question e.g. "that it rains"
</PRE>
<P></P>
<A NAME="toc3"></A>
<A NAME="toc4"></A>
<H2>Questions and interrogatives</H2>
<P>
Constructed in <A HREF="Question.html">Question</A>.
@@ -80,10 +85,11 @@ Constructed in <A HREF="Question.html">Question</A>.
QCl ; -- question clause, with all tenses e.g. "why does she walk"
IP ; -- interrogative pronoun e.g. "who"
IAdv ; -- interrogative adverb e.g. "why"
IComp ; -- interrogative complement of copula e.g. "where"
IDet ; -- interrogative determiner e.g. "which"
</PRE>
<P></P>
<A NAME="toc4"></A>
<A NAME="toc5"></A>
<H2>Relative clauses and pronouns</H2>
<P>
Constructed in <A HREF="Relative.html">Relative</A>.
@@ -93,7 +99,7 @@ Constructed in <A HREF="Relative.html">Relative</A>.
RP ; -- relative pronoun e.g. "in which"
</PRE>
<P></P>
<A NAME="toc5"></A>
<A NAME="toc6"></A>
<H2>Verb phrases</H2>
<P>
Constructed in <A HREF="Verb.html">Verb</A>.
@@ -103,7 +109,7 @@ Constructed in <A HREF="Verb.html">Verb</A>.
Comp ; -- complement of copula, such as AP e.g. "very warm"
</PRE>
<P></P>
<A NAME="toc6"></A>
<A NAME="toc7"></A>
<H2>Adjectival phrases</H2>
<P>
Constructed in <A HREF="Adjective.html">Adjective</A>.
@@ -112,7 +118,7 @@ Constructed in <A HREF="Adjective.html">Adjective</A>.
AP ; -- adjectival phrase e.g. "very warm"
</PRE>
<P></P>
<A NAME="toc7"></A>
<A NAME="toc8"></A>
<H2>Nouns and noun phrases</H2>
<P>
Constructed in <A HREF="Noun.html">Noun</A>.
@@ -139,7 +145,7 @@ as defined in <A HREF="Noun.html">Noun</A>.
Ord ; -- ordinal number (used in Det) e.g. "seventh"
</PRE>
<P></P>
<A NAME="toc8"></A>
<A NAME="toc9"></A>
<H2>Adverbs</H2>
<P>
Constructed in <A HREF="Adverb.html">Adverb</A>.
@@ -152,7 +158,7 @@ Many adverbs are constructed in <A HREF="Structural.html">Structural</A>.
AdN ; -- numeral-modifying adverb, e.g. "more than"
</PRE>
<P></P>
<A NAME="toc9"></A>
<A NAME="toc10"></A>
<H2>Numerals</H2>
<P>
Constructed in <A HREF="Numeral.html">Numeral</A>.
@@ -161,7 +167,7 @@ Constructed in <A HREF="Numeral.html">Numeral</A>.
Numeral;-- cardinal or ordinal, e.g. "five/fifth"
</PRE>
<P></P>
<A NAME="toc10"></A>
<A NAME="toc11"></A>
<H2>Structural words</H2>
<P>
Constructed in <A HREF="Structural.html">Structural</A>.
@@ -175,7 +181,7 @@ Constructed in <A HREF="Structural.html">Structural</A>.
Prep ; -- preposition, or just case e.g. "in"
</PRE>
<P></P>
<A NAME="toc11"></A>
<A NAME="toc12"></A>
<H2>Words of open classes</H2>
<P>
These are constructed in <A HREF="Lexicon.html">Lexicon</A> and in additional lexicon modules.

View File

@@ -6,13 +6,17 @@
</HEAD><BODY BGCOLOR="white" TEXT="black">
<P ALIGN="center"><CENTER><H1> Questions and interrogative pronouns</H1>
<FONT SIZE="4">
<I>Last update: Sat Feb 25 22:35:56 2006</I><BR>
% NOTE: this is a txt2tags file.
<I>Author: </I><BR>
Last update: Thu Apr 20 17:30:13 2006
</FONT></CENTER>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
<UL>
<LI><A HREF="#toc1">Questions and interrogative pronouns</A>
</UL>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
@@ -21,6 +25,8 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
</P>
<A NAME="toc1"></A>
<H1>Questions and interrogative pronouns</H1>
<PRE>
abstract Question = Cat ** {
</PRE>
@@ -31,10 +37,11 @@ with an interrogative.
</P>
<PRE>
fun
QuestCl : Cl -&gt; QCl ; -- does John walk
QuestVP : IP -&gt; VP -&gt; QCl ; -- who walks
QuestSlash : IP -&gt; Slash -&gt; QCl ; -- who does John love
QuestIAdv : IAdv -&gt; Cl -&gt; QCl ; -- why does John walk
QuestCl : Cl -&gt; QCl ; -- does John walk
QuestVP : IP -&gt; VP -&gt; QCl ; -- who walks
QuestSlash : IP -&gt; Slash -&gt; QCl ; -- who does John love
QuestIAdv : IAdv -&gt; Cl -&gt; QCl ; -- why does John walk
QuestIComp : IComp -&gt; NP -&gt; QCl ; -- where is John
</PRE>
<P></P>
<P>
@@ -46,6 +53,8 @@ determiners.
AdvIP : IP -&gt; Adv -&gt; IP ; -- who in Europe
PrepIP : Prep -&gt; IP -&gt; IAdv ; -- with whom
CompIAdv : IAdv -&gt; IComp ; -- where
</PRE>
<P></P>
<P>

View File

@@ -24,7 +24,7 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
IP = {s : Case => Str ; n : Number} ;
IAdv = {s : Str} ;
IAdv, IComp = {s : Str} ;
IDet = {s : Str ; n : Number} ;
-- Relative

View File

@@ -1,4 +1,4 @@
concrete QuestionEng of Question = CatEng ** open ResEng in {
concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
flags optimize=all_subs ;
@@ -17,27 +17,15 @@ concrete QuestionEng of Question = CatEng ** open ResEng in {
let cl = mkClause (qp.s ! Nom) {n = qp.n ; p = P3} vp
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
QuestSlash ip slash = {
s = \\t,a,p =>
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
}
} ;
QuestSlash ip slash =
mkQuestion (ss (slash.c2 ++ ip.s ! Acc)) slash ;
--- stranding in ExtEng
QuestIAdv iadv cl = mkQuestion iadv cl ;
QuestIComp icomp np =
mkQuestion icomp (mkClause (np.s ! Nom) np.a (predAux auxBe)) ;
QuestIAdv iadv cl = {
s = \\t,a,p =>
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} ;
@@ -51,4 +39,21 @@ concrete QuestionEng of Question = CatEng ** open ResEng in {
n = idet.n
} ;
CompIAdv a = a ;
oper
mkQuestion :
{s : Str} -> Clause ->
{s : Tense => Anteriority => Polarity => QForm => Str} = \wh,cl ->
{
s = \\t,a,p =>
let
cls = cl.s ! t ! a ! p ;
why = wh.s
in table {
QDir => why ++ cls ! OQuest ;
QIndir => why ++ cls ! ODir
}
} ;
}

View File

@@ -25,6 +25,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
QCl = {s : Tense => Anteriority => Polarity => Str} ;
IP = {s : NPForm => Str ; n : Number} ;
IAdv = {s : Str} ;
IComp = {s : Agr => Str} ;
IDet = {s : Case => Str ; n : Number} ;
-- Relative

View File

@@ -28,6 +28,15 @@ concrete QuestionFin of Question = CatFin ** open ResFin, Prelude in {
s = \\t,a,p => iadv.s ++ cl.s ! t ! a ! p ! SDecl
} ;
QuestIComp icomp np = {
s = \\t,a,p =>
let
vp = predV (verbOlla ** {sc = NPCase Nom}) ;
cl = mkClause (subjForm np vp.sc) np.a vp ;
in
icomp.s ! np.a ++ cl.s ! t ! a ! p ! SDecl
} ;
PrepIP p ip = {s =
appCompl True Pos p (ip ** {a = agrP3 ip.n ; isPron = False})} ;
@@ -54,4 +63,6 @@ concrete QuestionFin of Question = CatFin ** open ResFin, Prelude in {
n = n
} ;
CompIAdv a = {s = \\_ => a.s} ;
}

View File

@@ -25,7 +25,8 @@ concrete CatGer of Cat = CommonX ** open ResGer, Prelude in {
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
IP = {s : Case => Str ; n : Number} ;
IAdv = {s : Str} ;
IAdv = {s : Str} ;
IComp = {s : Agr => Str} ;
IDet = {s : Gender => Case => Str ; n : Number} ;
-- Relative

View File

@@ -46,6 +46,18 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
}
} ;
QuestIComp icomp np = {
s = \\t,a,p =>
let
vp = predV sein_V ;
cls = (mkClause (np.s ! Nom) np.a vp).s ! t ! a ! p ;
why = icomp.s ! np.a
in table {
QDir => why ++ cls ! Inv ;
QIndir => why ++ cls ! Sub
}
} ;
PrepIP p ip = {
s = appPrep p ip.s
} ;
@@ -65,6 +77,7 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
cn.s ! Weak ! n ! c ;
n = n
} ;
CompIAdv a = {s = \\_ => a.s} ;
}

View File

@@ -112,7 +112,7 @@ concrete StructuralGer of Structural = CatGer **
when_IAdv = ss "wann" ;
when_Subj = ss "wenn" ;
where_IAdv = ss "war" ;
where_IAdv = ss "wo" ;
whichPl_IDet = detLikeAdj Pl "welch" ;
whichSg_IDet = detLikeAdj Sg "welch" ;

View File

@@ -23,10 +23,11 @@ incomplete concrete CatRomance of Cat =
-- Question
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
IP = {s : Case => Str ; a : AAgr} ;
IAdv = {s : Str} ;
IDet = {s : Gender => Case => Str ; n : Number} ;
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
IP = {s : Case => Str ; a : AAgr} ;
IAdv = {s : Str} ;
IComp = {s : AAgr => Str} ;
IDet = {s : Gender => Case => Str ; n : Number} ;
-- Relative

View File

@@ -41,6 +41,15 @@ incomplete concrete QuestionRomance of Question =
in why ++ cls
} ;
QuestIComp icomp np = {
s = \\t,a,p,_ =>
let
vp = predV copula ;
cls = (mkClause (np.s ! Aton Nom) np.a vp).s ! t ! a ! p ! Indic ;
why = icomp.s ! {g = np.a.g ; n = np.a.n}
in why ++ cls
} ;
PrepIP p ip = {
s = p.s ++ ip.s ! accusative
} ;
@@ -60,4 +69,6 @@ incomplete concrete QuestionRomance of Question =
a = a
} ;
CompIAdv a = {s = \\_ => a.s} ;
}

View File

@@ -25,7 +25,8 @@ incomplete concrete CatScand of Cat =
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
IP = {s : NPForm => Str ; gn : GenNum} ;
IAdv = {s : Str} ;
IAdv = {s : Str} ;
IComp = {s : AFormPos => Str} ;
IDet = {s : Gender => Str ; n : Number ; det : DetSpecies} ;
-- Relative

View File

@@ -48,6 +48,18 @@ incomplete concrete QuestionScand of Question =
}
} ;
QuestIComp icomp np = {
s = \\t,a,p =>
let
cls =
(mkClause (np.s ! nominative) np.a (predV verbBe)).s ! t ! a ! p ;
why = icomp.s ! agrAdj np.a.gn DIndef
in table {
QDir => why ++ cls ! Inv ;
QIndir => why ++ cls ! Sub
}
} ;
PrepIP p ip = {
s = p.s ++ ip.s ! accusative
} ;
@@ -59,8 +71,10 @@ incomplete concrete QuestionScand of Question =
IDetCN idet num ord cn = let g = cn.g in {
s = \\c =>
idet.s ! g ++ num.s ! g ++ ord.s ++ cn.s ! idet.n ! idet.det ! caseNP c ;
idet.s ! g ++ num.s ! g ++ ord.s ++ cn.s !idet.n ! idet.det ! caseNP c ;
gn = gennum g idet.n
} ;
CompIAdv a = {s = \\_ => a.s} ;
}