From f7fa5a339389da06309a8219ef3942ebaefecbe3 Mon Sep 17 00:00:00 2001 From: bringert Date: Mon, 5 Nov 2007 18:01:06 +0000 Subject: [PATCH] Synopsis: include category explanation in each category section. --- lib/resource-1.0/doc/MkSynopsis.hs | 12 +++-- lib/resource-1.0/doc/synopsis.html | 87 ++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 4 deletions(-) diff --git a/lib/resource-1.0/doc/MkSynopsis.hs b/lib/resource-1.0/doc/MkSynopsis.hs index 84052a436..c1b0d80ce 100644 --- a/lib/resource-1.0/doc/MkSynopsis.hs +++ b/lib/resource-1.0/doc/MkSynopsis.hs @@ -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) diff --git a/lib/resource-1.0/doc/synopsis.html b/lib/resource-1.0/doc/synopsis.html index 7855582f3..115b9d8b5 100644 --- a/lib/resource-1.0/doc/synopsis.html +++ b/lib/resource-1.0/doc/synopsis.html @@ -423,6 +423,9 @@ Source: http://www.cs.chalmers.se/~aarne/

AP

+

+adjectival phrase +

@@ -498,6 +501,9 @@ Source: http://www.cs.chalmers.se/~aarne/

AdN

+

+numeral-modifying adverb, +

Function
@@ -513,6 +519,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Adv

+

+verb-phrase-modifying adverb, +

Function
@@ -573,6 +582,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Ant

+

+anteriority +

Function
@@ -593,6 +605,9 @@ Source: http://www.cs.chalmers.se/~aarne/

CN

+

+common noun (without determiner) +

Function
@@ -693,6 +708,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Cl

+

+declarative clause, with all tenses +

Function
@@ -828,6 +846,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Det

+

+determiner phrase +

Function
@@ -908,6 +929,9 @@ Source: http://www.cs.chalmers.se/~aarne/

IAdv

+

+interrogative adverb +

Function
@@ -923,6 +947,9 @@ Source: http://www.cs.chalmers.se/~aarne/

IP

+

+interrogative pronoun +

Function
@@ -948,6 +975,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Imp

+

+imperative +

Function
@@ -1078,6 +1108,9 @@ Source: http://www.cs.chalmers.se/~aarne/

NP

+

+noun phrase (subject or object) +

Function
@@ -1203,6 +1236,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Num

+

+cardinal number (used with QuantPl) +

Function
@@ -1303,6 +1339,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Ord

+

+ordinal number (used in Det) +

Function
@@ -1328,6 +1367,9 @@ Source: http://www.cs.chalmers.se/~aarne/

PConj

+

+phrase-beginning conj. +

Function
@@ -1343,6 +1385,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Phr

+

+phrase in a text +

Function
@@ -1383,6 +1428,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Pol

+

+polarity +

Function
@@ -1428,6 +1476,9 @@ Source: http://www.cs.chalmers.se/~aarne/

QCl

+

+question clause, with all tenses +

Function
@@ -1478,6 +1529,9 @@ Source: http://www.cs.chalmers.se/~aarne/

QS

+

+question +

Function
@@ -1503,6 +1557,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Quant

+

+quantifier with both sg and pl +

Function
@@ -1598,6 +1655,9 @@ Source: http://www.cs.chalmers.se/~aarne/

RCl

+

+relative clause, with all tenses +

Function
@@ -1628,6 +1688,9 @@ Source: http://www.cs.chalmers.se/~aarne/

RP

+

+relative pronoun +

Function
@@ -1648,6 +1711,9 @@ Source: http://www.cs.chalmers.se/~aarne/

RS

+

+relative +

Function
@@ -1668,6 +1734,9 @@ Source: http://www.cs.chalmers.se/~aarne/

S

+

+declarative sentence +

Function
@@ -1713,6 +1782,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Slash

+

+clause missing NP (S/NP in GPSG) +

Function
@@ -1743,6 +1815,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Tense

+

+tense +

Function
@@ -1773,6 +1848,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Text

+

+text consisting of several phrases +

Function
@@ -1823,6 +1901,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Utt

+

+sentence, question, word... +

Function
@@ -1888,6 +1969,9 @@ Source: http://www.cs.chalmers.se/~aarne/

VP

+

+verb phrase +

Function
@@ -2008,6 +2092,9 @@ Source: http://www.cs.chalmers.se/~aarne/

Voc

+

+vocative or "please" +

Function
Function