Synopsis: include category explanation in each category section.

This commit is contained in:
bringert
2007-11-05 18:01:06 +00:00
parent 1802021fe1
commit f7fa5a3393
2 changed files with 95 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ main = do
link "Source:" syntaxAPI
space
rs <- getRules syntaxAPI
delimit $ mkSplitTables True isLatex rs
delimit $ mkSplitTables True isLatex cs rs
space
title "Structural Words"
space
@@ -114,9 +114,13 @@ inChunks i f = concat . intersperse ["\n\n"] . map f . chunks i where
-- Makes one table per result category.
-- Adds a subsection header for each table.
mkSplitTables :: Bool -> Bool -> [(String,String,String)] -> [String]
mkSplitTables hasEx isLatex rs = concatMap t (sortRules rs)
where t xs = subtitle (resultCat (head xs)) : mkTable hasEx isLatex xs
mkSplitTables :: Bool -> Bool -> [(String,String,String)] -> [(String,String,String)] -> [String]
mkSplitTables hasEx isLatex cs rs = concatMap t (sortRules rs)
where t xs = [subtitle c] ++ expl ++ mkTable hasEx isLatex xs
where c = resultCat (head xs)
expl = case [e | (n,e,_) <- cs, n == c] of
[] -> []
e:_ -> ["", e, ""]
mkTable :: Bool -> Bool -> [(String,String,String)] -> [String]
mkTable hasEx isLatex = inChunks chsize (\rs -> header : map (unwords . row) rs)

View File

@@ -423,6 +423,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
</P>
<A NAME="AP"></A>
<H2>AP</H2>
<P>
adjectival phrase
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -498,6 +501,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="AdN"></A>
<H2>AdN</H2>
<P>
numeral-modifying adverb,
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -513,6 +519,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Adv"></A>
<H2>Adv</H2>
<P>
verb-phrase-modifying adverb,
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -573,6 +582,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Ant"></A>
<H2>Ant</H2>
<P>
anteriority
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -593,6 +605,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="CN"></A>
<H2>CN</H2>
<P>
common noun (without determiner)
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -693,6 +708,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Cl"></A>
<H2>Cl</H2>
<P>
declarative clause, with all tenses
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -828,6 +846,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Det"></A>
<H2>Det</H2>
<P>
determiner phrase
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -908,6 +929,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="IAdv"></A>
<H2>IAdv</H2>
<P>
interrogative adverb
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -923,6 +947,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="IP"></A>
<H2>IP</H2>
<P>
interrogative pronoun
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -948,6 +975,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Imp"></A>
<H2>Imp</H2>
<P>
imperative
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1078,6 +1108,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="NP"></A>
<H2>NP</H2>
<P>
noun phrase (subject or object)
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1203,6 +1236,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Num"></A>
<H2>Num</H2>
<P>
cardinal number (used with QuantPl)
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1303,6 +1339,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Ord"></A>
<H2>Ord</H2>
<P>
ordinal number (used in Det)
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1328,6 +1367,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="PConj"></A>
<H2>PConj</H2>
<P>
phrase-beginning conj.
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1343,6 +1385,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Phr"></A>
<H2>Phr</H2>
<P>
phrase in a text
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1383,6 +1428,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Pol"></A>
<H2>Pol</H2>
<P>
polarity
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1428,6 +1476,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="QCl"></A>
<H2>QCl</H2>
<P>
question clause, with all tenses
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1478,6 +1529,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="QS"></A>
<H2>QS</H2>
<P>
question
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1503,6 +1557,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Quant"></A>
<H2>Quant</H2>
<P>
quantifier with both sg and pl
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1598,6 +1655,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="RCl"></A>
<H2>RCl</H2>
<P>
relative clause, with all tenses
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1628,6 +1688,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="RP"></A>
<H2>RP</H2>
<P>
relative pronoun
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1648,6 +1711,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="RS"></A>
<H2>RS</H2>
<P>
relative
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1668,6 +1734,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="S"></A>
<H2>S</H2>
<P>
declarative sentence
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1713,6 +1782,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Slash"></A>
<H2>Slash</H2>
<P>
clause missing NP (S/NP in GPSG)
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1743,6 +1815,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Tense"></A>
<H2>Tense</H2>
<P>
tense
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1773,6 +1848,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Text"></A>
<H2>Text</H2>
<P>
text consisting of several phrases
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1823,6 +1901,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Utt"></A>
<H2>Utt</H2>
<P>
sentence, question, word...
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -1888,6 +1969,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="VP"></A>
<H2>VP</H2>
<P>
verb phrase
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>
@@ -2008,6 +2092,9 @@ Source: <A HREF="../api/Constructors.gf"><CODE>http://www.cs.chalmers.se/~aarne/
<A NAME="Voc"></A>
<H2>Voc</H2>
<P>
vocative or "please"
</P>
<TABLE CELLPADDING="4" BORDER="1">
<TR>
<TH>Function</TH>