From f643cd271b28bf0b159eecb844d91612efb085ac Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 26 Nov 2007 21:27:29 +0000 Subject: [PATCH] structural words merged with other constructors; links to paradigms from lexical cats, in synopsis --- lib/resource-1.0/doc/MkSynopsis.hs | 42 +- lib/resource-1.0/doc/synopsis.html | 1105 +++++++++++++++++----------- 2 files changed, 717 insertions(+), 430 deletions(-) diff --git a/lib/resource-1.0/doc/MkSynopsis.hs b/lib/resource-1.0/doc/MkSynopsis.hs index 841148324..a025feb24 100644 --- a/lib/resource-1.0/doc/MkSynopsis.hs +++ b/lib/resource-1.0/doc/MkSynopsis.hs @@ -16,7 +16,9 @@ main = do writeFile synopsis "GF Resource Grammar Library: Synopsis" append "Aarne Ranta" space - append "%!postproc(html): '(SRC=\"categories.png\")' '\\1 USEMAP=\"#categories\"'" + append "%!postproc(html): '(SRC=\"categories.png\")' '\\1 USEMAP=\"#categories\"'" + append "%!postproc(html): '#LParadigms' ''" + append "%!postproc(tex): '#LParadigms' ''" delimit $ addToolTips cs include "synopsis-intro.txt" title "Categories" @@ -30,20 +32,24 @@ main = do append "==Explanations==\n" delimit $ mkCatTable isLatex cs space - title "Syntax Rules" + title "Syntax Rules and Structural Words" space - link "Source:" syntaxAPI + link "Source 1:" syntaxAPI + space + link "Source 2:" structuralAPI space rs <- getRules syntaxAPI - delimit $ mkSplitTables True isLatex cs rs + rs2 <- getRules structuralAPI + delimit $ mkSplitTables True isLatex cs $ rs ++ rs2 space - title "Structural Words" - space - link "Source:" structuralAPI - space - rs <- rulesTable False isLatex cs structuralAPI - delimit rs +-- title "Structural Words" +-- space +-- link "Source:" structuralAPI +-- space +-- rs <- rulesTable False isLatex cs structuralAPI +-- delimit rs space + title "Lexical Paradigms" mapM_ (putParadigms isLatex cs) paradigmFiles space include "synopsis-browse.txt" @@ -108,7 +114,8 @@ getRules file = do putParadigms :: Bool -> Cats -> (String, FilePath) -> IO () putParadigms isLatex cs (lang,file) = do - title ("Paradigms for " ++ lang) + stitle ("Paradigms for " ++ lang) + append "#LParadigms" space link "source" file space @@ -126,10 +133,16 @@ inChunks i f = concat . intersperse ["\n\n"] . map f . chunks i where -- Adds a subsection header for each table. mkSplitTables :: Bool -> Bool -> Cats -> Rules -> [String] mkSplitTables hasEx isLatex cs = concatMap t . addLexicalCats cs . sortRules - where t (c, xs) = [subtitle c expl] ++ mkTable hasEx isLatex cs xs - where expl = case [e | (n,e,_) <- cs, n == c] of + where t (c, xs) = [subtitle c expl] ++ tableOrLink + where + expl = case [e | (n,e,_) <- cs, n == c] of [] -> "" e:_ -> e + tableOrLink = if null xs then parad else mkTable hasEx isLatex cs xs + parad = [ + "Lexical category, constructors given in", + "[lexical paradigms #RParadigms]." + ] mkTable :: Bool -> Bool -> Cats -> Rules -> [String] mkTable hasEx isLatex cs = inChunks chsize (\rs -> header : map (unwords . row) rs) @@ -173,6 +186,7 @@ paradigmFiles = [ append s = appendFile synopsis ('\n':s) title s = append $ "=" ++ s ++ "=" +stitle s = append $ "==" ++ s ++ "==" include s = append $ "%!include: " ++ s space = append "\n" delimit ss = mapM_ append ss @@ -221,4 +235,4 @@ showTyp cs = unwords . map f . words where c = init (tail s) isCat cat = cat `notElem` ["Str","Int"] && all (\c -> isAlphaNum c || c == '\'') cat - && isUpper (head cat) \ No newline at end of file + && isUpper (head cat) diff --git a/lib/resource-1.0/doc/synopsis.html b/lib/resource-1.0/doc/synopsis.html index 224af212d..3d17d61a2 100644 --- a/lib/resource-1.0/doc/synopsis.html +++ b/lib/resource-1.0/doc/synopsis.html @@ -18,7 +18,7 @@
  • A hierarchic view
  • Explanations -
  • Syntax Rules +
  • Syntax Rules and Structural Words -
  • Structural Words -
  • Paradigms for Danish -
  • Paradigms for English -
  • Paradigms for Finnish -
  • Paradigms for French -
  • Paradigms for German -
  • Paradigms for Italian -
  • Paradigms for Norwegian -
  • Paradigms for Russian -
  • Paradigms for Spanish -
  • Paradigms for Swedish +
  • Lexical Paradigms +
  • Browsing the libraries with GF commands
  • An Example of Usage @@ -494,14 +496,25 @@ also in the Paradigms modules. -

    Syntax Rules

    +

    Syntax Rules and Structural Words

    -Source: http://www.cs.chalmers.se/~aarne/GF/lib/resource/api/Constructors.gf +Source 1: http://www.cs.chalmers.se/~aarne/GF/lib/resource/api/Constructors.gf +

    +

    +Source 2: http://www.cs.chalmers.se/~aarne/GF/lib/resource/abstract/Structural.gf

    A - one-place adjective

    +

    +Lexical category, constructors given in +lexical paradigms. +

    A2 - two-place adjective

    +

    +Lexical category, constructors given in +lexical paradigms. +

    AP - adjectival phrase

    @@ -579,6 +592,39 @@ Source: http://www.cs.chalmers.se/~aarne/

    AdA - adjective-modifying adverb

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    almost_AdAAdA-
    quite_AdvAdA-
    so_AdAAdA-
    too_AdAAdA-
    very_AdAAdA-
    +

    AdN - numeral-modifying adverb

    @@ -588,6 +634,11 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + @@ -596,6 +647,19 @@ Source: http://www.cs.chalmers.se/~aarne/

    AdV - adverb directly attached to verb

    +
    Example
    almost_AdNAdN-
    mkAdN CAdv -> AdN more than
    + + + + + + + + + + +
    FunctionTypeExample
    always_AdVAdV-
    +

    Adv - verb-phrase-modifying adverb

    @@ -605,6 +669,26 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + + + + + + + + + + + + + + + + @@ -654,6 +738,26 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + + + + + + + + + + + + + + + +
    Example
    everywhere_AdvAdv-
    here7from_AdvAdv-
    here7to_AdvAdv-
    here_AdvAdv-
    mkAdv A -> Adv warmlyDConj -> ListAdv -> Adv either here, now, or with John
    somewhere_AdvAdv-
    there7from_AdvAdv-
    there7to_AdvAdv-
    there_AdvAdv-
    @@ -678,6 +782,24 @@ Source: http://www.cs.chalmers.se/~aarne/

    CAdv - comparative adverb

    + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    less_CAdvCAdv-
    more_CAdvCAdv-
    +

    CN - common noun (without determiner)

    @@ -915,10 +1037,50 @@ Source: http://www.cs.chalmers.se/~aarne/

    Comp - complement of copula, such as AP

    +

    +Lexical category, constructors given in +lexical paradigms. +

    Conj - conjunction

    +
    + + + + + + + + + + + + + + + +
    FunctionTypeExample
    and_ConjConj-
    or_ConjConj-
    +

    DConj - distributed conjunction

    + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    both7and_DConjDConj-
    either7or_DConjDConj-
    +

    Det - determiner phrase

    @@ -938,6 +1100,16 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + + + + + + @@ -948,6 +1120,11 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + @@ -997,6 +1174,21 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + + + + + + + + + + +
    the (house)
    every_DetDet-
    few_DetDet-
    indefPlDet Det (houses)a (house)
    many_DetDet-
    mkDet QuantSg -> Det thisPron -> Det my
    much_DetDet-
    somePl_DetDet-
    someSg_DetDet-
    @@ -1008,16 +1200,63 @@ Source: http://www.cs.chalmers.se/~aarne/ Example +how_IAdv +IAdv +- + + mkIAdv Prep -> IP -> IAdv in which city + +when_IAdv +IAdv +- + + +where_IAdv +IAdv +- + + +why_IAdv +IAdv +- +

    IComp - interrogative complement of copula

    +

    +Lexical category, constructors given in +lexical paradigms. +

    IDet - interrogative determiner

    + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    how8many_IDetIDet-
    whichPl_IDetIDet-
    whichSg_IDetIDet-
    +

    IP - interrogative pronoun

    @@ -1041,6 +1280,26 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + + + + + + + + + + + + + + + +
    IP -> Adv -> IP who in Paris
    whatPl_IPIP-
    whatSg_IPIP-
    whoPl_IPIP-
    whoSg_IPIP-
    @@ -1175,10 +1434,22 @@ Source: http://www.cs.chalmers.se/~aarne/

    N - common noun

    +

    +Lexical category, constructors given in +lexical paradigms. +

    N2 - relational noun

    +

    +Lexical category, constructors given in +lexical paradigms. +

    N3 - three-place relational noun

    +

    +Lexical category, constructors given in +lexical paradigms. +

    NP - noun phrase (subject or object)

    @@ -1188,6 +1459,16 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + + + + + + @@ -1302,6 +1583,36 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Example
    everybody_NPNP-
    everything_NPNP-
    mkNP Det -> N -> NP the first manDConj -> ListNP -> NP either John, I, or that
    somebody_NPNP-
    something_NPNP-
    that_NPNP-
    these_NPNP-
    this_NPNP-
    those_NPNP-
    @@ -1413,6 +1724,11 @@ Source: http://www.cs.chalmers.se/~aarne/ Example +first_Ord +Ord +- + + mkOrd Numeral -> Ord twentieth @@ -1438,14 +1754,33 @@ Source: http://www.cs.chalmers.se/~aarne/ Example +but_PConj +PConj +- + + mkPConj Conj -> PConj and + +otherwise_PConj +PConj +- + + +therefore_PConj +PConj +- +

    PN - proper name

    +

    +Lexical category, constructors given in +lexical paradigms. +

    Phr - phrase in a text

    @@ -1484,6 +1819,16 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + + + + + +
    Imp -> Phr walk
    no_PhrPhr-
    yes_PhrPhr-
    @@ -1508,10 +1853,194 @@ Source: http://www.cs.chalmers.se/~aarne/

    Predet - predeterminer (prefixed Quant)

    + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    all_PredetPredet-
    most_PredetPredet-
    only_PredetPredet-
    +

    Prep - preposition, or just case

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    above_PrepPrep-
    after_PrepPrep-
    before_PrepPrep-
    behind_PrepPrep-
    between_PrepPrep-
    by8agent_PrepPrep-
    by8means_PrepPrep-
    during_PrepPrep-
    for_PrepPrep-
    from_PrepPrep-
    in8front_PrepPrep-
    in_PrepPrep-
    on_PrepPrep-
    part_PrepPrep-
    possess_PrepPrep-
    through_PrepPrep-
    to_PrepPrep-
    under_PrepPrep-
    with_PrepPrep-
    without_PrepPrep-
    +

    Pron - personal pronoun

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    he_PronPron-
    i_PronPron-
    it_PronPron-
    she_PronPron-
    they_PronPron-
    we_PronPron-
    youPl_PronPron-
    youPol_PronPron-
    youSg_PronPron-
    +

    Punct

    @@ -1630,6 +2159,16 @@ Source: http://www.cs.chalmers.se/~aarne/ + + + + + + + + + +
    Quant a
    that_QuantQuant-
    this_QuantQuant-
    @@ -1691,6 +2230,11 @@ Source: http://www.cs.chalmers.se/~aarne/ this +one_Quant +QuantSg +- + + that_QuantSg QuantSg that @@ -1824,6 +2368,10 @@ Source: http://www.cs.chalmers.se/~aarne/

    SC - embedded sentence or question

    +

    +Lexical category, constructors given in +lexical paradigms. +

    Slash - clause missing NP (S/NP in GPSG)

    @@ -1856,6 +2404,34 @@ Source: http://www.cs.chalmers.se/~aarne/

    Subj - subjunction

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    although_SubjSubj-
    because_SubjSubj-
    if_SubjSubj-
    when_SubjSubj-
    +

    Tense - tense

    @@ -2003,14 +2579,34 @@ Source: http://www.cs.chalmers.se/~aarne/

    V - one-place verb

    +

    +Lexical category, constructors given in +lexical paradigms. +

    V2 - two-place verb

    +

    +Lexical category, constructors given in +lexical paradigms. +

    V2A - verb with NP and AP complement

    +

    +Lexical category, constructors given in +lexical paradigms. +

    V3 - three-place verb

    +

    +Lexical category, constructors given in +lexical paradigms. +

    VA - adjective-complement verb

    +

    +Lexical category, constructors given in +lexical paradigms. +

    VP - verb phrase

    @@ -2133,10 +2729,46 @@ Source: http://www.cs.chalmers.se/~aarne/

    VQ - question-complement verb

    +

    +Lexical category, constructors given in +lexical paradigms. +

    VS - sentence-complement verb

    +

    +Lexical category, constructors given in +lexical paradigms. +

    VV - verb-phrase-complement verb

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    can8know_VVVV-
    can_VVVV-
    must_VVVV-
    want_VVVV-
    +

    Voc - vocative or "please"

    @@ -2150,406 +2782,20 @@ Source: http://www.cs.chalmers.se/~aarne/ -
    NP -> Voc John
    - - -

    Structural Words

    -

    -Source: http://www.cs.chalmers.se/~aarne/GF/lib/resource/abstract/Structural.gf -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    FunctionType
    above_PrepPrep
    after_PrepPrep
    all_PredetPredet
    almost_AdAAdA
    almost_AdNAdN
    although_SubjSubj
    always_AdVAdV
    and_ConjConj
    because_SubjSubj
    before_PrepPrep
    behind_PrepPrep
    between_PrepPrep
    both7and_DConjDConj
    but_PConjPConj
    by8agent_PrepPrep
    by8means_PrepPrep
    can8know_VVVV
    can_VVVV
    during_PrepPrep
    either7or_DConjDConj
    every_DetDet
    everybody_NPNP
    everything_NPNP
    everywhere_AdvAdv
    first_OrdOrd
    few_DetDet
    for_PrepPrep
    from_PrepPrep
    he_PronPron
    here_AdvAdv
    here7to_AdvAdv
    here7from_AdvAdv
    how_IAdvIAdv
    how8many_IDetIDet
    i_PronPron
    if_SubjSubj
    in8front_PrepPrep
    in_PrepPrep
    it_PronPron
    less_CAdvCAdv
    many_DetDet
    more_CAdvCAdv
    most_PredetPredet
    much_DetDet
    must_VVVV
    no_PhrPhr
    on_PrepPrep
    one_QuantQuantSg
    only_PredetPredet
    or_ConjConj
    otherwise_PConjPConj
    part_PrepPrep
    please_Voc Voc
    possess_PrepPrep
    quite_AdvAdA
    she_PronPron
    so_AdAAdA
    someSg_DetDet
    somePl_DetDet
    somebody_NPNP
    something_NPNP
    somewhere_AdvAdv
    that_QuantQuant
    that_NPNP
    there_AdvAdv
    there7to_AdvAdv
    there7from_AdvAdv
    therefore_PConjPConj
    these_NPNP
    they_PronPron
    this_QuantQuant
    this_NPNP
    those_NPNP
    through_PrepPrep
    to_PrepPrep
    too_AdAAdA
    under_PrepPrep
    very_AdAAdA
    want_VVVV
    we_PronPron
    whatPl_IPIP
    whatSg_IPIP
    when_IAdvIAdv
    when_SubjSubj
    where_IAdvIAdv
    whichPl_IDetIDet
    whichSg_IDetIDet
    whoPl_IPIP
    whoSg_IPIP
    why_IAdvIAdv
    with_PrepPrep
    without_PrepPrep
    yes_PhrPhr
    youSg_PronPron
    youPl_PronPron
    youPol_PronPron-
    + +

    Lexical Paradigms

    -

    Paradigms for Danish

    +

    Paradigms for Danish

    +

    + +

    source http://www.cs.chalmers.se/~aarne/GF/lib/resource/danish/ParadigmsDan.gf

    @@ -2793,7 +3039,10 @@ source http://www.cs.chalmers.se/~aarn -

    Paradigms for English

    +

    Paradigms for English

    +

    + +

    source http://www.cs.chalmers.se/~aarne/GF/lib/resource/english/ParadigmsEng.gf

    @@ -3021,7 +3270,10 @@ source http://www.cs.chalmers.se/~aar -

    Paradigms for Finnish

    +

    Paradigms for Finnish

    +

    + +

    source http://www.cs.chalmers.se/~aarne/GF/lib/resource/finnish/ParadigmsFin.gf

    @@ -3357,7 +3609,10 @@ source http://www.cs.chalmers.se/~aar -

    Paradigms for French

    +

    Paradigms for French

    +

    + +

    source http://www.cs.chalmers.se/~aarne/GF/lib/resource/french/ParadigmsFre.gf

    @@ -3585,7 +3840,10 @@ source http://www.cs.chalmers.se/~aarn -

    Paradigms for German

    +

    Paradigms for German

    +

    + +

    source http://www.cs.chalmers.se/~aarne/GF/lib/resource/german/ParadigmsGer.gf

    @@ -3837,7 +4095,10 @@ source http://www.cs.chalmers.se/~aarn -

    Paradigms for Italian

    +

    Paradigms for Italian

    +

    + +

    source http://www.cs.chalmers.se/~aarne/GF/lib/resource/italian/ParadigmsIta.gf

    @@ -4069,7 +4330,10 @@ source http://www.cs.chalmers.se/~aar -

    Paradigms for Norwegian

    +

    Paradigms for Norwegian

    +

    + +

    source http://www.cs.chalmers.se/~aarne/GF/lib/resource/norwegian/ParadigmsNor.gf

    @@ -4313,7 +4577,10 @@ source http://www.cs.chalmers.se/~a -

    Paradigms for Russian

    +

    Paradigms for Russian

    +

    + +

    source http://www.cs.chalmers.se/~aarne/GF/lib/resource/russian/ParadigmsRus.gf

    @@ -4553,7 +4820,10 @@ source http://www.cs.chalmers.se/~aar -

    Paradigms for Spanish

    +

    Paradigms for Spanish

    +

    + +

    source http://www.cs.chalmers.se/~aarne/GF/lib/resource/spanish/ParadigmsSpa.gf

    @@ -4785,7 +5055,10 @@ source http://www.cs.chalmers.se/~aar -

    Paradigms for Swedish

    +

    Paradigms for Swedish

    +

    + +

    source http://www.cs.chalmers.se/~aarne/GF/lib/resource/swedish/ParadigmsSwe.gf