From e1c7cddc6caaf69f8ca23dfaa652803a57c7869c Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 6 Dec 2010 22:43:55 +0000 Subject: [PATCH] completed Constructors API with missing cats, annotated constructors --- lib/doc/MkSynopsis.hs | 12 +- lib/doc/synopsis.html | 1133 +++++++++++++++++++++-------------- lib/doc/synopsis.txt | 345 ++++++----- lib/src/Make.hs | 12 +- lib/src/api/Constructors.gf | 521 +++++++++------- 5 files changed, 1221 insertions(+), 802 deletions(-) diff --git a/lib/doc/MkSynopsis.hs b/lib/doc/MkSynopsis.hs index 3e0cdb10b..580e6f387 100644 --- a/lib/doc/MkSynopsis.hs +++ b/lib/doc/MkSynopsis.hs @@ -6,6 +6,9 @@ import qualified Data.ByteString.Char8 as BS type Cats = [(String,String,String)] type Rules = [(String,String,String)] +-- the file generated +synopsis = "synopsis.txt" + main = do xx <- getArgs let isLatex = case xx of @@ -92,7 +95,7 @@ rulesTable hasEx isLatex cs file = do getRules :: FilePath -> IO Rules getRules file = do - ss <- readFileC file >>= return . lines + ss <- readFileC file >>= return . filter (not . hiddenLine) . lines return $ getrs [] ss where getrs rs ss = case ss of @@ -105,7 +108,7 @@ getRules file = do _ -> getrs rs ss2 rule s = (name, typ, ex) where - ws = takeWhile (/="--#") $ words s + ws = takeWhile (flip notElem ["--#", "--:"]) $ words s name = head ws (t,e) = span (/="--") (tail ws) typ = unwords $ filtype (drop 1 t) @@ -171,7 +174,6 @@ mkCatTable isLatex cs = inChunks chsize (\rs -> header ++ map mk1 rs) cs srcPath = ("../src" ++) -synopsis = "synopsis.txt" commonAPI = srcPath "/abstract/Common.gf" catAPI = srcPath "/abstract/Cat.gf" syntaxAPI = srcPath "/api/Constructors.gf" @@ -208,6 +210,10 @@ link s f = append $ s ++ " [``" ++ fa ++ "`` " ++ f ++ "]" where ttf s = "``" ++ s ++ "``" itf s = "//" ++ s ++ "//" +hiddenLine s = case reverse (words s) of + "--%":_ -> True + _ -> False + ----------------- -- sort category synopsis by category, retain one table diff --git a/lib/doc/synopsis.html b/lib/doc/synopsis.html index 268681720..c1cbbecab 100644 --- a/lib/doc/synopsis.html +++ b/lib/doc/synopsis.html @@ -75,10 +75,14 @@
  • RS - relative
  • S - declarative sentence
  • SC - embedded sentence or question +
  • SSlash +
  • Sub100 +
  • Sub1000
  • Subj - subjunction
  • Temp - temporal and aspectual features
  • Tense - tense
  • Text - text consisting of several phrases +
  • Unit
  • Utt - sentence, question, word...
  • V - one-place verb
  • V2 - two-place verb @@ -95,27 +99,27 @@
  • VV - verb-phrase-complement verb
  • Voc - vocative or "please" -
  • Lexical Paradigms +
  • Lexical Paradigms -
  • Browsing the libraries with GF commands -
  • An Example of Usage +
  • Browsing the libraries with GF commands +
  • An Example of Usage

    @@ -162,7 +166,7 @@ of C that takes D as an argument. What the constructors exactly ar and what other arguments they take, is described by separate tables for each category.

    - +
    @@ -227,7 +231,7 @@ also in the Paradigms modules.

    Explanations

    -
    +
    @@ -572,7 +576,7 @@ Lexical category, constructors given in

    AP - adjectival phrase

    -
    Category Explanation
    +
    @@ -586,12 +590,12 @@ Lexical category, constructors given in - + - + @@ -620,6 +624,11 @@ Lexical category, constructors given in + + + + + @@ -657,7 +666,7 @@ Lexical category, constructors given in

    AdA - adjective-modifying adverb

    -
    Function Type
    mkAP A -> APoldwarm
    mkAP A -> NP -> APolder than Johnwarmer than Paris
    mkAP
    mkAPAP -> SC -> APready to go
    mkAP AdA -> A -> AP very old
    +
    @@ -692,7 +701,7 @@ Lexical category, constructors given in

    AdN - numeral-modifying adverb

    -
    Function Type
    +
    @@ -722,7 +731,7 @@ Lexical category, constructors given in

    AdV - adverb directly attached to verb

    -
    Function Type
    +
    @@ -737,7 +746,7 @@ Lexical category, constructors given in

    Adv - verb-phrase-modifying adverb

    -
    Function Type
    +
    @@ -771,7 +780,7 @@ Lexical category, constructors given in - + @@ -786,7 +795,7 @@ Lexical category, constructors given in - + @@ -827,7 +836,7 @@ Lexical category, constructors given in

    Ant - anteriority

    -
    Function Type
    mkAdv Prep -> NP -> Advwith Johnin the house
    mkAdv
    mkAdv CAdv -> A -> S -> Advmore warmly than John walksmore warmly than he runs
    mkAdv
    +
    @@ -836,18 +845,18 @@ Lexical category, constructors given in - + - +
    Function Type
    anteriorAnt Ant(John has walked)John has walked
    simultaneousAnt Ant(John walks) [default]John walks [default]

    CAdv - comparative adverb

    - +
    @@ -872,7 +881,7 @@ Lexical category, constructors given in

    CN - common noun (without determiner)

    -
    Function Type
    +
    @@ -896,12 +905,12 @@ Lexical category, constructors given in - + - + @@ -926,7 +935,7 @@ Lexical category, constructors given in - + @@ -936,12 +945,12 @@ Lexical category, constructors given in - + - + @@ -960,6 +969,11 @@ Lexical category, constructors given in + + + + + @@ -972,7 +986,7 @@ Lexical category, constructors given in

    Card - cardinal number

    -
    Function Type
    mkCN N2 -> CNsonmother
    mkCN N3 -> CNflightdistance
    mkCN
    mkCN N -> RS -> CNhouse that John loveshouse that John owns
    mkCN
    mkCN N -> Adv -> CNhouse in the cityhouse on the hill
    mkCN CN -> Adv -> CNbig house in the citybig house on the hill
    mkCN
    mkCNCN -> SC -> CNreason to walk
    mkCN N -> NP -> CN king John
    +
    @@ -981,12 +995,12 @@ Lexical category, constructors given in - + - + @@ -996,13 +1010,13 @@ Lexical category, constructors given in - +
    Function Type
    mkCard Str -> Cardthirty-five (given by "35")thirty-five (given as "35")
    mkCard Numeral -> Cardthirty-five (given in any way)twenty
    mkCard
    mkCard AdN -> Card -> CardmkCardalmost fifty

    Cl - declarative clause, with all tenses

    - +
    @@ -1036,12 +1050,12 @@ Lexical category, constructors given in - + - + @@ -1056,17 +1070,17 @@ Lexical category, constructors given in - + - + - + @@ -1090,6 +1104,11 @@ Lexical category, constructors given in + + + + + @@ -1100,18 +1119,38 @@ Lexical category, constructors given in - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1125,34 +1164,14 @@ Lexical category, constructors given in - - - - - - - - - - - - - - - - - - - - - - + +
    Function Type
    mkCl NP -> VS -> S -> ClJohn says that it is goodJohn says that she walks
    mkCl NP -> VQ -> QS -> ClJohn wonders if it is goodJohn wonders who walks
    mkCl
    mkCl NP -> V2S -> NP -> S -> ClJohn tells her that we are hereJohn tells her that we walk
    mkCl NP -> V2Q -> NP -> QS -> ClJohn asks her who is hereJohn asks her who walks
    mkCl NP -> V2V -> NP -> VP -> ClJohn forces us to sleepJohn forces her to walk
    mkCl
    mkClNP -> NP -> ClJohn is the man
    mkCl NP -> N -> Cl John is a man
    mkClNP -> NP -> ClJohn is the man
    mkCl NP -> Adv -> Cl John is here
    mkCl NP -> VP -> ClJohn walks hereJohn always walks here
    mkClN -> Clthere is a house
    mkClCN -> Clthere is an old house
    mkClNP -> Clthere are five houses
    mkClNP -> RS -> Clit is John who walks
    mkClAdv -> S -> Clit is here he walks
    mkCl
    mkClN -> Clthere is a house
    mkClCN -> Clthere is an old houses
    mkClNP -> Clthere are five houses
    mkClNP -> RS -> Clit is John that walks
    mkClAdv -> S -> Clit is here John walksSC -> VP -> ClmkCl

    ClSlash

    - +
    @@ -1160,35 +1179,64 @@ Lexical category, constructors given in + + + + + - + - + - + - + + + + + +
    Function Type
    mkClSlashNP -> VPSlash -> ClSlash(whom) he sees here
    mkClSlash NP -> V2 -> ClSlash(whom) John loves(whom) he sees
    mkClSlash NP -> VV -> V2 -> ClSlash(whom) John wants to see(whom) he wants to see
    mkClSlash Cl -> Prep -> ClSlash(with whom) John walks(with whom) he walks
    mkClSlash ClSlash -> Adv -> ClSlash(whom) John loves today(whom) he sees tomorrow
    mkClSlashNP -> VS -> SSlash -> ClSlash(whom) she says that he loves

    Comp - complement of copula, such as AP

    -

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

    + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    mkCompAP -> Compvery old
    mkCompNP -> Compthis man
    mkCompAdv -> Comphere
    +

    Conj - conjunction

    - +
    @@ -1223,7 +1271,7 @@ Lexical category, constructors given in

    Det - determiner phrase

    -
    Function Type
    +
    @@ -1266,38 +1314,28 @@ Lexical category, constructors given in - - + + - - + + - + - - - - - - - - - - - + @@ -1306,13 +1344,18 @@ Lexical category, constructors given in + + + + + - + - + @@ -1335,6 +1378,11 @@ Lexical category, constructors given in + + + + + @@ -1343,7 +1391,7 @@ Lexical category, constructors given in

    Dig

    -
    Function Type
    mkDetQuant -> (Ord) -> Detthis firstQuant -> Card -> Detthese five
    mkDetQuant -> Num -> DettheseQuant -> Ord -> Detthe best
    mkDetQuant -> Num -> (Ord) -> DetQuant -> Num -> Ord -> Det these five best
    mkDetQuant -> Detthis
    mkDet Quant -> Num -> Det these five
    mkDet Card -> Detalmost twenty
    mkDetNumeral -> Detfiveforty
    mkDet
    mkDetNumeral -> Detfive
    mkDet Pron -> Detmy (house)my
    mkDet Pron -> Num -> Detmy (houses)my five
    much_Detthe (houses)
    theSg_DetDetthe (houses)
    the_Det Det the (house)
    +
    @@ -1403,7 +1451,7 @@ Lexical category, constructors given in

    Digits - cardinal or ordinal in digits

    -
    Function Type
    +
    @@ -1411,84 +1459,24 @@ Lexical category, constructors given in + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    Function Type
    mkDigitsStr -> Digits35 (from string "35")
    mkDigits Dig -> Digits84
    mkDigits Dig -> Digits -> Digits876
    n1000_DigitsDigits1,000
    n100_DigitsDigits100
    n10_DigitsDigits10
    n1_DigitsDigits1
    n20_DigitsDigits20
    n2_DigitsDigits2
    n3_DigitsDigits3
    n4_DigitsDigits4
    n5_DigitsDigits5
    n6_DigitsDigits6
    n7_DigitsDigits7
    n8_DigitsDigits8
    n9_DigitsDigits91,233,432

    IAdv - interrogative adverb

    - +
    @@ -1539,7 +1527,7 @@ Lexical category, constructors given in

    IDet - interrogative determiner

    -
    Function Type
    +
    @@ -1550,11 +1538,31 @@ Lexical category, constructors given in + + + + + + + + + + + + + + + + + + + +
    Function TypeIDet how8many
    mkIDetIQuant -> Num -> IDetwhich (songs)
    mkIDetIQuant -> IDetmkIDet
    whichPl_IDetIDetwhichPl
    which_IDetIDetwhich

    IP - interrogative pronoun

    - +
    @@ -1562,13 +1570,33 @@ Lexical category, constructors given in - - + + - - + + + + + + + + + + + + + + + + + + + + + + @@ -1586,6 +1614,11 @@ Lexical category, constructors given in + + + + + @@ -1595,11 +1628,16 @@ Lexical category, constructors given in + + + + +
    Function Type
    mkIPIQuant -> N -> IPwhich cityIDet -> CN -> IPwhich five big cities
    mkIPIQuant -> (Num) -> CN -> IPwhich five big citiesIDet -> N -> IPwhich five cities
    mkIPIDet -> IPwhich five
    mkIPIQuant -> CN -> IPwhich big cities
    mkIPIQuant -> Num -> CN -> IPwhich five cities
    mkIPIQuant -> N -> IPwhich city
    mkIPwhat (singular)
    what_IPIPwhat (singular)
    whoPl_IP IP who (plural)IP who (singular)
    who_IPIPwho (singular)

    IQuant

    - +
    @@ -1614,7 +1652,7 @@ Lexical category, constructors given in

    Imp - imperative

    -
    Function Type
    +
    @@ -1622,24 +1660,24 @@ Lexical category, constructors given in - + - + - - + +
    Function Type
    mkImpV -> ImpVP -> Imp go
    mkImpV2 -> NP -> ImpV -> Imp take it
    mkImpVP -> Impgo there nowV2 -> NP -> Impcome here now

    ImpForm

    - +
    @@ -1648,17 +1686,17 @@ Lexical category, constructors given in - + - + - +
    Function Type
    pluralImpForm ImpForm(help yourselves)help yourselves
    politeImpForm ImpForm(help yourself) (polite singular)help yourself polite
    singularImpForm ImpForm(help yourself) [default]help yourself [default]
    @@ -1670,7 +1708,7 @@ Lexical category, constructors given in

    ListAP

    - +
    @@ -1679,18 +1717,18 @@ Lexical category, constructors given in - + - +
    Function Type
    mkListAP AP -> AP -> ListAPold, bigmkListAP
    mkListAP AP -> ListAP -> ListAPold, big, warmmkListAP

    ListAdv

    - +
    @@ -1699,18 +1737,18 @@ Lexical category, constructors given in - + - +
    Function Type
    mkListAdv Adv -> Adv -> ListAdvhere, nowmkListAdv
    mkListAdv Adv -> ListAdv -> ListAdvto me, here, nowmkListAdv

    ListNP

    - +
    @@ -1719,18 +1757,18 @@ Lexical category, constructors given in - + - +
    Function Type
    mkListNP NP -> NP -> ListNPJohn, ImkListNP
    mkListNP NP -> ListNP -> ListNPJohn, I, thatmkListNP

    ListRS

    - +
    @@ -1739,18 +1777,18 @@ Lexical category, constructors given in - + - +
    Function Type
    mkListRS RS -> RS -> ListRSwho walks, who runsmkListRS
    mkListRS RS -> ListRS -> ListRSwho walks, who runs, who sleepsmkListRS

    ListS

    - +
    @@ -1759,12 +1797,12 @@ Lexical category, constructors given in - + - +
    Function Type
    mkListS S -> S -> ListShe walks, I runmkListS
    mkListS S -> ListS -> ListSJohn walks, I run, you sleepmkListS
    @@ -1788,7 +1826,7 @@ Lexical category, constructors given in

    NP - noun phrase (subject or object)

    - +
    @@ -1807,17 +1845,22 @@ Lexical category, constructors given in - + - + + + + + + - - + + @@ -1826,38 +1869,38 @@ Lexical category, constructors given in - - + + - + - - + + - + - - + + - + - - + + @@ -1866,6 +1909,11 @@ Lexical category, constructors given in + + + + + @@ -1881,33 +1929,38 @@ Lexical category, constructors given in - + + + + + + + + + + + - - - - - - + - + - + @@ -1917,12 +1970,12 @@ Lexical category, constructors given in - + - + @@ -1948,7 +2001,7 @@ Lexical category, constructors given in

    Num - number determining element

    -
    Function Type
    mkNP Quant -> N -> NPthis menthis man
    mkNPQuant -> (Num) -> CN -> NPQuant -> CN -> NPthis old man
    mkNPQuant -> Num -> CN -> NP these five old men
    mkNPDet -> N -> NPthe first manQuant -> Num -> N -> NPthese five men
    mkNP
    mkNPNumeral -> N -> NPtwenty menDet -> N -> NPthe first man
    mkNP Numeral -> CN -> NPtwenty old menfifty old men
    mkNPDigits -> N -> NP45 menNumeral -> N -> NPfifty men
    mkNP Digits -> CN -> NP45 old men51 old men
    mkNPCard -> N -> NPalmost twenty menDigits -> N -> NP51 men
    mkNP Card -> CN -> NPalmost twenty old menforty-five old men
    mkNPPron -> N -> NPmy manCard -> N -> NPforty-five men
    mkNP
    mkNPPron -> N -> NPmy man
    mkNP PN -> NP John
    mkNPDet -> NPQuant -> Num -> NP these five
    mkNPDet -> NPthese five best
    mkNPCN -> NPold beer
    mkNP N -> NP beer
    mkNPCN -> NPbeer
    mkNP Predet -> NP -> NPonly Johnonly the man
    mkNP NP -> V2 -> NPJohn killedthe man seen
    mkNP NP -> Adv -> NPJohn in ParisParis today
    mkNP
    mkNP Conj -> NP -> NP -> NPJohn and ImkNP
    mkNP Conj -> ListNP -> NPJohn, I, and thatmkNP
    nobody_NP
    +
    @@ -1967,7 +2020,12 @@ Lexical category, constructors given in - + + + + + + @@ -1980,12 +2038,12 @@ Lexical category, constructors given in - + - + @@ -1993,7 +2051,7 @@ Lexical category, constructors given in

    Numeral - cardinal or ordinal in words

    -
    Function Type
    mkNum Digits -> Num5121
    mkNumDigit -> Numfive
    mkNumalmost ten
    plNumpluralNum Num plural
    sgNumsingularNum Num singular
    +
    @@ -2001,79 +2059,29 @@ Lexical category, constructors given in + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +
    Function Type
    mkNumeralSub1000 -> Numeralcoerce 1..999
    mkNumeralSub1000 -> Sub1000 -> Numeral1000m + n
    mkNumeral Str -> Numeral thirty-five (given by "35")
    n1000_NumeralNumeralthousand
    n100_NumeralNumeralhundred
    n10_NumeralNumeralten
    n1_NumeralNumeralone
    n20_NumeralNumeraltwenty
    n2_NumeralNumeraltwo
    n3_NumeralNumeralthree
    n4_NumeralNumeralfour
    n5_NumeralNumeralfive
    n6_NumeralNumeralsix
    n7_NumeralNumeralseven
    n8_NumeralNumeraleight
    n9_NumeralNumeralninethousandfoldNumeralSub1000 -> Numeral1000n

    Ord - ordinal number (used in Det)

    - +
    @@ -2091,14 +2099,19 @@ Lexical category, constructors given in + + + + + - +
    Function Type
    mkOrdDigit -> Ordfifth
    mkOrd A -> Ordbestlargest

    PConj - phrase-beginning conjunction

    - +
    @@ -2134,7 +2147,7 @@ Lexical category, constructors given in

    Phr - phrase in a text

    -
    Function Type
    +
    @@ -2142,39 +2155,34 @@ Lexical category, constructors given in - - - - - - + - + - + - + - +
    Function Type
    mkPhrUtt -> Phrwhy
    mkPhr (PConj) -> Utt -> (Voc) -> Phrbut why Johnbut come here John
    mkPhr S -> PhrJohn walkedI go home
    mkPhr Cl -> PhrJohn walksI go home
    mkPhr QS -> Phrdid John walkI go home
    mkPhr Imp -> PhrwalkI go home

    Pol - polarity

    - +
    @@ -2183,18 +2191,18 @@ Lexical category, constructors given in - + - +
    Function Type
    negativePol Pol(John doesn't walk)John doesn't walk
    positivePol Pol(John walks) [default]John walks [default]

    Predet - predeterminer (prefixed Quant)

    - +
    @@ -2224,7 +2232,7 @@ Lexical category, constructors given in

    Prep - preposition, or just case

    -
    Function Type
    +
    @@ -2339,7 +2347,7 @@ Lexical category, constructors given in

    Pron - personal pronoun

    -
    Function Type
    +
    @@ -2394,7 +2402,7 @@ Lexical category, constructors given in

    Punct

    -
    Function Type
    +
    @@ -2419,7 +2427,7 @@ Lexical category, constructors given in

    QCl - question clause, with all tenses

    -
    Function Type
    +
    @@ -2437,13 +2445,108 @@ Lexical category, constructors given in + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -2453,7 +2556,7 @@ Lexical category, constructors given in - + @@ -2462,19 +2565,19 @@ Lexical category, constructors given in - - + + - - + +
    Function Type
    mkQClIP -> V -> QClwho walks
    mkQClIP -> V2 -> NP -> QClwho loves her
    mkQClIP -> V3 -> NP -> NP -> QClwho sends it to her
    mkQClIP -> VV -> VP -> QClwho wants to walk
    mkQClIP -> VS -> S -> QClwho says that she walks
    mkQClIP -> VQ -> QS -> QClwho wonders who walks
    mkQClIP -> VA -> AP -> QClwho becomes old
    mkQClIP -> V2A -> NP -> AP -> QClwho paints it red
    mkQClIP -> V2S -> NP -> S -> QClwho tells her that we walk
    mkQClIP -> V2Q -> NP -> QS -> QClwho asks her who walks
    mkQClIP -> V2V -> NP -> VP -> QClwho forces her to walk
    mkQClIP -> A -> QClwho is old
    mkQClIP -> A -> NP -> QClwho is older than her
    mkQClIP -> A2 -> NP -> QClwho is married to her
    mkQClIP -> AP -> QClwho is very old
    mkQClIP -> NP -> QClwho is the man
    mkQClIP -> N -> QClwho is a man
    mkQClIP -> CN -> QClwho is an old man
    mkQClIP -> Adv -> QClwho is here
    mkQCl IP -> NP -> V2 -> QClwhom does John lovewho does John love
    mkQCl IP -> ClSlash -> QClwhom does John love todaywho does John today
    mkQCl
    mkQCl Prep -> IP -> Cl -> QClwith who does John walkwith whom does John walk
    mkQCl
    mkQClIP -> QClwhat is thereIComp -> NP -> QClwho is this man
    mkQClIComp -> NP -> QClwho is JohnIP -> QClwhich houses are there

    QS - question

    - +
    @@ -2482,24 +2585,19 @@ Lexical category, constructors given in - - - - - - +
    Function Type
    mkQSQCl -> QSwho walks
    mkQS (Tense) -> (Ant) -> (Pol) -> QCl -> QS who wouldn't have walked
    mkQS Cl -> QSdoes John walkmkQS

    Quant - quantifier ('nucleus' of Det)

    - +
    @@ -2539,7 +2637,7 @@ Lexical category, constructors given in

    RCl - relative clause, with all tenses

    -
    Function Type
    +
    @@ -2548,17 +2646,17 @@ Lexical category, constructors given in - - - - - - + - + + + + + + @@ -2569,7 +2667,7 @@ Lexical category, constructors given in

    RP - relative pronoun

    -
    Function Type
    mkRCl RP -> VP -> RClthat walk
    mkRClRP -> NP -> V2 -> RClwhich John lovesthat loves John
    mkRCl RP -> ClSlash -> RClwhich John loves todaywhom John loves today
    mkRClRP -> NP -> V2 -> RClwhom John loves
    mkRCl
    +
    @@ -2589,7 +2687,7 @@ Lexical category, constructors given in

    RS - relative

    -
    Function Type
    +
    @@ -2597,29 +2695,24 @@ Lexical category, constructors given in - - - - - - + - +
    Function Type
    mkRSRCl -> RSthat walk
    mkRS (Tense) -> (Ant) -> (Pol) -> RCl -> RS that wouldn't have walked
    mkRS Conj -> RS -> RS -> RSwho walks and whom I knowwho walks and whose mother runsx
    mkRS Conj -> ListRS -> RSwho walks, whose son runs, and whom I knowwho walks, whom I see and who sleeps

    S - declarative sentence

    - +
    @@ -2627,11 +2720,6 @@ Lexical category, constructors given in - - - - - @@ -2654,13 +2742,97 @@ Lexical category, constructors given in

    SC - embedded sentence or question

    -

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

    +
    Function Type
    mkSCl -> SJohn walks
    mkS (Tense) -> (Ant) -> (Pol) -> Cl -> S John wouldn't have walked
    + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    mkSCS -> SCthat he walks
    mkSCQS -> SCwhether he walks
    mkSCVP -> SCto walk
    + + +

    SSlash

    + + + + + + + + + + + +
    FunctionTypeExample
    mkSSlashTemp -> Pol -> ClSlash -> SSlashmkSSlash
    + + +

    Sub100

    + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    mkSub100Unit -> Sub100coerce 1..9
    mkSub100Unit -> Unit -> Sub10010m + n
    tenfoldSub100Unit -> Sub10010n
    + + +

    Sub1000

    + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    mkSub1000Sub100 -> Sub1000coerce 1..99
    mkSub1000Sub10 -> Sub1000100n
    mkSub1000Sub10 -> Sub100 -> Sub1000100m + n
    +

    Subj - subjunction

    - +
    @@ -2701,7 +2873,7 @@ Lexical category, constructors given in

    Tense - tense

    -
    Function Type
    +
    @@ -2710,28 +2882,28 @@ Lexical category, constructors given in - + - + - + - +
    Function Type
    conditionalTense Tense(John would walk)John would walk
    futureTense Tense(John will walk)John will walk
    pastTense Tense(John walked)John walked
    presentTense Tense(John walks) [default]John walks [default]

    Text - text consisting of several phrases

    - +
    @@ -2744,18 +2916,13 @@ Lexical category, constructors given in - - - - - - + @@ -2774,7 +2941,7 @@ Lexical category, constructors given in - + @@ -2784,9 +2951,64 @@ Lexical category, constructors given in
    Function Type
    mkTextPhr -> TextBut John walks.
    mkText Phr -> (Punct) -> (Text) -> Text John walks? Yes.
    mkText Utt -> TextJohn.Yes.
    mkText
    mkTextImp -> Text(Pol) -> Imp -> Text Walk!
    + +

    Unit

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionTypeExample
    n1_UnitUnitone
    n2_UnitUnittwo
    n3_UnitUnitthree
    n4_UnitUnitfour
    n5_UnitUnitfive
    n6_UnitUnitsix
    n7_UnitUnitseven
    n8_UnitUniteight
    n9_UnitUnitnine
    +

    Utt - sentence, question, word...

    - +
    @@ -2819,11 +3041,6 @@ Lexical category, constructors given in - - - - - @@ -2840,7 +3057,7 @@ Lexical category, constructors given in - + @@ -2850,7 +3067,7 @@ Lexical category, constructors given in - + @@ -2860,7 +3077,7 @@ Lexical category, constructors given in - + @@ -2887,7 +3104,7 @@ Lexical category, constructors given in

    V2 - two-place verb

    -
    Function Type
    mkUttImp -> Uttlove yourself
    mkUtt (ImpForm) -> (Pol) -> Imp -> Utt don't love yourselves
    mkUtt NP -> UttJohnthis man
    mkUtt
    mkUtt VP -> Uttto walkto sleep
    mkUtt
    mkUtt AP -> Uttfinegood
    mkUtt
    +
    @@ -2938,7 +3155,7 @@ Lexical category, constructors given in

    VP - verb phrase

    -
    Function Type
    +
    @@ -2947,37 +3164,37 @@ Lexical category, constructors given in - + - + - + - + - + - + - + @@ -2986,13 +3203,23 @@ Lexical category, constructors given in - - + + - - + + + + + + + + + + + + @@ -3006,6 +3233,11 @@ Lexical category, constructors given in + + + + + @@ -3017,7 +3249,7 @@ Lexical category, constructors given in - + @@ -3045,6 +3277,11 @@ Lexical category, constructors given in + + + + + @@ -3068,7 +3305,7 @@ Lexical category, constructors given in

    VPSlash - verb phrase missing complement

    -
    Function Type
    mkVP V -> VPwalksleep
    mkVP V2 -> NP -> VPlove herlove it
    mkVP V3 -> NP -> NP -> VPsend it to hersend a message to her
    mkVP VV -> VP -> VPwant to walkwant to run
    mkVP VS -> S -> VPknow that she walksknow that she runs
    mkVP VQ -> QS -> VPask if she walkswonder if she runs
    mkVP VA -> AP -> VPbecome oldbecome red
    mkVP
    mkVPA -> VPbe warmV2S -> NP -> S -> VPtell her that we walk
    mkVPAP -> VPbe very warmV2Q -> NP -> QS -> VPask her who walks
    mkVPV2V -> NP -> VP -> VPforce her to walk
    mkVPA -> VPbe warm
    mkVP
    mkVPAP -> VPbe warm
    mkVP N -> VP be a man
    mkVP NP -> VPbe the manbe this man
    mkVPpaint itself black
    mkVPComp -> VPbe warm
    passiveVP V2 -> VP be loved
    +
    @@ -3104,6 +3341,16 @@ Lexical category, constructors given in + + + + + + + + + +
    Function TypeV2V -> VP -> VPSlash (whom) (John) forces to sleep
    mkVPSlashVV -> VPSlash -> VPSlashwant always to buy
    mkVPSlashV2V -> NP -> VPSlash -> VPSlashbeg me always to buy
    @@ -3120,7 +3367,7 @@ Lexical category, constructors given in

    VV - verb-phrase-complement verb

    - +
    @@ -3150,7 +3397,7 @@ Lexical category, constructors given in

    Voc - vocative or "please"

    -
    Function Type
    +
    @@ -3168,9 +3415,9 @@ Lexical category, constructors given in
    Function Type
    - +

    Lexical Paradigms

    - +

    Paradigms for Bulgarian

    @@ -3178,7 +3425,7 @@ Lexical category, constructors given in

    source http://www.grammaticalframework.org/lib/resource/src/bulgarian/ParadigmsBul.gf

    - +
    @@ -3861,7 +4108,7 @@ source http://www.grammaticalfr
    Function Type
    - +

    Paradigms for Catalan

    @@ -3869,7 +4116,7 @@ source http://www.grammaticalfr

    source http://www.grammaticalframework.org/lib/resource/src/catalan/ParadigmsCat.gf

    - +
    @@ -4096,7 +4343,7 @@ source http://www.grammaticalfram
    Function Type
    - +

    Paradigms for Danish

    @@ -4104,7 +4351,7 @@ source http://www.grammaticalfram

    source http://www.grammaticalframework.org/lib/resource/src/danish/ParadigmsDan.gf

    - +
    @@ -4347,7 +4594,7 @@ source http://www.grammaticalframe
    Function Type
    - +

    Paradigms for Dutch

    @@ -4355,7 +4602,7 @@ source http://www.grammaticalframe

    source http://www.grammaticalframework.org/lib/resource/src/dutch/ParadigmsDut.gf

    - +
    @@ -4630,7 +4877,7 @@ source http://www.grammaticalframew
    Function Type
    - +

    Paradigms for English

    @@ -4638,7 +4885,7 @@ source http://www.grammaticalframew

    source http://www.grammaticalframework.org/lib/resource/src/english/ParadigmsEng.gf

    - +
    @@ -4977,7 +5224,7 @@ source http://www.grammaticalfram
    Function Type
    - +

    Paradigms for Finnish

    @@ -4985,7 +5232,7 @@ source http://www.grammaticalfram

    source http://www.grammaticalframework.org/lib/resource/src/finnish/ParadigmsFin.gf

    - +
    @@ -5256,7 +5503,7 @@ source http://www.grammaticalfram
    Function Type
    - +

    Paradigms for French

    @@ -5264,7 +5511,7 @@ source http://www.grammaticalfram

    source http://www.grammaticalframework.org/lib/resource/src/french/ParadigmsFre.gf

    - +
    @@ -5495,7 +5742,7 @@ source http://www.grammaticalframe
    Function Type
    - +

    Paradigms for German

    @@ -5503,7 +5750,7 @@ source http://www.grammaticalframe

    source http://www.grammaticalframework.org/lib/resource/src/german/ParadigmsGer.gf

    - +
    @@ -5794,7 +6041,7 @@ source http://www.grammaticalframe
    Function Type
    - +

    Paradigms for Italian

    @@ -5802,7 +6049,7 @@ source http://www.grammaticalframe

    source http://www.grammaticalframework.org/lib/resource/src/italian/ParadigmsIta.gf

    - +
    @@ -6033,7 +6280,7 @@ source http://www.grammaticalfram
    Function Type
    - +

    Paradigms for Norwegian

    @@ -6041,7 +6288,7 @@ source http://www.grammaticalfram

    source http://www.grammaticalframework.org/lib/resource/src/norwegian/ParadigmsNor.gf

    - +
    @@ -6284,7 +6531,7 @@ source http://www.grammaticalfr
    Function Type
    - +

    Paradigms for Polish

    @@ -6292,7 +6539,7 @@ source http://www.grammaticalfr

    source http://www.grammaticalframework.org/lib/resource/src/polish/ParadigmsPol.gf

    - +
    @@ -6891,7 +7138,7 @@ source http://www.grammaticalframe
    Function Type
    - +

    Paradigms for Romanian

    @@ -6899,7 +7146,7 @@ source http://www.grammaticalframe

    source http://www.grammaticalframework.org/lib/resource/src/romanian/ParadigmsRon.gf

    - +
    @@ -7042,7 +7289,7 @@ source http://www.grammaticalfra
    Function Type
    - +

    Paradigms for Russian

    @@ -7050,7 +7297,7 @@ source http://www.grammaticalfra

    source http://www.grammaticalframework.org/lib/resource/src/russian/ParadigmsRus.gf

    - +
    @@ -7185,7 +7432,7 @@ source http://www.grammaticalfram
    Function Type
    - +

    Paradigms for Spanish

    @@ -7193,7 +7440,7 @@ source http://www.grammaticalfram

    source http://www.grammaticalframework.org/lib/resource/src/spanish/ParadigmsSpa.gf

    - +
    @@ -7424,7 +7671,7 @@ source http://www.grammaticalfram
    Function Type
    - +

    Paradigms for Swedish

    @@ -7432,7 +7679,7 @@ source http://www.grammaticalfram

    source http://www.grammaticalframework.org/lib/resource/src/swedish/ParadigmsSwe.gf

    - +
    @@ -7675,7 +7922,7 @@ source http://www.grammaticalfram
    Function Type
    - +

    Paradigms for Urdu

    @@ -7683,7 +7930,7 @@ source http://www.grammaticalfram

    source http://www.grammaticalframework.org/lib/resource/src/urdu/ParadigmsUrd.gf

    - +
    @@ -7866,7 +8113,7 @@ source http://www.grammaticalframewo
    Function Type
    - +

    Browsing the libraries with GF commands

    New: Browsing by syntax editor @@ -7893,7 +8140,7 @@ To try out overloaded syntax, test lexicon, and inflection paradigms: > cc mkCl (mkNP this_Quant (mkN "Farbe")) (mkA "dunkel")

    - +

    An Example of Usage

    The standard way of building an application has the following modules. @@ -7958,6 +8205,6 @@ For each language, an instantiation of the functor:

    - + diff --git a/lib/doc/synopsis.txt b/lib/doc/synopsis.txt index 945e9a38f..e3d498619 100644 --- a/lib/doc/synopsis.txt +++ b/lib/doc/synopsis.txt @@ -167,13 +167,14 @@ Lexical category, constructors given in ==AP - adjectival phrase==[AP] || Function | Type | Example || | ``comparAP`` | [A #A] ``->`` [AP #AP] | //warmer// | -| ``mkAP`` | [A #A] ``->`` [AP #AP] | //old// | -| ``mkAP`` | [A #A] ``->`` [NP #NP] ``->`` [AP #AP] | //older than John// | +| ``mkAP`` | [A #A] ``->`` [AP #AP] | //warm// | +| ``mkAP`` | [A #A] ``->`` [NP #NP] ``->`` [AP #AP] | //warmer than Paris// | | ``mkAP`` | [A2 #A2] ``->`` [NP #NP] ``->`` [AP #AP] | //married to her// | | ``mkAP`` | [A2 #A2] ``->`` [AP #AP] | //married// | | ``mkAP`` | [AP #AP] ``->`` [S #S] ``->`` [AP #AP] | //probable that John walks// | | ``mkAP`` | [AP #AP] ``->`` [QS #QS] ``->`` [AP #AP] | //uncertain if John walks// | | ``mkAP`` | [AP #AP] ``->`` [VP #VP] ``->`` [AP #AP] | //ready to go// | +| ``mkAP`` | [AP #AP] ``->`` [SC #SC] ``->`` [AP #AP] | //ready to go// | | ``mkAP`` | [AdA #AdA] ``->`` [A #A] ``->`` [AP #AP] | //very old// | | ``mkAP`` | [AdA #AdA] ``->`` [AP #AP] ``->`` [AP #AP] | //very very old// | | ``mkAP`` | [Conj #Conj] ``->`` [AP #AP] ``->`` [AP #AP] ``->`` [AP #AP] | //old and big// | @@ -204,10 +205,10 @@ Lexical category, constructors given in | ``here7to_Adv`` | [Adv #Adv] | //to here// | | ``here_Adv`` | [Adv #Adv] | //here// | | ``mkAdv`` | [A #A] ``->`` [Adv #Adv] | //warmly// | -| ``mkAdv`` | [Prep #Prep] ``->`` [NP #NP] ``->`` [Adv #Adv] | //with John// | +| ``mkAdv`` | [Prep #Prep] ``->`` [NP #NP] ``->`` [Adv #Adv] | //in the house// | | ``mkAdv`` | [Subj #Subj] ``->`` [S #S] ``->`` [Adv #Adv] | //when John walks// | | ``mkAdv`` | [CAdv #CAdv] ``->`` [A #A] ``->`` [NP #NP] ``->`` [Adv #Adv] | //more warmly than John// | -| ``mkAdv`` | [CAdv #CAdv] ``->`` [A #A] ``->`` [S #S] ``->`` [Adv #Adv] | //more warmly than John walks// | +| ``mkAdv`` | [CAdv #CAdv] ``->`` [A #A] ``->`` [S #S] ``->`` [Adv #Adv] | //more warmly than he runs// | | ``mkAdv`` | [AdA #AdA] ``->`` [Adv #Adv] ``->`` [Adv #Adv] | //very warmly// | | ``mkAdv`` | [Conj #Conj] ``->`` [Adv #Adv] ``->`` [Adv #Adv] ``->`` [Adv #Adv] | //here and now// | | ``mkAdv`` | [Conj #Conj] ``->`` [ListAdv #ListAdv] ``->`` [Adv #Adv] | //with John, here and now// | @@ -217,8 +218,8 @@ Lexical category, constructors given in | ``there_Adv`` | [Adv #Adv] | //there// | ==Ant - anteriority==[Ant] || Function | Type | Example || -| ``anteriorAnt`` | [Ant #Ant] | //(John has walked)// | -| ``simultaneousAnt`` | [Ant #Ant] | //(John walks) [default]// | +| ``anteriorAnt`` | [Ant #Ant] | //John has walked// | +| ``simultaneousAnt`` | [Ant #Ant] | //John walks [default]// | ==CAdv - comparative adverb==[CAdv] || Function | Type | Example || | ``as_CAdv`` | [CAdv #CAdv] | //as// | @@ -229,27 +230,28 @@ Lexical category, constructors given in | ``mkCN`` | [N #N] ``->`` [CN #CN] | //house// | | ``mkCN`` | [N2 #N2] ``->`` [NP #NP] ``->`` [CN #CN] | //mother of John// | | ``mkCN`` | [N3 #N3] ``->`` [NP #NP] ``->`` [NP #NP] ``->`` [CN #CN] | //distance from this city to Paris// | -| ``mkCN`` | [N2 #N2] ``->`` [CN #CN] | //son// | -| ``mkCN`` | [N3 #N3] ``->`` [CN #CN] | //flight// | +| ``mkCN`` | [N2 #N2] ``->`` [CN #CN] | //mother// | +| ``mkCN`` | [N3 #N3] ``->`` [CN #CN] | //distance// | | ``mkCN`` | [A #A] ``->`` [N #N] ``->`` [CN #CN] | //big house// | | ``mkCN`` | [A #A] ``->`` [CN #CN] ``->`` [CN #CN] | //big blue house// | | ``mkCN`` | [AP #AP] ``->`` [N #N] ``->`` [CN #CN] | //very big house// | | ``mkCN`` | [AP #AP] ``->`` [CN #CN] ``->`` [CN #CN] | //very big blue house// | -| ``mkCN`` | [N #N] ``->`` [RS #RS] ``->`` [CN #CN] | //house that John loves// | +| ``mkCN`` | [N #N] ``->`` [RS #RS] ``->`` [CN #CN] | //house that John owns// | | ``mkCN`` | [CN #CN] ``->`` [RS #RS] ``->`` [CN #CN] | //big house that John loves// | -| ``mkCN`` | [N #N] ``->`` [Adv #Adv] ``->`` [CN #CN] | //house in the city// | -| ``mkCN`` | [CN #CN] ``->`` [Adv #Adv] ``->`` [CN #CN] | //big house in the city// | +| ``mkCN`` | [N #N] ``->`` [Adv #Adv] ``->`` [CN #CN] | //house on the hill// | +| ``mkCN`` | [CN #CN] ``->`` [Adv #Adv] ``->`` [CN #CN] | //big house on the hill// | | ``mkCN`` | [CN #CN] ``->`` [S #S] ``->`` [CN #CN] | //rule that John walks// | | ``mkCN`` | [CN #CN] ``->`` [QS #QS] ``->`` [CN #CN] | //question if John walks// | | ``mkCN`` | [CN #CN] ``->`` [VP #VP] ``->`` [CN #CN] | //reason to walk// | +| ``mkCN`` | [CN #CN] ``->`` [SC #SC] ``->`` [CN #CN] | //reason to walk// | | ``mkCN`` | [N #N] ``->`` [NP #NP] ``->`` [CN #CN] | //king John// | | ``mkCN`` | [CN #CN] ``->`` [NP #NP] ``->`` [CN #CN] | //old king John// | ==Card - cardinal number==[Card] || Function | Type | Example || -| ``mkCard`` | ``Str`` ``->`` [Card #Card] | //thirty-five (given by "35")// | -| ``mkCard`` | [Numeral #Numeral] ``->`` [Card #Card] | //thirty-five (given in any way)// | +| ``mkCard`` | ``Str`` ``->`` [Card #Card] | //thirty-five (given as "35")// | +| ``mkCard`` | [Numeral #Numeral] ``->`` [Card #Card] | //twenty// | | ``mkCard`` | [Digits #Digits] ``->`` [Card #Card] | //51// | -| ``mkCard`` | [AdN #AdN] ``->`` [Card #Card] ``->`` [Card #Card] | //mkCard// | +| ``mkCard`` | [AdN #AdN] ``->`` [Card #Card] ``->`` [Card #Card] | //almost fifty// | ==Cl - declarative clause, with all tenses==[Cl] || Function | Type | Example || | ``genericCl`` | [VP #VP] ``->`` [Cl #Cl] | //one walks// | @@ -257,38 +259,43 @@ Lexical category, constructors given in | ``mkCl`` | [NP #NP] ``->`` [V2 #V2] ``->`` [NP #NP] ``->`` [Cl #Cl] | //John loves her// | | ``mkCl`` | [NP #NP] ``->`` [V3 #V3] ``->`` [NP #NP] ``->`` [NP #NP] ``->`` [Cl #Cl] | //John sends it to her// | | ``mkCl`` | [NP #NP] ``->`` [VV #VV] ``->`` [VP #VP] ``->`` [Cl #Cl] | //John wants to walk// | -| ``mkCl`` | [NP #NP] ``->`` [VS #VS] ``->`` [S #S] ``->`` [Cl #Cl] | //John says that it is good// | -| ``mkCl`` | [NP #NP] ``->`` [VQ #VQ] ``->`` [QS #QS] ``->`` [Cl #Cl] | //John wonders if it is good// | +| ``mkCl`` | [NP #NP] ``->`` [VS #VS] ``->`` [S #S] ``->`` [Cl #Cl] | //John says that she walks// | +| ``mkCl`` | [NP #NP] ``->`` [VQ #VQ] ``->`` [QS #QS] ``->`` [Cl #Cl] | //John wonders who walks// | | ``mkCl`` | [NP #NP] ``->`` [VA #VA] ``->`` [AP #AP] ``->`` [Cl #Cl] | //John becomes old// | | ``mkCl`` | [NP #NP] ``->`` [V2A #V2A] ``->`` [NP #NP] ``->`` [AP #AP] ``->`` [Cl #Cl] | //John paints it red// | -| ``mkCl`` | [NP #NP] ``->`` [V2S #V2S] ``->`` [NP #NP] ``->`` [S #S] ``->`` [Cl #Cl] | //John tells her that we are here// | -| ``mkCl`` | [NP #NP] ``->`` [V2Q #V2Q] ``->`` [NP #NP] ``->`` [QS #QS] ``->`` [Cl #Cl] | //John asks her who is here// | -| ``mkCl`` | [NP #NP] ``->`` [V2V #V2V] ``->`` [NP #NP] ``->`` [VP #VP] ``->`` [Cl #Cl] | //John forces us to sleep// | +| ``mkCl`` | [NP #NP] ``->`` [V2S #V2S] ``->`` [NP #NP] ``->`` [S #S] ``->`` [Cl #Cl] | //John tells her that we walk// | +| ``mkCl`` | [NP #NP] ``->`` [V2Q #V2Q] ``->`` [NP #NP] ``->`` [QS #QS] ``->`` [Cl #Cl] | //John asks her who walks// | +| ``mkCl`` | [NP #NP] ``->`` [V2V #V2V] ``->`` [NP #NP] ``->`` [VP #VP] ``->`` [Cl #Cl] | //John forces her to walk// | | ``mkCl`` | [NP #NP] ``->`` [A #A] ``->`` [Cl #Cl] | //John is old// | | ``mkCl`` | [NP #NP] ``->`` [A #A] ``->`` [NP #NP] ``->`` [Cl #Cl] | //John is older than her// | | ``mkCl`` | [NP #NP] ``->`` [A2 #A2] ``->`` [NP #NP] ``->`` [Cl #Cl] | //John is married to her// | | ``mkCl`` | [NP #NP] ``->`` [AP #AP] ``->`` [Cl #Cl] | //John is very old// | +| ``mkCl`` | [NP #NP] ``->`` [NP #NP] ``->`` [Cl #Cl] | //John is the man// | | ``mkCl`` | [NP #NP] ``->`` [N #N] ``->`` [Cl #Cl] | //John is a man// | | ``mkCl`` | [NP #NP] ``->`` [CN #CN] ``->`` [Cl #Cl] | //John is an old man// | -| ``mkCl`` | [NP #NP] ``->`` [NP #NP] ``->`` [Cl #Cl] | //John is the man// | | ``mkCl`` | [NP #NP] ``->`` [Adv #Adv] ``->`` [Cl #Cl] | //John is here// | -| ``mkCl`` | [NP #NP] ``->`` [VP #VP] ``->`` [Cl #Cl] | //John walks here// | +| ``mkCl`` | [NP #NP] ``->`` [VP #VP] ``->`` [Cl #Cl] | //John always walks here// | +| ``mkCl`` | [N #N] ``->`` [Cl #Cl] | //there is a house// | +| ``mkCl`` | [CN #CN] ``->`` [Cl #Cl] | //there is an old house// | +| ``mkCl`` | [NP #NP] ``->`` [Cl #Cl] | //there are five houses// | +| ``mkCl`` | [NP #NP] ``->`` [RS #RS] ``->`` [Cl #Cl] | //it is John who walks// | +| ``mkCl`` | [Adv #Adv] ``->`` [S #S] ``->`` [Cl #Cl] | //it is here he walks// | | ``mkCl`` | [V #V] ``->`` [Cl #Cl] | //it rains// | | ``mkCl`` | [VP #VP] ``->`` [Cl #Cl] | //it is raining// | -| ``mkCl`` | [N #N] ``->`` [Cl #Cl] | //there is a house// | -| ``mkCl`` | [CN #CN] ``->`` [Cl #Cl] | //there is an old houses// | -| ``mkCl`` | [NP #NP] ``->`` [Cl #Cl] | //there are five houses// | -| ``mkCl`` | [NP #NP] ``->`` [RS #RS] ``->`` [Cl #Cl] | //it is John that walks// | -| ``mkCl`` | [Adv #Adv] ``->`` [S #S] ``->`` [Cl #Cl] | //it is here John walks// | +| ``mkCl`` | [SC #SC] ``->`` [VP #VP] ``->`` [Cl #Cl] | //mkCl// | ==ClSlash==[ClSlash] || Function | Type | Example || -| ``mkClSlash`` | [NP #NP] ``->`` [V2 #V2] ``->`` [ClSlash #ClSlash] | //(whom) John loves// | -| ``mkClSlash`` | [NP #NP] ``->`` [VV #VV] ``->`` [V2 #V2] ``->`` [ClSlash #ClSlash] | //(whom) John wants to see// | -| ``mkClSlash`` | [Cl #Cl] ``->`` [Prep #Prep] ``->`` [ClSlash #ClSlash] | //(with whom) John walks// | -| ``mkClSlash`` | [ClSlash #ClSlash] ``->`` [Adv #Adv] ``->`` [ClSlash #ClSlash] | //(whom) John loves today// | +| ``mkClSlash`` | [NP #NP] ``->`` [VPSlash #VPSlash] ``->`` [ClSlash #ClSlash] | //(whom) he sees here// | +| ``mkClSlash`` | [NP #NP] ``->`` [V2 #V2] ``->`` [ClSlash #ClSlash] | //(whom) he sees// | +| ``mkClSlash`` | [NP #NP] ``->`` [VV #VV] ``->`` [V2 #V2] ``->`` [ClSlash #ClSlash] | //(whom) he wants to see// | +| ``mkClSlash`` | [Cl #Cl] ``->`` [Prep #Prep] ``->`` [ClSlash #ClSlash] | //(with whom) he walks// | +| ``mkClSlash`` | [ClSlash #ClSlash] ``->`` [Adv #Adv] ``->`` [ClSlash #ClSlash] | //(whom) he sees tomorrow// | +| ``mkClSlash`` | [NP #NP] ``->`` [VS #VS] ``->`` [SSlash #SSlash] ``->`` [ClSlash #ClSlash] | //(whom) she says that he loves// | ==Comp - complement of copula, such as AP==[Comp] -Lexical category, constructors given in -[lexical paradigms #RParadigms]. +|| Function | Type | Example || +| ``mkComp`` | [AP #AP] ``->`` [Comp #Comp] | //very old// | +| ``mkComp`` | [NP #NP] ``->`` [Comp #Comp] | //this man// | +| ``mkComp`` | [Adv #Adv] ``->`` [Comp #Comp] | //here// | ==Conj - conjunction==[Conj] || Function | Type | Example || | ``and_Conj`` | [Conj #Conj] | //and// | @@ -305,20 +312,20 @@ Lexical category, constructors given in | ``few_Det`` | [Det #Det] | //few// | | ``many_Det`` | [Det #Det] | //many// | | ``mkDet`` | [Quant #Quant] ``->`` [Det #Det] | //this// | -| ``mkDet`` | [Quant #Quant] ``->`` ([Ord #Ord]) ``->`` [Det #Det] | //this first// | -| ``mkDet`` | [Quant #Quant] ``->`` [Num #Num] ``->`` [Det #Det] | //these// | -| ``mkDet`` | [Quant #Quant] ``->`` [Num #Num] ``->`` ([Ord #Ord]) ``->`` [Det #Det] | //these five best// | -| ``mkDet`` | [Quant #Quant] ``->`` [Det #Det] | //this// | +| ``mkDet`` | [Quant #Quant] ``->`` [Card #Card] ``->`` [Det #Det] | //these five// | +| ``mkDet`` | [Quant #Quant] ``->`` [Ord #Ord] ``->`` [Det #Det] | //the best// | +| ``mkDet`` | [Quant #Quant] ``->`` [Num #Num] ``->`` [Ord #Ord] ``->`` [Det #Det] | //these five best// | | ``mkDet`` | [Quant #Quant] ``->`` [Num #Num] ``->`` [Det #Det] | //these five// | -| ``mkDet`` | [Card #Card] ``->`` [Det #Det] | //almost twenty// | -| ``mkDet`` | [Numeral #Numeral] ``->`` [Det #Det] | //five// | +| ``mkDet`` | [Card #Card] ``->`` [Det #Det] | //forty// | | ``mkDet`` | [Digits #Digits] ``->`` [Det #Det] | //51// | -| ``mkDet`` | [Pron #Pron] ``->`` [Det #Det] | //my (house)// | -| ``mkDet`` | [Pron #Pron] ``->`` [Num #Num] ``->`` [Det #Det] | //my (houses)// | +| ``mkDet`` | [Numeral #Numeral] ``->`` [Det #Det] | //five// | +| ``mkDet`` | [Pron #Pron] ``->`` [Det #Det] | //my// | +| ``mkDet`` | [Pron #Pron] ``->`` [Num #Num] ``->`` [Det #Det] | //my five// | | ``much_Det`` | [Det #Det] | //much// | | ``somePl_Det`` | [Det #Det] | //somePl// | | ``someSg_Det`` | [Det #Det] | //someSg// | | ``thePl_Det`` | [Det #Det] | //the (houses)// | +| ``theSg_Det`` | [Det #Det] | //the (houses)// | | ``the_Det`` | [Det #Det] | //the (house)// | ==Dig==[Dig] || Function | Type | Example || @@ -334,21 +341,9 @@ Lexical category, constructors given in | ``n9_Dig`` | [Dig #Dig] | //9// | ==Digits - cardinal or ordinal in digits==[Digits] || Function | Type | Example || -| ``mkDigits`` | [Dig #Dig] ``->`` [Digits #Digits] | //8// | -| ``mkDigits`` | [Dig #Dig] ``->`` [Digits #Digits] ``->`` [Digits #Digits] | //876// | -| ``n1000_Digits`` | [Digits #Digits] | //1,000// | -| ``n100_Digits`` | [Digits #Digits] | //100// | -| ``n10_Digits`` | [Digits #Digits] | //10// | -| ``n1_Digits`` | [Digits #Digits] | //1// | -| ``n20_Digits`` | [Digits #Digits] | //20// | -| ``n2_Digits`` | [Digits #Digits] | //2// | -| ``n3_Digits`` | [Digits #Digits] | //3// | -| ``n4_Digits`` | [Digits #Digits] | //4// | -| ``n5_Digits`` | [Digits #Digits] | //5// | -| ``n6_Digits`` | [Digits #Digits] | //6// | -| ``n7_Digits`` | [Digits #Digits] | //7// | -| ``n8_Digits`` | [Digits #Digits] | //8// | -| ``n9_Digits`` | [Digits #Digits] | //9// | +| ``mkDigits`` | ``Str`` ``->`` [Digits #Digits] | //35 (from string "35")// | +| ``mkDigits`` | [Dig #Dig] ``->`` [Digits #Digits] | //4// | +| ``mkDigits`` | [Dig #Dig] ``->`` [Digits #Digits] ``->`` [Digits #Digits] | //1,233,432// | ==IAdv - interrogative adverb==[IAdv] || Function | Type | Example || | ``how8much_IAdv`` | [IAdv #IAdv] | //how8much// | @@ -364,51 +359,61 @@ Lexical category, constructors given in ==IDet - interrogative determiner==[IDet] || Function | Type | Example || | ``how8many_IDet`` | [IDet #IDet] | //how8many// | +| ``mkIDet`` | [IQuant #IQuant] ``->`` [Num #Num] ``->`` [IDet #IDet] | //which (songs)// | +| ``mkIDet`` | [IQuant #IQuant] ``->`` [IDet #IDet] | //mkIDet// | +| ``whichPl_IDet`` | [IDet #IDet] | //whichPl// | +| ``which_IDet`` | [IDet #IDet] | //which// | ==IP - interrogative pronoun==[IP] || Function | Type | Example || +| ``mkIP`` | [IDet #IDet] ``->`` [CN #CN] ``->`` [IP #IP] | //which five big cities// | +| ``mkIP`` | [IDet #IDet] ``->`` [N #N] ``->`` [IP #IP] | //which five cities// | +| ``mkIP`` | [IDet #IDet] ``->`` [IP #IP] | //which five// | +| ``mkIP`` | [IQuant #IQuant] ``->`` [CN #CN] ``->`` [IP #IP] | //which big cities// | +| ``mkIP`` | [IQuant #IQuant] ``->`` [Num #Num] ``->`` [CN #CN] ``->`` [IP #IP] | //which five cities// | | ``mkIP`` | [IQuant #IQuant] ``->`` [N #N] ``->`` [IP #IP] | //which city// | -| ``mkIP`` | [IQuant #IQuant] ``->`` ([Num #Num]) ``->`` [CN #CN] ``->`` [IP #IP] | //which five big cities// | | ``mkIP`` | [IP #IP] ``->`` [Adv #Adv] ``->`` [IP #IP] | //who in Paris// | | ``whatPl_IP`` | [IP #IP] | //what (plural)// | | ``whatSg_IP`` | [IP #IP] | //what (singular)// | +| ``what_IP`` | [IP #IP] | //what (singular)// | | ``whoPl_IP`` | [IP #IP] | //who (plural)// | | ``whoSg_IP`` | [IP #IP] | //who (singular)// | +| ``who_IP`` | [IP #IP] | //who (singular)// | ==IQuant==[IQuant] || Function | Type | Example || | ``which_IQuant`` | [IQuant #IQuant] | //which// | ==Imp - imperative==[Imp] || Function | Type | Example || -| ``mkImp`` | [V #V] ``->`` [Imp #Imp] | //go// | -| ``mkImp`` | [V2 #V2] ``->`` [NP #NP] ``->`` [Imp #Imp] | //take it// | -| ``mkImp`` | [VP #VP] ``->`` [Imp #Imp] | //go there now// | +| ``mkImp`` | [VP #VP] ``->`` [Imp #Imp] | //go// | +| ``mkImp`` | [V #V] ``->`` [Imp #Imp] | //take it// | +| ``mkImp`` | [V2 #V2] ``->`` [NP #NP] ``->`` [Imp #Imp] | //come here now// | ==ImpForm==[ImpForm] || Function | Type | Example || -| ``pluralImpForm`` | [ImpForm #ImpForm] | //(help yourselves)// | -| ``politeImpForm`` | [ImpForm #ImpForm] | //(help yourself) (polite singular)// | -| ``singularImpForm`` | [ImpForm #ImpForm] | //(help yourself) [default]// | +| ``pluralImpForm`` | [ImpForm #ImpForm] | //help yourselves// | +| ``politeImpForm`` | [ImpForm #ImpForm] | //help yourself [polite singular]// | +| ``singularImpForm`` | [ImpForm #ImpForm] | //help yourself [default]// | ==Interj - interjection==[Interj] Lexical category, constructors given in [lexical paradigms #RParadigms]. ==ListAP==[ListAP] || Function | Type | Example || -| ``mkListAP`` | [AP #AP] ``->`` [AP #AP] ``->`` [ListAP #ListAP] | //old, big// | -| ``mkListAP`` | [AP #AP] ``->`` [ListAP #ListAP] ``->`` [ListAP #ListAP] | //old, big, warm// | +| ``mkListAP`` | [AP #AP] ``->`` [AP #AP] ``->`` [ListAP #ListAP] | //mkListAP// | +| ``mkListAP`` | [AP #AP] ``->`` [ListAP #ListAP] ``->`` [ListAP #ListAP] | //mkListAP// | ==ListAdv==[ListAdv] || Function | Type | Example || -| ``mkListAdv`` | [Adv #Adv] ``->`` [Adv #Adv] ``->`` [ListAdv #ListAdv] | //here, now// | -| ``mkListAdv`` | [Adv #Adv] ``->`` [ListAdv #ListAdv] ``->`` [ListAdv #ListAdv] | //to me, here, now// | +| ``mkListAdv`` | [Adv #Adv] ``->`` [Adv #Adv] ``->`` [ListAdv #ListAdv] | //mkListAdv// | +| ``mkListAdv`` | [Adv #Adv] ``->`` [ListAdv #ListAdv] ``->`` [ListAdv #ListAdv] | //mkListAdv// | ==ListNP==[ListNP] || Function | Type | Example || -| ``mkListNP`` | [NP #NP] ``->`` [NP #NP] ``->`` [ListNP #ListNP] | //John, I// | -| ``mkListNP`` | [NP #NP] ``->`` [ListNP #ListNP] ``->`` [ListNP #ListNP] | //John, I, that// | +| ``mkListNP`` | [NP #NP] ``->`` [NP #NP] ``->`` [ListNP #ListNP] | //mkListNP// | +| ``mkListNP`` | [NP #NP] ``->`` [ListNP #ListNP] ``->`` [ListNP #ListNP] | //mkListNP// | ==ListRS==[ListRS] || Function | Type | Example || -| ``mkListRS`` | [RS #RS] ``->`` [RS #RS] ``->`` [ListRS #ListRS] | //who walks, who runs// | -| ``mkListRS`` | [RS #RS] ``->`` [ListRS #ListRS] ``->`` [ListRS #ListRS] | //who walks, who runs, who sleeps// | +| ``mkListRS`` | [RS #RS] ``->`` [RS #RS] ``->`` [ListRS #ListRS] | //mkListRS// | +| ``mkListRS`` | [RS #RS] ``->`` [ListRS #ListRS] ``->`` [ListRS #ListRS] | //mkListRS// | ==ListS==[ListS] || Function | Type | Example || -| ``mkListS`` | [S #S] ``->`` [S #S] ``->`` [ListS #ListS] | //he walks, I run// | -| ``mkListS`` | [S #S] ``->`` [ListS #ListS] ``->`` [ListS #ListS] | //John walks, I run, you sleep// | +| ``mkListS`` | [S #S] ``->`` [S #S] ``->`` [ListS #ListS] | //mkListS// | +| ``mkListS`` | [S #S] ``->`` [ListS #ListS] ``->`` [ListS #ListS] | //mkListS// | ==N - common noun==[N] Lexical category, constructors given in [lexical paradigms #RParadigms]. @@ -422,30 +427,33 @@ Lexical category, constructors given in || Function | Type | Example || | ``everybody_NP`` | [NP #NP] | //everybody// | | ``everything_NP`` | [NP #NP] | //everything// | -| ``mkNP`` | [Quant #Quant] ``->`` [N #N] ``->`` [NP #NP] | //this men// | -| ``mkNP`` | [Quant #Quant] ``->`` ([Num #Num]) ``->`` [CN #CN] ``->`` [NP #NP] | //these five old men// | -| ``mkNP`` | [Det #Det] ``->`` [N #N] ``->`` [NP #NP] | //the first man// | +| ``mkNP`` | [Quant #Quant] ``->`` [N #N] ``->`` [NP #NP] | //this man// | +| ``mkNP`` | [Quant #Quant] ``->`` [CN #CN] ``->`` [NP #NP] | //this old man// | +| ``mkNP`` | [Quant #Quant] ``->`` [Num #Num] ``->`` [CN #CN] ``->`` [NP #NP] | //these five old men// | +| ``mkNP`` | [Quant #Quant] ``->`` [Num #Num] ``->`` [N #N] ``->`` [NP #NP] | //these five men// | | ``mkNP`` | [Det #Det] ``->`` [CN #CN] ``->`` [NP #NP] | //the first old man// | -| ``mkNP`` | [Numeral #Numeral] ``->`` [N #N] ``->`` [NP #NP] | //twenty men// | -| ``mkNP`` | [Numeral #Numeral] ``->`` [CN #CN] ``->`` [NP #NP] | //twenty old men// | -| ``mkNP`` | [Digits #Digits] ``->`` [N #N] ``->`` [NP #NP] | //45 men// | -| ``mkNP`` | [Digits #Digits] ``->`` [CN #CN] ``->`` [NP #NP] | //45 old men// | -| ``mkNP`` | [Card #Card] ``->`` [N #N] ``->`` [NP #NP] | //almost twenty men// | -| ``mkNP`` | [Card #Card] ``->`` [CN #CN] ``->`` [NP #NP] | //almost twenty old men// | -| ``mkNP`` | [Pron #Pron] ``->`` [N #N] ``->`` [NP #NP] | //my man// | +| ``mkNP`` | [Det #Det] ``->`` [N #N] ``->`` [NP #NP] | //the first man// | +| ``mkNP`` | [Numeral #Numeral] ``->`` [CN #CN] ``->`` [NP #NP] | //fifty old men// | +| ``mkNP`` | [Numeral #Numeral] ``->`` [N #N] ``->`` [NP #NP] | //fifty men// | +| ``mkNP`` | [Digits #Digits] ``->`` [CN #CN] ``->`` [NP #NP] | //51 old men// | +| ``mkNP`` | [Digits #Digits] ``->`` [N #N] ``->`` [NP #NP] | //51 men// | +| ``mkNP`` | [Card #Card] ``->`` [CN #CN] ``->`` [NP #NP] | //forty-five old men// | +| ``mkNP`` | [Card #Card] ``->`` [N #N] ``->`` [NP #NP] | //forty-five men// | | ``mkNP`` | [Pron #Pron] ``->`` [CN #CN] ``->`` [NP #NP] | //my old man// | +| ``mkNP`` | [Pron #Pron] ``->`` [N #N] ``->`` [NP #NP] | //my man// | | ``mkNP`` | [PN #PN] ``->`` [NP #NP] | //John// | | ``mkNP`` | [Pron #Pron] ``->`` [NP #NP] | //he// | | ``mkNP`` | [Quant #Quant] ``->`` [NP #NP] | //this// | -| ``mkNP`` | [Det #Det] ``->`` [NP #NP] | //these five// | +| ``mkNP`` | [Quant #Quant] ``->`` [Num #Num] ``->`` [NP #NP] | //these five// | +| ``mkNP`` | [Det #Det] ``->`` [NP #NP] | //these five best// | +| ``mkNP`` | [CN #CN] ``->`` [NP #NP] | //old beer// | | ``mkNP`` | [N #N] ``->`` [NP #NP] | //beer// | -| ``mkNP`` | [CN #CN] ``->`` [NP #NP] | //beer// | -| ``mkNP`` | [Predet #Predet] ``->`` [NP #NP] ``->`` [NP #NP] | //only John// | -| ``mkNP`` | [NP #NP] ``->`` [V2 #V2] ``->`` [NP #NP] | //John killed// | -| ``mkNP`` | [NP #NP] ``->`` [Adv #Adv] ``->`` [NP #NP] | //John in Paris// | +| ``mkNP`` | [Predet #Predet] ``->`` [NP #NP] ``->`` [NP #NP] | //only the man// | +| ``mkNP`` | [NP #NP] ``->`` [V2 #V2] ``->`` [NP #NP] | //the man seen// | +| ``mkNP`` | [NP #NP] ``->`` [Adv #Adv] ``->`` [NP #NP] | //Paris today// | | ``mkNP`` | [NP #NP] ``->`` [RS #RS] ``->`` [NP #NP] | //John, who lives in Paris// | -| ``mkNP`` | [Conj #Conj] ``->`` [NP #NP] ``->`` [NP #NP] ``->`` [NP #NP] | //John and I// | -| ``mkNP`` | [Conj #Conj] ``->`` [ListNP #ListNP] ``->`` [NP #NP] | //John, I, and that// | +| ``mkNP`` | [Conj #Conj] ``->`` [NP #NP] ``->`` [NP #NP] ``->`` [NP #NP] | //mkNP// | +| ``mkNP`` | [Conj #Conj] ``->`` [ListNP #ListNP] ``->`` [NP #NP] | //mkNP// | | ``nobody_NP`` | [NP #NP] | //nobody// | | ``nothing_NP`` | [NP #NP] | //nothing// | | ``somebody_NP`` | [NP #NP] | //somebody// | @@ -454,32 +462,24 @@ Lexical category, constructors given in || Function | Type | Example || | ``mkNum`` | ``Str`` ``->`` [Num #Num] | //thirty-five (given by "35")// | | ``mkNum`` | [Numeral #Numeral] ``->`` [Num #Num] | //twenty// | -| ``mkNum`` | [Digits #Digits] ``->`` [Num #Num] | //51// | +| ``mkNum`` | [Digits #Digits] ``->`` [Num #Num] | //21// | +| ``mkNum`` | [Digit #Digit] ``->`` [Num #Num] | //five// | | ``mkNum`` | [Card #Card] ``->`` [Num #Num] | //almost ten// | | ``mkNum`` | [AdN #AdN] ``->`` [Card #Card] ``->`` [Num #Num] | //almost ten// | -| ``plNum`` | [Num #Num] | //plural// | -| ``sgNum`` | [Num #Num] | //singular// | +| ``pluralNum`` | [Num #Num] | //plural// | +| ``singularNum`` | [Num #Num] | //singular// | ==Numeral - cardinal or ordinal in words==[Numeral] || Function | Type | Example || +| ``mkNumeral`` | [Sub1000 #Sub1000] ``->`` [Numeral #Numeral] | //coerce 1..999// | +| ``mkNumeral`` | [Sub1000 #Sub1000] ``->`` [Sub1000 #Sub1000] ``->`` [Numeral #Numeral] | //1000m + n// | | ``mkNumeral`` | ``Str`` ``->`` [Numeral #Numeral] | //thirty-five (given by "35")// | -| ``n1000_Numeral`` | [Numeral #Numeral] | //thousand// | -| ``n100_Numeral`` | [Numeral #Numeral] | //hundred// | -| ``n10_Numeral`` | [Numeral #Numeral] | //ten// | -| ``n1_Numeral`` | [Numeral #Numeral] | //one// | -| ``n20_Numeral`` | [Numeral #Numeral] | //twenty// | -| ``n2_Numeral`` | [Numeral #Numeral] | //two// | -| ``n3_Numeral`` | [Numeral #Numeral] | //three// | -| ``n4_Numeral`` | [Numeral #Numeral] | //four// | -| ``n5_Numeral`` | [Numeral #Numeral] | //five// | -| ``n6_Numeral`` | [Numeral #Numeral] | //six// | -| ``n7_Numeral`` | [Numeral #Numeral] | //seven// | -| ``n8_Numeral`` | [Numeral #Numeral] | //eight// | -| ``n9_Numeral`` | [Numeral #Numeral] | //nine// | +| ``thousandfoldNumeral`` | [Sub1000 #Sub1000] ``->`` [Numeral #Numeral] | //1000n// | ==Ord - ordinal number (used in Det)==[Ord] || Function | Type | Example || | ``mkOrd`` | [Numeral #Numeral] ``->`` [Ord #Ord] | //twentieth// | | ``mkOrd`` | [Digits #Digits] ``->`` [Ord #Ord] | //51st// | -| ``mkOrd`` | [A #A] ``->`` [Ord #Ord] | //best// | +| ``mkOrd`` | [Digit #Digit] ``->`` [Ord #Ord] | //fifth// | +| ``mkOrd`` | [A #A] ``->`` [Ord #Ord] | //largest// | ==PConj - phrase-beginning conjunction==[PConj] || Function | Type | Example || | ``but_PConj`` | [PConj #PConj] | //but// | @@ -491,16 +491,15 @@ Lexical category, constructors given in [lexical paradigms #RParadigms]. ==Phr - phrase in a text==[Phr] || Function | Type | Example || -| ``mkPhr`` | [Utt #Utt] ``->`` [Phr #Phr] | //why// | -| ``mkPhr`` | ([PConj #PConj]) ``->`` [Utt #Utt] ``->`` ([Voc #Voc]) ``->`` [Phr #Phr] | //but why John// | -| ``mkPhr`` | [S #S] ``->`` [Phr #Phr] | //John walked// | -| ``mkPhr`` | [Cl #Cl] ``->`` [Phr #Phr] | //John walks// | -| ``mkPhr`` | [QS #QS] ``->`` [Phr #Phr] | //did John walk// | -| ``mkPhr`` | [Imp #Imp] ``->`` [Phr #Phr] | //walk// | +| ``mkPhr`` | ([PConj #PConj]) ``->`` [Utt #Utt] ``->`` ([Voc #Voc]) ``->`` [Phr #Phr] | //but come here John// | +| ``mkPhr`` | [S #S] ``->`` [Phr #Phr] | //I go home// | +| ``mkPhr`` | [Cl #Cl] ``->`` [Phr #Phr] | //I go home// | +| ``mkPhr`` | [QS #QS] ``->`` [Phr #Phr] | //I go home// | +| ``mkPhr`` | [Imp #Imp] ``->`` [Phr #Phr] | //I go home// | ==Pol - polarity==[Pol] || Function | Type | Example || -| ``negativePol`` | [Pol #Pol] | //(John doesn't walk)// | -| ``positivePol`` | [Pol #Pol] | //(John walks) [default]// | +| ``negativePol`` | [Pol #Pol] | //John doesn't walk// | +| ``positivePol`` | [Pol #Pol] | //John walks [default]// | ==Predet - predeterminer (prefixed Quant)==[Predet] || Function | Type | Example || | ``all_Predet`` | [Predet #Predet] | //all// | @@ -550,18 +549,36 @@ Lexical category, constructors given in || Function | Type | Example || | ``mkQCl`` | [Cl #Cl] ``->`` [QCl #QCl] | //does John walk// | | ``mkQCl`` | [IP #IP] ``->`` [VP #VP] ``->`` [QCl #QCl] | //who walks// | -| ``mkQCl`` | [IP #IP] ``->`` [NP #NP] ``->`` [V2 #V2] ``->`` [QCl #QCl] | //whom does John love// | -| ``mkQCl`` | [IP #IP] ``->`` [ClSlash #ClSlash] ``->`` [QCl #QCl] | //whom does John love today// | +| ``mkQCl`` | [IP #IP] ``->`` [V #V] ``->`` [QCl #QCl] | //who walks// | +| ``mkQCl`` | [IP #IP] ``->`` [V2 #V2] ``->`` [NP #NP] ``->`` [QCl #QCl] | //who loves her// | +| ``mkQCl`` | [IP #IP] ``->`` [V3 #V3] ``->`` [NP #NP] ``->`` [NP #NP] ``->`` [QCl #QCl] | //who sends it to her// | +| ``mkQCl`` | [IP #IP] ``->`` [VV #VV] ``->`` [VP #VP] ``->`` [QCl #QCl] | //who wants to walk// | +| ``mkQCl`` | [IP #IP] ``->`` [VS #VS] ``->`` [S #S] ``->`` [QCl #QCl] | //who says that she walks// | +| ``mkQCl`` | [IP #IP] ``->`` [VQ #VQ] ``->`` [QS #QS] ``->`` [QCl #QCl] | //who wonders who walks// | +| ``mkQCl`` | [IP #IP] ``->`` [VA #VA] ``->`` [AP #AP] ``->`` [QCl #QCl] | //who becomes old// | +| ``mkQCl`` | [IP #IP] ``->`` [V2A #V2A] ``->`` [NP #NP] ``->`` [AP #AP] ``->`` [QCl #QCl] | //who paints it red// | +| ``mkQCl`` | [IP #IP] ``->`` [V2S #V2S] ``->`` [NP #NP] ``->`` [S #S] ``->`` [QCl #QCl] | //who tells her that we walk// | +| ``mkQCl`` | [IP #IP] ``->`` [V2Q #V2Q] ``->`` [NP #NP] ``->`` [QS #QS] ``->`` [QCl #QCl] | //who asks her who walks// | +| ``mkQCl`` | [IP #IP] ``->`` [V2V #V2V] ``->`` [NP #NP] ``->`` [VP #VP] ``->`` [QCl #QCl] | //who forces her to walk// | +| ``mkQCl`` | [IP #IP] ``->`` [A #A] ``->`` [QCl #QCl] | //who is old// | +| ``mkQCl`` | [IP #IP] ``->`` [A #A] ``->`` [NP #NP] ``->`` [QCl #QCl] | //who is older than her// | +| ``mkQCl`` | [IP #IP] ``->`` [A2 #A2] ``->`` [NP #NP] ``->`` [QCl #QCl] | //who is married to her// | +| ``mkQCl`` | [IP #IP] ``->`` [AP #AP] ``->`` [QCl #QCl] | //who is very old// | +| ``mkQCl`` | [IP #IP] ``->`` [NP #NP] ``->`` [QCl #QCl] | //who is the man// | +| ``mkQCl`` | [IP #IP] ``->`` [N #N] ``->`` [QCl #QCl] | //who is a man// | +| ``mkQCl`` | [IP #IP] ``->`` [CN #CN] ``->`` [QCl #QCl] | //who is an old man// | +| ``mkQCl`` | [IP #IP] ``->`` [Adv #Adv] ``->`` [QCl #QCl] | //who is here// | +| ``mkQCl`` | [IP #IP] ``->`` [NP #NP] ``->`` [V2 #V2] ``->`` [QCl #QCl] | //who does John love// | +| ``mkQCl`` | [IP #IP] ``->`` [ClSlash #ClSlash] ``->`` [QCl #QCl] | //who does John today// | | ``mkQCl`` | [IAdv #IAdv] ``->`` [Cl #Cl] ``->`` [QCl #QCl] | //why does John walk// | -| ``mkQCl`` | [Prep #Prep] ``->`` [IP #IP] ``->`` [Cl #Cl] ``->`` [QCl #QCl] | //with who does John walk// | +| ``mkQCl`` | [Prep #Prep] ``->`` [IP #IP] ``->`` [Cl #Cl] ``->`` [QCl #QCl] | //with whom does John walk// | | ``mkQCl`` | [IAdv #IAdv] ``->`` [NP #NP] ``->`` [QCl #QCl] | //where is John// | -| ``mkQCl`` | [IP #IP] ``->`` [QCl #QCl] | //what is there// | -| ``mkQCl`` | [IComp #IComp] ``->`` [NP #NP] ``->`` [QCl #QCl] | //who is John// | +| ``mkQCl`` | [IComp #IComp] ``->`` [NP #NP] ``->`` [QCl #QCl] | //who is this man// | +| ``mkQCl`` | [IP #IP] ``->`` [QCl #QCl] | //which houses are there// | ==QS - question==[QS] || Function | Type | Example || -| ``mkQS`` | [QCl #QCl] ``->`` [QS #QS] | //who walks// | | ``mkQS`` | ([Tense #Tense]) ``->`` ([Ant #Ant]) ``->`` ([Pol #Pol]) ``->`` [QCl #QCl] ``->`` [QS #QS] | //who wouldn't have walked// | -| ``mkQS`` | [Cl #Cl] ``->`` [QS #QS] | //does John walk// | +| ``mkQS`` | [Cl #Cl] ``->`` [QS #QS] | //mkQS// | ==Quant - quantifier ('nucleus' of Det)==[Quant] || Function | Type | Example || | ``a_Quant`` | [Quant #Quant] | //a// | @@ -572,9 +589,9 @@ Lexical category, constructors given in | ``this_Quant`` | [Quant #Quant] | //this// | ==RCl - relative clause, with all tenses==[RCl] || Function | Type | Example || -| ``mkRCl`` | [RP #RP] ``->`` [VP #VP] ``->`` [RCl #RCl] | //that walk// | -| ``mkRCl`` | [RP #RP] ``->`` [NP #NP] ``->`` [V2 #V2] ``->`` [RCl #RCl] | //which John loves// | -| ``mkRCl`` | [RP #RP] ``->`` [ClSlash #ClSlash] ``->`` [RCl #RCl] | //which John loves today// | +| ``mkRCl`` | [RP #RP] ``->`` [VP #VP] ``->`` [RCl #RCl] | //that loves John// | +| ``mkRCl`` | [RP #RP] ``->`` [ClSlash #ClSlash] ``->`` [RCl #RCl] | //whom John loves today// | +| ``mkRCl`` | [RP #RP] ``->`` [NP #NP] ``->`` [V2 #V2] ``->`` [RCl #RCl] | //whom John loves// | | ``mkRCl`` | [Cl #Cl] ``->`` [RCl #RCl] | //such that John loves her// | ==RP - relative pronoun==[RP] || Function | Type | Example || @@ -582,20 +599,33 @@ Lexical category, constructors given in | ``which_RP`` | [RP #RP] | //which// | ==RS - relative==[RS] || Function | Type | Example || -| ``mkRS`` | [RCl #RCl] ``->`` [RS #RS] | //that walk// | | ``mkRS`` | ([Tense #Tense]) ``->`` ([Ant #Ant]) ``->`` ([Pol #Pol]) ``->`` [RCl #RCl] ``->`` [RS #RS] | //that wouldn't have walked// | -| ``mkRS`` | [Conj #Conj] ``->`` [RS #RS] ``->`` [RS #RS] ``->`` [RS #RS] | //who walks and whom I know// | -| ``mkRS`` | [Conj #Conj] ``->`` [ListRS #ListRS] ``->`` [RS #RS] | //who walks, whose son runs, and whom I know// | +| ``mkRS`` | [Conj #Conj] ``->`` [RS #RS] ``->`` [RS #RS] ``->`` [RS #RS] | //who walks and whose mother runsx// | +| ``mkRS`` | [Conj #Conj] ``->`` [ListRS #ListRS] ``->`` [RS #RS] | //who walks, whom I see and who sleeps// | ==S - declarative sentence==[S] || Function | Type | Example || -| ``mkS`` | [Cl #Cl] ``->`` [S #S] | //John walks// | | ``mkS`` | ([Tense #Tense]) ``->`` ([Ant #Ant]) ``->`` ([Pol #Pol]) ``->`` [Cl #Cl] ``->`` [S #S] | //John wouldn't have walked// | | ``mkS`` | [Conj #Conj] ``->`` [S #S] ``->`` [S #S] ``->`` [S #S] | //John walks and I run// | | ``mkS`` | [Conj #Conj] ``->`` [ListS #ListS] ``->`` [S #S] | //John walks, I run and you sleep// | | ``mkS`` | [Adv #Adv] ``->`` [S #S] ``->`` [S #S] | //today, John walks// | ==SC - embedded sentence or question==[SC] -Lexical category, constructors given in -[lexical paradigms #RParadigms]. +|| Function | Type | Example || +| ``mkSC`` | [S #S] ``->`` [SC #SC] | //that he walks// | +| ``mkSC`` | [QS #QS] ``->`` [SC #SC] | //whether he walks// | +| ``mkSC`` | [VP #VP] ``->`` [SC #SC] | //to walk// | +==SSlash==[SSlash] +|| Function | Type | Example || +| ``mkSSlash`` | [Temp #Temp] ``->`` [Pol #Pol] ``->`` [ClSlash #ClSlash] ``->`` [SSlash #SSlash] | //mkSSlash// | +==Sub100==[Sub100] +|| Function | Type | Example || +| ``mkSub100`` | [Unit #Unit] ``->`` [Sub100 #Sub100] | //coerce 1..9// | +| ``mkSub100`` | [Unit #Unit] ``->`` [Unit #Unit] ``->`` [Sub100 #Sub100] | //10m + n// | +| ``tenfoldSub100`` | [Unit #Unit] ``->`` [Sub100 #Sub100] | //10n// | +==Sub1000==[Sub1000] +|| Function | Type | Example || +| ``mkSub1000`` | [Sub100 #Sub100] ``->`` [Sub1000 #Sub1000] | //coerce 1..99// | +| ``mkSub1000`` | [Sub10 #Sub10] ``->`` [Sub1000 #Sub1000] | //100n// | +| ``mkSub1000`` | [Sub10 #Sub10] ``->`` [Sub100 #Sub100] ``->`` [Sub1000 #Sub1000] | //100m + n// | ==Subj - subjunction==[Subj] || Function | Type | Example || | ``although_Subj`` | [Subj #Subj] | //although// | @@ -608,21 +638,31 @@ Lexical category, constructors given in [lexical paradigms #RParadigms]. ==Tense - tense==[Tense] || Function | Type | Example || -| ``conditionalTense`` | [Tense #Tense] | //(John would walk)// | -| ``futureTense`` | [Tense #Tense] | //(John will walk)// | -| ``pastTense`` | [Tense #Tense] | //(John walked)// | -| ``presentTense`` | [Tense #Tense] | //(John walks) [default]// | +| ``conditionalTense`` | [Tense #Tense] | //John would walk// | +| ``futureTense`` | [Tense #Tense] | //John will walk// | +| ``pastTense`` | [Tense #Tense] | //John walked// | +| ``presentTense`` | [Tense #Tense] | //John walks [default]// | ==Text - text consisting of several phrases==[Text] || Function | Type | Example || | ``emptyText`` | [Text #Text] | //(empty text)// | -| ``mkText`` | [Phr #Phr] ``->`` [Text #Text] | //But John walks.// | | ``mkText`` | [Phr #Phr] ``->`` ([Punct #Punct]) ``->`` ([Text #Text]) ``->`` [Text #Text] | //John walks? Yes.// | -| ``mkText`` | [Utt #Utt] ``->`` [Text #Text] | //John.// | +| ``mkText`` | [Utt #Utt] ``->`` [Text #Text] | //Yes.// | | ``mkText`` | [S #S] ``->`` [Text #Text] | //John walked.// | | ``mkText`` | [Cl #Cl] ``->`` [Text #Text] | //John walks.// | | ``mkText`` | [QS #QS] ``->`` [Text #Text] | //Did John walk?// | -| ``mkText`` | [Imp #Imp] ``->`` [Text #Text] | //Walk!// | +| ``mkText`` | ([Pol #Pol]) ``->`` [Imp #Imp] ``->`` [Text #Text] | //Walk!// | | ``mkText`` | [Text #Text] ``->`` [Text #Text] ``->`` [Text #Text] | //Where? When? Here. Now!// | +==Unit==[Unit] +|| Function | Type | Example || +| ``n1_Unit`` | [Unit #Unit] | //one// | +| ``n2_Unit`` | [Unit #Unit] | //two// | +| ``n3_Unit`` | [Unit #Unit] | //three// | +| ``n4_Unit`` | [Unit #Unit] | //four// | +| ``n5_Unit`` | [Unit #Unit] | //five// | +| ``n6_Unit`` | [Unit #Unit] | //six// | +| ``n7_Unit`` | [Unit #Unit] | //seven// | +| ``n8_Unit`` | [Unit #Unit] | //eight// | +| ``n9_Unit`` | [Unit #Unit] | //nine// | ==Utt - sentence, question, word...==[Utt] || Function | Type | Example || | ``lets_Utt`` | [VP #VP] ``->`` [Utt #Utt] | //let's walk// | @@ -630,15 +670,14 @@ Lexical category, constructors given in | ``mkUtt`` | [Cl #Cl] ``->`` [Utt #Utt] | //John walks// | | ``mkUtt`` | [QS #QS] ``->`` [Utt #Utt] | //did John walk// | | ``mkUtt`` | [QCl #QCl] ``->`` [Utt #Utt] | //does John walk// | -| ``mkUtt`` | [Imp #Imp] ``->`` [Utt #Utt] | //love yourself// | | ``mkUtt`` | ([ImpForm #ImpForm]) ``->`` ([Pol #Pol]) ``->`` [Imp #Imp] ``->`` [Utt #Utt] | //don't love yourselves// | | ``mkUtt`` | [IP #IP] ``->`` [Utt #Utt] | //who// | | ``mkUtt`` | [IAdv #IAdv] ``->`` [Utt #Utt] | //why// | -| ``mkUtt`` | [NP #NP] ``->`` [Utt #Utt] | //John// | +| ``mkUtt`` | [NP #NP] ``->`` [Utt #Utt] | //this man// | | ``mkUtt`` | [Adv #Adv] ``->`` [Utt #Utt] | //here// | -| ``mkUtt`` | [VP #VP] ``->`` [Utt #Utt] | //to walk// | +| ``mkUtt`` | [VP #VP] ``->`` [Utt #Utt] | //to sleep// | | ``mkUtt`` | [CN #CN] ``->`` [Utt #Utt] | //beer// | -| ``mkUtt`` | [AP #AP] ``->`` [Utt #Utt] | //fine// | +| ``mkUtt`` | [AP #AP] ``->`` [Utt #Utt] | //good// | | ``mkUtt`` | [Card #Card] ``->`` [Utt #Utt] | //five// | | ``no_Utt`` | [Utt #Utt] | //no// | | ``yes_Utt`` | [Utt #Utt] | //yes// | @@ -668,26 +707,30 @@ Lexical category, constructors given in [lexical paradigms #RParadigms]. ==VP - verb phrase==[VP] || Function | Type | Example || -| ``mkVP`` | [V #V] ``->`` [VP #VP] | //walk// | -| ``mkVP`` | [V2 #V2] ``->`` [NP #NP] ``->`` [VP #VP] | //love her// | -| ``mkVP`` | [V3 #V3] ``->`` [NP #NP] ``->`` [NP #NP] ``->`` [VP #VP] | //send it to her// | -| ``mkVP`` | [VV #VV] ``->`` [VP #VP] ``->`` [VP #VP] | //want to walk// | -| ``mkVP`` | [VS #VS] ``->`` [S #S] ``->`` [VP #VP] | //know that she walks// | -| ``mkVP`` | [VQ #VQ] ``->`` [QS #QS] ``->`` [VP #VP] | //ask if she walks// | -| ``mkVP`` | [VA #VA] ``->`` [AP #AP] ``->`` [VP #VP] | //become old// | +| ``mkVP`` | [V #V] ``->`` [VP #VP] | //sleep// | +| ``mkVP`` | [V2 #V2] ``->`` [NP #NP] ``->`` [VP #VP] | //love it// | +| ``mkVP`` | [V3 #V3] ``->`` [NP #NP] ``->`` [NP #NP] ``->`` [VP #VP] | //send a message to her// | +| ``mkVP`` | [VV #VV] ``->`` [VP #VP] ``->`` [VP #VP] | //want to run// | +| ``mkVP`` | [VS #VS] ``->`` [S #S] ``->`` [VP #VP] | //know that she runs// | +| ``mkVP`` | [VQ #VQ] ``->`` [QS #QS] ``->`` [VP #VP] | //wonder if she runs// | +| ``mkVP`` | [VA #VA] ``->`` [AP #AP] ``->`` [VP #VP] | //become red// | | ``mkVP`` | [V2A #V2A] ``->`` [NP #NP] ``->`` [AP #AP] ``->`` [VP #VP] | //paint it red// | +| ``mkVP`` | [V2S #V2S] ``->`` [NP #NP] ``->`` [S #S] ``->`` [VP #VP] | //tell her that we walk// | +| ``mkVP`` | [V2Q #V2Q] ``->`` [NP #NP] ``->`` [QS #QS] ``->`` [VP #VP] | //ask her who walks// | +| ``mkVP`` | [V2V #V2V] ``->`` [NP #NP] ``->`` [VP #VP] ``->`` [VP #VP] | //force her to walk// | | ``mkVP`` | [A #A] ``->`` [VP #VP] | //be warm// | -| ``mkVP`` | [AP #AP] ``->`` [VP #VP] | //be very warm// | | ``mkVP`` | [A #A] ``->`` [NP #NP] ``->`` [VP #VP] | //be older than her// | | ``mkVP`` | [A2 #A2] ``->`` [NP #NP] ``->`` [VP #VP] | //be married to her// | +| ``mkVP`` | [AP #AP] ``->`` [VP #VP] | //be warm// | | ``mkVP`` | [N #N] ``->`` [VP #VP] | //be a man// | | ``mkVP`` | [CN #CN] ``->`` [VP #VP] | //be an old man// | -| ``mkVP`` | [NP #NP] ``->`` [VP #VP] | //be the man// | +| ``mkVP`` | [NP #NP] ``->`` [VP #VP] | //be this man// | | ``mkVP`` | [Adv #Adv] ``->`` [VP #VP] | //be here// | | ``mkVP`` | [VP #VP] ``->`` [Adv #Adv] ``->`` [VP #VP] | //sleep here// | | ``mkVP`` | [AdV #AdV] ``->`` [VP #VP] ``->`` [VP #VP] | //always sleep// | | ``mkVP`` | [VPSlash #VPSlash] ``->`` [NP #NP] ``->`` [VP #VP] | //paint it black// | | ``mkVP`` | [VPSlash #VPSlash] ``->`` [VP #VP] | //paint itself black// | +| ``mkVP`` | [Comp #Comp] ``->`` [VP #VP] | //be warm// | | ``passiveVP`` | [V2 #V2] ``->`` [VP #VP] | //be loved// | | ``passiveVP`` | [V2 #V2] ``->`` [NP #NP] ``->`` [VP #VP] | //be loved by her// | | ``progressiveVP`` | [VP #VP] ``->`` [VP #VP] | //be sleeping// | @@ -700,6 +743,8 @@ Lexical category, constructors given in | ``mkVPSlash`` | [V2Q #V2Q] ``->`` [QS #QS] ``->`` [VPSlash #VPSlash] | //(whom) (John) asks who sleeps// | | ``mkVPSlash`` | [V2S #V2S] ``->`` [S #S] ``->`` [VPSlash #VPSlash] | //(whom) (John) tells that we sleep// | | ``mkVPSlash`` | [V2V #V2V] ``->`` [VP #VP] ``->`` [VPSlash #VPSlash] | //(whom) (John) forces to sleep// | +| ``mkVPSlash`` | [VV #VV] ``->`` [VPSlash #VPSlash] ``->`` [VPSlash #VPSlash] | //want always to buy// | +| ``mkVPSlash`` | [V2V #V2V] ``->`` [NP #NP] ``->`` [VPSlash #VPSlash] ``->`` [VPSlash #VPSlash] | //beg me always to buy// | ==VQ - question-complement verb==[VQ] Lexical category, constructors given in [lexical paradigms #RParadigms]. diff --git a/lib/src/Make.hs b/lib/src/Make.hs index 0acb94033..0d7026c33 100644 --- a/lib/src/Make.hs +++ b/lib/src/Make.hs @@ -28,6 +28,7 @@ presSymbolPath = "" -- "-path=.:abstract:present:common:romance:scandinavian" -- -- we also give the functors implied langsCoding = [ + (("amharic", "Amh"),""), (("arabic", "Ara"),""), (("bulgarian","Bul"),""), (("catalan", "Cat"),"Romance"), @@ -36,20 +37,21 @@ langsCoding = [ (("english", "Eng"),""), (("finnish", "Fin"),""), (("french", "Fre"),"Romance"), - (("hindi", "Hin"),""), + (("hindi", "Hin"),"Hindustani"), (("german", "Ger"),""), (("interlingua","Ina"),""), (("italian", "Ita"),"Romance"), (("latin", "Lat"),""), (("norwegian","Nor"),"Scand"), (("polish", "Pol"),""), + (("punjabi", "Pnb"),""), (("romanian", "Ron"),""), (("russian", "Rus"),""), (("spanish", "Spa"),"Romance"), (("swedish", "Swe"),"Scand"), (("thai", "Tha"),""), (("turkish", "Tur"),""), - (("urdu", "Urd"),"") + (("urdu", "Urd"),"Hindustani") ] implied (_,lan) = [fun | ((_,la),fun) <- langsCoding, la == lan, fun /= ""] @@ -63,7 +65,7 @@ langsLangAll = langs langsLang = langs `except` langsIncomplete ---- [] -- languages for which Lang can be compiled but which are incomplete -langsIncomplete = ["Ara","Hin","Lat","Tha","Tur"] +langsIncomplete = ["Amh","Ara","Hin","Lat","Pnb","Tha","Tur","Urd"] -- languages for which to compile Try langsAPI = langsLang `except` (langsIncomplete ++ ["Ina"]) @@ -149,13 +151,13 @@ make xx = do return () gfc pres ppath file = do - let preproc = if pres then "-preproc=./mkPresent" else "" + let preproc = if pres then "-preproc=mkPresent" else "" let path = if pres then ppath else "" putStrLn $ "Compiling " ++ file run_gfc ["-s","-src", preproc, path, file] gfcmin path file = do - let preproc = "-preproc=./mkMinimal" + let preproc = "-preproc=mkMinimal" putStrLn $ "Compiling minimal " ++ file run_gfc ["-s","-src", preproc, path, file] diff --git a/lib/src/api/Constructors.gf b/lib/src/api/Constructors.gf index c07bb0dd0..63494b2f0 100644 --- a/lib/src/api/Constructors.gf +++ b/lib/src/api/Constructors.gf @@ -1,9 +1,17 @@ --1 Constructors: the Resource Syntax API -incomplete resource Constructors = open Grammar in { +incomplete resource Constructors = open Grammar in { --% - flags optimize=noexpand ; + flags optimize=noexpand ; --% +-- For developers: this document is tagged to support GF-Doc and synopsis --% +-- generation: --% +-- --% ignore this line in documentation --% +-- --: this is a ground constructor --% +-- Moreover, follow the format --% +-- oper : Typ --% +-- = def ; --% --% +-- -- This module gives access to the syntactic constructions of the -- GF Resource Grammar library. Its main principle is simple: -- to construct an object of type $C$, use the function $mkC$. @@ -66,7 +74,7 @@ incomplete resource Constructors = open Grammar in { oper mkText = overload { --% - mkText : Phr -> (Punct) -> (Text) -> Text -- John walks? Yes. + mkText : Phr -> (Punct) -> (Text) -> Text -- John walks? Yes. --: = \phr,punct,text -> case punct of { --% PFullStop => TFullStop phr text ; --% PExclMark => TExclMark phr text ; --% @@ -108,18 +116,18 @@ incomplete resource Constructors = open Grammar in { -- A text can also be empty. - emptyText : Text -- (empty text) + emptyText : Text -- (empty text) --: = TEmpty ; --% --3 Punct: punctuation marks -- There are three punctuation marks that can separate phrases in a text. - fullStopPunct : Punct -- . + fullStopPunct : Punct -- . --: = PFullStop ; --% - questMarkPunct : Punct -- ? + questMarkPunct : Punct -- ? --: = PQuestMark ; --% - exclMarkPunct : Punct -- ! + exclMarkPunct : Punct -- ! --: = PExclMark ; --% -- Internally, they are handled with a parameter type. --% @@ -134,7 +142,7 @@ incomplete resource Constructors = open Grammar in { -- and a vocative, both of which are by default empty. mkPhr = overload { --% - mkPhr : (PConj) -> Utt -> (Voc) -> Phr -- but come here John + mkPhr : (PConj) -> Utt -> (Voc) -> Phr -- but come here John --: = PhrUtt ; --% mkPhr : Utt -> Voc -> Phr -- come here John --% = \u,v -> PhrUtt NoPConj u v ; --% @@ -162,7 +170,7 @@ incomplete resource Constructors = open Grammar in { -- Any conjunction can be used as a phrasal conjunction. -- More phrasal conjunctions are defined in $Structural$. - mkPConj : Conj -> PConj -- and + mkPConj : Conj -> PConj -- and --: = PConjConj ; --% noPConj : PConj --% = NoPConj ; --% @@ -173,7 +181,7 @@ incomplete resource Constructors = open Grammar in { -- Any noun phrase can be turned into a vocative. -- More vocatives are defined in $Structural$. - mkVoc : NP -> Voc -- John + mkVoc : NP -> Voc -- John --: = VocNP ; --% noVoc : Voc --% = NoVoc ; --% @@ -184,16 +192,16 @@ incomplete resource Constructors = open Grammar in { -- Utterances are formed from sentences, clauses, questions, and imperatives. mkUtt = overload { - mkUtt : S -> Utt -- John walked + mkUtt : S -> Utt -- John walked --: = UttS ; --% mkUtt : Cl -> Utt -- John walks = \c -> UttS (TUseCl TPres ASimul PPos c) ; --% - mkUtt : QS -> Utt -- did John walk + mkUtt : QS -> Utt -- did John walk --: = UttQS ; --% mkUtt : QCl -> Utt -- does John walk = \c -> UttQS (TUseQCl TPres ASimul PPos c) ; --% - mkUtt : (ImpForm) -> (Pol) -> Imp -> Utt -- don't love yourselves + mkUtt : (ImpForm) -> (Pol) -> Imp -> Utt -- don't love yourselves --: = mkUttImp ; --% mkUtt : ImpForm -> Imp -> Utt -- love yourselves --% = \f -> mkUttImp f PPos ; --% @@ -205,27 +213,27 @@ incomplete resource Constructors = open Grammar in { -- Utterances can also be formed from interrogative phrases and -- interrogative adverbials, noun phrases, adverbs, and verb phrases. - mkUtt : IP -> Utt -- who + mkUtt : IP -> Utt -- who --: = UttIP ; --% - mkUtt : IAdv -> Utt -- why + mkUtt : IAdv -> Utt -- why --: = UttIAdv ; --% - mkUtt : NP -> Utt -- this man + mkUtt : NP -> Utt -- this man --: = UttNP ; --% - mkUtt : Adv -> Utt -- here + mkUtt : Adv -> Utt -- here --: = UttAdv ; --% - mkUtt : VP -> Utt -- to sleep + mkUtt : VP -> Utt -- to sleep --: = UttVP ; --% - mkUtt : CN -> Utt -- beer + mkUtt : CN -> Utt -- beer --: = UttCN ; --% - mkUtt : AP -> Utt -- good + mkUtt : AP -> Utt -- good --: = UttAP ; --% - mkUtt : Card -> Utt -- five + mkUtt : Card -> Utt -- five --: = UttCard ; --% } ; --% -- The plural first-person imperative is a special construction. - lets_Utt : VP -> Utt -- let's walk + lets_Utt : VP -> Utt -- let's walk --: = ImpPl1 ; --% @@ -236,9 +244,9 @@ incomplete resource Constructors = open Grammar in { -- Polarity is a parameter that sets a clause to positive or negative -- form. Since positive is the default, it need never be given explicitly. - positivePol : Pol -- John walks [default] + positivePol : Pol -- John walks [default] --: = PPos ; --% - negativePol : Pol -- John doesn't walk + negativePol : Pol -- John doesn't walk --: = PNeg ; --% --3 Ant, anteriority @@ -247,9 +255,9 @@ incomplete resource Constructors = open Grammar in { -- anterior to some other reference time. -- Since simultaneous is the default, it need never be given explicitly. - simultaneousAnt : Ant -- John walks [default] + simultaneousAnt : Ant -- John walks [default] --: = ASimul ; --% - anteriorAnt : Ant -- John has walked --# notpresent + anteriorAnt : Ant -- John has walked --# notpresent --: = AAnter ; --# notpresent --% --3 Tense, tense @@ -258,13 +266,13 @@ incomplete resource Constructors = open Grammar in { -- to the time of speaking about it. -- Since present is the default, it need never be given explicitly. - presentTense : Tense -- John walks [default] + presentTense : Tense -- John walks [default] --: = TPres ; --% - pastTense : Tense -- John walked --# notpresent + pastTense : Tense -- John walked --# notpresent --: = TPast ; --# notpresent --% - futureTense : Tense -- John will walk --# notpresent + futureTense : Tense -- John will walk --# notpresent --: = TFut ; --# notpresent --% - conditionalTense : Tense -- John would walk --# notpresent + conditionalTense : Tense -- John would walk --# notpresent --: = TCond ; --# notpresent --% --3 ImpForm, imperative form @@ -273,11 +281,11 @@ incomplete resource Constructors = open Grammar in { -- by reference to the person or persons addressed. -- Since singular is the default, it need never be given explicitly. - singularImpForm : ImpForm -- help yourself [default] + singularImpForm : ImpForm -- help yourself [default] --: = IFSg ; --% - pluralImpForm : ImpForm -- help yourselves + pluralImpForm : ImpForm -- help yourselves --: = IFPl ; --% - politeImpForm : ImpForm -- help yourself [polite singular] + politeImpForm : ImpForm -- help yourself [polite singular] --: = IFPol ; --% -- This is how imperatives are implemented internally. --% @@ -314,7 +322,7 @@ incomplete resource Constructors = open Grammar in { = \t,p -> TUseCl t ASimul p ; --% mkS : Ant -> Pol -> Cl -> S --% = \a,p -> TUseCl TPres a p ; --% - mkS : (Tense) -> (Ant) -> (Pol) -> Cl -> S -- John wouldn't have walked + mkS : (Tense) -> (Ant) -> (Pol) -> Cl -> S -- John wouldn't have walked --: = \t,a -> TUseCl t a ; --% -- Sentences can be combined with conjunctions. This can apply to a pair @@ -322,12 +330,12 @@ incomplete resource Constructors = open Grammar in { mkS : Conj -> S -> S -> S -- John walks and I run = \c,x,y -> ConjS c (BaseS x y) ; --% - mkS : Conj -> ListS -> S -- John walks, I run and you sleep + mkS : Conj -> ListS -> S -- John walks, I run and you sleep --: = \c,xy -> ConjS c xy ; --% -- A sentence can be prefixed by an adverb. - mkS : Adv -> S -> S -- today, John walks + mkS : Adv -> S -> S -- today, John walks --: = AdvS ; --% } ; @@ -382,7 +390,7 @@ incomplete resource Constructors = open Grammar in { -- As the general rule, a clause can be built from a subject noun phrase and -- a verb phrase. - mkCl : NP -> VP -> Cl -- John always walks here + mkCl : NP -> VP -> Cl -- John always walks here --: = PredVP ; --% -- Existentials are a special form of clauses. @@ -391,23 +399,25 @@ incomplete resource Constructors = open Grammar in { = \y -> ExistNP (DetArtSg IndefArt (UseN y)) ; --% mkCl : CN -> Cl -- there is an old house = \y -> ExistNP (DetArtSg IndefArt y) ; --% - mkCl : NP -> Cl -- there are five houses + mkCl : NP -> Cl -- there are five houses --: = ExistNP ; --% -- There are also special forms in which a noun phrase or an adverb is -- emphasized. - mkCl : NP -> RS -> Cl -- it is John who walks + mkCl : NP -> RS -> Cl -- it is John who walks --: = CleftNP ; --% - mkCl : Adv -> S -> Cl -- it is here he walks + mkCl : Adv -> S -> Cl -- it is here he walks --: = CleftAdv ; --% -- Subjectless verb phrases are used for impersonal actions. mkCl : V -> Cl -- it rains = \v -> ImpersCl (UseV v) ; --% - mkCl : VP -> Cl -- it is raining + mkCl : VP -> Cl -- it is raining --: = ImpersCl ; --% + mkCl : SC -> VP -> Cl --: + = PredSCVP ; --% } ; @@ -423,19 +433,19 @@ incomplete resource Constructors = open Grammar in { -- A verb phrase is formed from a verb with appropriate arguments. mkVP = overload { - mkVP : V -> VP -- sleep + mkVP : V -> VP -- sleep --: = UseV ; --% mkVP : V2 -> NP -> VP -- love it = ComplV2 ; --% mkVP : V3 -> NP -> NP -> VP -- send a message to her = ComplV3 ; --% - mkVP : VV -> VP -> VP -- want to run + mkVP : VV -> VP -> VP -- want to run --: = ComplVV ; --% - mkVP : VS -> S -> VP -- know that she runs + mkVP : VS -> S -> VP -- know that she runs --: = ComplVS ; --% - mkVP : VQ -> QS -> VP -- wonder if she runs + mkVP : VQ -> QS -> VP -- wonder if she runs --: = ComplVQ ; --% - mkVP : VA -> AP -> VP -- become red + mkVP : VA -> AP -> VP -- become red --: = ComplVA ; --% mkVP : V2A -> NP -> AP -> VP -- paint it red = ComplV2A ; --% @@ -468,17 +478,20 @@ incomplete resource Constructors = open Grammar in { -- A verb phrase can be modified with a postverbal or a preverbal adverb. - mkVP : VP -> Adv -> VP -- sleep here + mkVP : VP -> Adv -> VP -- sleep here --: = AdvVP ; --% - mkVP : AdV -> VP -> VP -- always sleep + mkVP : AdV -> VP -> VP -- always sleep --: = AdVVP ; --% -- Objectless verb phrases can be taken to verb phrases in two ways. - mkVP : VPSlash -> NP -> VP -- paint it black + mkVP : VPSlash -> NP -> VP -- paint it black --: = ComplSlash ; --% - mkVP : VPSlash -> VP -- paint itself black - = ReflVP + mkVP : VPSlash -> VP -- paint itself black --: + = ReflVP ; --% + mkVP : Comp -> VP -- be warm --: + = UseComp ; --% + } ; --% -- Two-place verbs can be used reflexively. @@ -494,6 +507,8 @@ incomplete resource Constructors = open Grammar in { = PassV2 ; --% passiveVP : V2 -> NP -> VP -- be loved by her = \v,np -> (AdvVP (PassV2 v) (PrepNP by8agent_Prep np)) ; --% + -- passiveVP : VPSlash -> VP --: --% + } ; --% -- A verb phrase can be turned into the progressive form. @@ -501,6 +516,29 @@ incomplete resource Constructors = open Grammar in { progressiveVP : VP -> VP -- be sleeping = ProgrVP ; --% +--3 Comp, verb phrase complements + + mkComp = overload { --% + mkComp : AP -> Comp -- very old --: + = CompAP ; --% + mkComp : NP -> Comp -- this man --: + = CompNP ; --% + mkComp : Adv -> Comp -- here --: + = CompAdv ; --% + } ; --% + +--3 SC, embedded sentence + + mkSC = overload { --% + mkSC : S -> SC -- that he walks --: + = EmbedS ; --% + mkSC : QS -> SC -- whether he walks --: + = EmbedQS ; --% + mkSC : VP -> SC -- to walk --: + = EmbedVP ; --% + } ; --% + + --3 Imp, imperatives -- Imperatives are formed from verbs and their arguments; as the general @@ -534,7 +572,7 @@ incomplete resource Constructors = open Grammar in { = \q,nu,n -> DetCN (DetQuant q nu) n ; --% mkNP : Quant -> Num -> N -> NP -- these five men = \q,nu,n -> DetCN (DetQuant q nu) (UseN n) ; --% - mkNP : Det -> CN -> NP -- the first old man + mkNP : Det -> CN -> NP -- the first old man --: = DetCN ; --% mkNP : Det -> N -> NP -- the first man = \d,n -> DetCN d (UseN n) ; --% @@ -561,9 +599,9 @@ incomplete resource Constructors = open Grammar in { -- Proper names and pronouns can be used as noun phrases. - mkNP : PN -> NP -- John + mkNP : PN -> NP -- John --: = UsePN ; --% - mkNP : Pron -> NP -- he + mkNP : Pron -> NP -- he --: = UsePron ; --% -- Determiners alone can form noun phrases. @@ -572,12 +610,12 @@ incomplete resource Constructors = open Grammar in { = \q -> DetNP (DetQuant q sgNum) ; --% mkNP : Quant -> Num -> NP -- these five = \q,n -> DetNP (DetQuant q n) ; --% - mkNP : Det -> NP -- these five best + mkNP : Det -> NP -- these five best --: = DetNP ; --% -- Determinesless mass noun phrases. - mkNP : CN -> NP -- old beer + mkNP : CN -> NP -- old beer --: = MassNP ; --% mkNP : N -> NP -- beer = \n -> MassNP (UseN n) ; --% @@ -585,13 +623,13 @@ incomplete resource Constructors = open Grammar in { -- A noun phrase once formed can be prefixed by a predeterminer and -- suffixed by a past participle or an adverb. - mkNP : Predet -> NP -> NP -- only the man + mkNP : Predet -> NP -> NP -- only the man --: = PredetNP ; --% - mkNP : NP -> V2 -> NP -- the man found + mkNP : NP -> V2 -> NP -- the man seen --: = PPartNP ; --% - mkNP : NP -> Adv -> NP -- Paris today + mkNP : NP -> Adv -> NP -- Paris today --: = AdvNP ; --% - mkNP : NP -> RS -> NP -- John, who lives in Paris + mkNP : NP -> RS -> NP -- John, who lives in Paris --: = RelNP ; --% -- A conjunction can be formed both from two noun phrases and a longer @@ -599,7 +637,7 @@ incomplete resource Constructors = open Grammar in { mkNP : Conj -> NP -> NP -> NP = \c,x,y -> ConjNP c (BaseNP x y) ; --% - mkNP : Conj -> ListNP -> NP + mkNP : Conj -> ListNP -> NP --: = \c,xy -> ConjNP c xy ; --% -- backward compat --% @@ -626,9 +664,9 @@ incomplete resource Constructors = open Grammar in { = \d,nu -> (DetQuant d (NumCard nu)) ; --% mkDet : Quant -> Ord -> Det -- the best = \q,o -> DetQuantOrd q NumSg o ; --% - mkDet : Quant -> Num -> Ord -> Det -- these five best + mkDet : Quant -> Num -> Ord -> Det -- these five best --: = DetQuantOrd ; --% - mkDet : Quant -> Num -> Det -- these five + mkDet : Quant -> Num -> Det -- these five --: = DetQuant ; --% -- Numerals, their special cases integers and digits, and possessive pronouns can be @@ -667,13 +705,13 @@ incomplete resource Constructors = open Grammar in { -- There are definite and indefinite articles. mkQuant = overload { --% - mkQuant : Pron -> Quant -- my + mkQuant : Pron -> Quant -- my --: = PossPron ; --% } ; --% - the_Quant : Quant -- the + the_Quant : Quant -- the --: = DefArt ; --% - a_Quant : Quant -- a + a_Quant : Quant -- a --: = IndefArt ; --% --3 Num, cardinal numerals @@ -690,7 +728,7 @@ incomplete resource Constructors = open Grammar in { = \d -> NumCard (NumDigits d) ; --% mkNum : Digit -> Num -- five = \d -> NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 d)))))) ; --% - mkNum : Card -> Num -- almost ten + mkNum : Card -> Num -- almost ten --: = NumCard ; --% -- A numeral can be modified by an adnumeral. @@ -701,9 +739,9 @@ incomplete resource Constructors = open Grammar in { -- Dummy numbers are sometimes to select the grammatical number of a determiner. - singularNum : Num -- singular + singularNum : Num -- singular --: = NumSg ; --% - pluralNum : Num -- plural + pluralNum : Num -- plural --: = NumPl ; --% @@ -712,9 +750,9 @@ incomplete resource Constructors = open Grammar in { mkCard = overload { --% mkCard : Str -> Card -- thirty-five (given as "35") = str2card ; --% - mkCard : Numeral -> Card -- twenty + mkCard : Numeral -> Card -- twenty --: = NumNumeral ; --% - mkCard : Digits -> Card -- 51 + mkCard : Digits -> Card -- 51 --: = NumDigits ; --% mkCard : AdN -> Card -> Card -- almost fifty = AdNum ; --% @@ -726,16 +764,16 @@ incomplete resource Constructors = open Grammar in { -- and from symbolic integers. mkOrd = overload { --% - mkOrd : Numeral -> Ord -- twentieth + mkOrd : Numeral -> Ord -- twentieth --: = OrdNumeral ; --% - mkOrd : Digits -> Ord -- 51st + mkOrd : Digits -> Ord -- 51st --: = OrdDigits ; --% mkOrd : Digit -> Ord -- fifth = \d -> OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 d))))) ; --% -- Also adjectives in the superlative form can appear on ordinal positions. - mkOrd : A -> Ord -- largest + mkOrd : A -> Ord -- largest --: = OrdSuperl ; --% } ; --% @@ -744,113 +782,118 @@ incomplete resource Constructors = open Grammar in { -- Comparison adverbs can be used as adnumerals. - mkAdN : CAdv -> AdN -- more than + mkAdN : CAdv -> AdN -- more than --: = AdnCAdv ; --% --3 Numeral, number words - --- Numerals can be extracted from strings at compile time. +-- Numerals are divided to classes Sub1000000 (= Numeral), Sub1000, Sub100, Sub10. mkNumeral = overload { --% + +-- Number words up to 999,999 can be built as follows. + + mkNumeral : Sub1000 -> Numeral -- coerce 1..999 --: + = \n -> num (pot3 n) ; --% + mkNumeral : Sub1000 -> Sub1000 -> Numeral -- 1000m + n --: + = \m,n -> num (pot3plus m n) ; --% + +-- Some numerals can also be extracted from strings at compile time. + mkNumeral : Str -> Numeral -- thirty-five (given by "35") = str2numeral ; --% - } ; --% + } ; --% + thousandfoldNumeral : Sub1000 -> Numeral -- 1000n --: + = \n -> num (pot3 n) ; --% --- Some "round" numbers are here given as shorthands. + mkSub1000 = overload { --% + mkSub1000 : Sub100 -> Sub1000 -- coerce 1..99 --: + = pot1as2 ; --% + mkSub1000 : Sub10 -> Sub1000 -- 100n --: + = pot2 ; --% + mkSub1000 : Sub10 -> Sub100 -> Sub1000 -- 100m + n --: + = pot2plus ; --% + } ; --% - n1_Numeral : Numeral - = num (pot2as3 (pot1as2 (pot0as1 pot01))) ; --% - n2_Numeral : Numeral - = num (pot2as3 (pot1as2 (pot0as1 (pot0 n2)))) ; --% - n3_Numeral : Numeral - = num (pot2as3 (pot1as2 (pot0as1 (pot0 n3)))) ; --% - n4_Numeral : Numeral - = num (pot2as3 (pot1as2 (pot0as1 (pot0 n4)))) ; --% - n5_Numeral : Numeral - = num (pot2as3 (pot1as2 (pot0as1 (pot0 n5)))) ; --% - n6_Numeral : Numeral - = num (pot2as3 (pot1as2 (pot0as1 (pot0 n6)))) ; --% - n7_Numeral : Numeral - = num (pot2as3 (pot1as2 (pot0as1 (pot0 n7)))) ; --% - n8_Numeral : Numeral - = num (pot2as3 (pot1as2 (pot0as1 (pot0 n8)))) ; --% - n9_Numeral : Numeral - = num (pot2as3 (pot1as2 (pot0as1 (pot0 n9)))) ; --% - n10_Numeral : Numeral - = num (pot2as3 (pot1as2 pot110)) ; --% - n20_Numeral : Numeral - = num (pot2as3 (pot1as2 (pot1 n2))) ; --% - n100_Numeral : Numeral - = num (pot2as3 (pot2 pot01)) ; --% - n1000_Numeral : Numeral - = num (pot3 (pot1as2 (pot0as1 pot01))) ; --% + mkSub100 = overload { --% + mkSub100 : Unit -> Sub100 -- coerce 1..9 --: + = \n -> pot0as1 n.n ; --% + mkSub100 : Unit -> Unit -> Sub100 -- 10m + n --: + = \m,n -> case m.isOne of { + Predef.PFalse => pot1plus m.d n.n ; --% + _ => case n.isOne of { + Predef.PFalse => pot1to19 n.d ; --% + _ => pot111 + } + } + } ; --% --- See $Numeral$ for the full set of constructors, and use the category --- $Digits$ for other numbers from one million. + tenfoldSub100 : Unit -> Sub100 -- 10n --: + = \n -> case n.isOne of { --% + Predef.PTrue => pot110 ; --% + _ => pot1 n.d --% + } ; --% + +-- We introduce the internal type $Unit$ for 1..9 + + Unit : Type --% + = {n : Sub10 ; d : Digit ; isOne : Predef.PBool} ; --% + + n1_Unit : Unit -- one --: + = {n = pot01 ; d = n2 ; isOne = Predef.PTrue} ; --% + n2_Unit : Unit -- two --: + = {n = pot0 n2 ; d = n2 ; isOne = Predef.PFalse} ; --% + n3_Unit : Unit -- three --: + = {n = pot0 n3 ; d = n3 ; isOne = Predef.PFalse} ; --% + n4_Unit : Unit -- four --: + = {n = pot0 n4 ; d = n4 ; isOne = Predef.PFalse} ; --% + n5_Unit : Unit -- five --: + = {n = pot0 n5 ; d = n5 ; isOne = Predef.PFalse} ; --% + n6_Unit : Unit -- six --: + = {n = pot0 n6 ; d = n6 ; isOne = Predef.PFalse} ; --% + n7_Unit : Unit -- seven --: + = {n = pot0 n7 ; d = n7 ; isOne = Predef.PFalse} ; --% + n8_Unit : Unit -- eight --: + = {n = pot0 n8 ; d = n8 ; isOne = Predef.PFalse} ; --% + n9_Unit : Unit -- nine --: + = {n = pot0 n9 ; d = n9 ; isOne = Predef.PFalse} ; --% + +-- Use the category $Digits$ for numbers above one million. --3 Digits, numerals as sequences of digits mkDigits = overload { --% - mkDigits : Str -> Digits + mkDigits : Str -> Digits -- 35 (from string "35") = str2digits ; --% - mkDigits : Dig -> Digits + mkDigits : Dig -> Digits -- 4 --: = IDig ; --% - mkDigits : Dig -> Digits -> Digits + mkDigits : Dig -> Digits -> Digits -- 1,233,432 --: = IIDig ; --% } ; --% - n1_Digits : Digits - = IDig D_1 ; --% - n2_Digits : Digits - = IDig D_2 ; --% - n3_Digits : Digits - = IDig D_3 ; --% - n4_Digits : Digits - = IDig D_4 ; --% - n5_Digits : Digits - = IDig D_5 ; --% - n6_Digits : Digits - = IDig D_6 ; --% - n7_Digits : Digits - = IDig D_7 ; --% - n8_Digits : Digits - = IDig D_8 ; --% - n9_Digits : Digits - = IDig D_9 ; --% - n10_Digits : Digits - = IIDig D_1 (IDig D_0) ; --% - n20_Digits : Digits - = IIDig D_2 (IDig D_0) ; --% - n100_Digits : Digits - = IIDig D_1 (IIDig D_0 (IDig D_0)) ; --% - n1000_Digits : Digits - = IIDig D_1 (IIDig D_0 (IIDig D_0 (IDig D_0))) ; --% - - --3 Dig, single digits - n0_Dig : Dig + n0_Dig : Dig -- 0 --: = D_0 ; --% - n1_Dig : Dig + n1_Dig : Dig -- 1 --: = D_1 ; --% - n2_Dig : Dig + n2_Dig : Dig -- 2 --: = D_2 ; --% - n3_Dig : Dig + n3_Dig : Dig -- 3 --: = D_3 ; --% - n4_Dig : Dig + n4_Dig : Dig -- 4 --: = D_4 ; --% - n5_Dig : Dig + n5_Dig : Dig -- 5 --: = D_5 ; --% - n6_Dig : Dig + n6_Dig : Dig -- 6 --: = D_6 ; --% - n7_Dig : Dig + n7_Dig : Dig -- 7 --: = D_7 ; --% - n8_Dig : Dig + n8_Dig : Dig -- 8 --: = D_8 ; --% - n9_Dig : Dig + n9_Dig : Dig -- 9 --: = D_9 ; --% --2 Nouns @@ -861,14 +904,14 @@ incomplete resource Constructors = open Grammar in { -- The simplest way of forming common noun phrases is from atomic nouns $N$. - mkCN : N -> CN -- house + mkCN : N -> CN -- house --: = UseN ; --% -- Common noun phrases can be formed from relational nouns by providing arguments. - mkCN : N2 -> NP -> CN -- mother of John + mkCN : N2 -> NP -> CN -- mother of John --: = ComplN2 ; --% - mkCN : N3 -> NP -> NP -> CN -- distance from this city to Paris + mkCN : N3 -> NP -> NP -> CN -- distance from this city to Paris --: = \f,x -> ComplN2 (ComplN3 f x) ; --% -- Relational nouns can also be used without their arguments. @@ -890,7 +933,7 @@ incomplete resource Constructors = open Grammar in { = \x,y -> AdjCN x (UseN y) ; --% mkCN : AP -> CN -> CN -- very big blue house = AdjCN ; --% - mkCN : CN -> AP -> CN -- very big blue house --% + mkCN : CN -> AP -> CN -- very big blue house --: --% = \x,y -> AdjCN y x ; --% mkCN : N -> AP -> CN -- very big house --% = \x,y -> AdjCN y (UseN x) ; --% @@ -899,7 +942,7 @@ incomplete resource Constructors = open Grammar in { mkCN : N -> RS -> CN -- house that John owns = \x,y -> RelCN (UseN x) y ; --% - mkCN : CN -> RS -> CN -- big house that John loves + mkCN : CN -> RS -> CN -- big house that John loves --: = RelCN ; --% mkCN : N -> Adv -> CN -- house on the hill = \x,y -> AdvCN (UseN x) y ; --% @@ -910,13 +953,14 @@ incomplete resource Constructors = open Grammar in { -- questions, or infinitives. But syntactically this is possible for -- all nouns. - mkCN : CN -> S -> CN -- rule that John walks = \cn,s -> SentCN cn (EmbedS s) ; --% mkCN : CN -> QS -> CN -- question if John walks = \cn,s -> SentCN cn (EmbedQS s) ; --% mkCN : CN -> VP -> CN -- reason to walk = \cn,s -> SentCN cn (EmbedVP s) ; --% + mkCN : CN -> SC -> CN -- reason to walk --: + = \cn,s -> SentCN cn s ; --% -- A noun can be used in apposition to a noun phrase, especially a proper name. @@ -936,16 +980,16 @@ incomplete resource Constructors = open Grammar in { -- Adjectival phrases can be formed from atomic adjectives by using the positive form or -- the comparative with a complement - mkAP : A -> AP -- warm + mkAP : A -> AP -- warm --: = PositA ; --% - mkAP : A -> NP -> AP -- warmer than Paris + mkAP : A -> NP -> AP -- warmer than Paris --: = ComparA ; --% -- Relational adjectives can be used with a complement or a reflexive - mkAP : A2 -> NP -> AP -- married to her + mkAP : A2 -> NP -> AP -- married to her --: = ComplA2 ; --% - mkAP : A2 -> AP -- married + mkAP : A2 -> AP -- married --: = UseA2 ; --% -- Some adjectival phrases can take as complements sentences, @@ -958,19 +1002,21 @@ incomplete resource Constructors = open Grammar in { = \ap,s -> SentAP ap (EmbedQS s) ; --% mkAP : AP -> VP -> AP -- ready to go = \ap,s -> SentAP ap (EmbedVP s) ; --% + mkAP : AP -> SC -> AP -- ready to go --: + = \ap,s -> SentAP ap s ; --% -- An adjectival phrase can be modified by an adadjective. mkAP : AdA -> A -> AP -- very old =\x,y -> AdAP x (PositA y) ; --% - mkAP : AdA -> AP -> AP -- very very old + mkAP : AdA -> AP -> AP -- very very old --: = AdAP ; --% -- Conjunction can be formed from two or more adjectival phrases. mkAP : Conj -> AP -> AP -> AP -- old and big = \c,x,y -> ConjAP c (BaseAP x y) ; --% - mkAP : Conj -> ListAP -> AP -- old, big and warm + mkAP : Conj -> ListAP -> AP -- old, big and warm --: = \c,xy -> ConjAP c xy ; --% -- Two more constructions. @@ -981,7 +1027,7 @@ incomplete resource Constructors = open Grammar in { = CAdvAP ; --% } ; --% - reflAP : A2 -> AP -- married to himself + reflAP : A2 -> AP -- married to himself --: = ReflA2 ; --% comparAP : A -> AP -- warmer = UseComparA ; --% @@ -992,36 +1038,36 @@ incomplete resource Constructors = open Grammar in { -- Adverbs can be formed from adjectives. - mkAdv : A -> Adv -- warmly + mkAdv : A -> Adv -- warmly --: = PositAdvAdj ; --% -- Prepositional phrases are treated as adverbs. - mkAdv : Prep -> NP -> Adv -- in the house + mkAdv : Prep -> NP -> Adv -- in the house --: = PrepNP ; --% -- Subordinate sentences are treated as adverbs. - mkAdv : Subj -> S -> Adv -- when John walks + mkAdv : Subj -> S -> Adv -- when John walks --: = SubjS ; --% -- An adjectival adverb can be compared to a noun phrase or a sentence. - mkAdv : CAdv -> A -> NP -> Adv -- more warmly than John + mkAdv : CAdv -> A -> NP -> Adv -- more warmly than John --: = ComparAdvAdj ; --% - mkAdv : CAdv -> A -> S -> Adv -- more warmly than he runs + mkAdv : CAdv -> A -> S -> Adv -- more warmly than he runs --: = ComparAdvAdjS ; --% -- Adverbs can be modified by adadjectives. - mkAdv : AdA -> Adv -> Adv -- very warmly + mkAdv : AdA -> Adv -> Adv -- very warmly --: = AdAdv ; --% -- Conjunction can be formed from two or more adverbial phrases. mkAdv : Conj -> Adv -> Adv -> Adv -- here and now = \c,x,y -> ConjAdv c (BaseAdv x y) ; --% - mkAdv : Conj -> ListAdv -> Adv -- with John, here and now + mkAdv : Conj -> ListAdv -> Adv -- with John, here and now --: = \c,xy -> ConjAdv c xy ; --% } ; --% @@ -1071,7 +1117,7 @@ incomplete resource Constructors = open Grammar in { -- 'Yes-no' question clauses are built from 'declarative' clauses. - mkQCl : Cl -> QCl -- does John walk + mkQCl : Cl -> QCl -- does John walk --: = QuestCl ; --% -- 'Wh' questions are built from interrogative pronouns in subject @@ -1080,7 +1126,7 @@ incomplete resource Constructors = open Grammar in { -- The latter uses the 'slash' category of objectless clauses -- (see below); we give the common special case with a two-place verb. - mkQCl : IP -> VP -> QCl -- who walks + mkQCl : IP -> VP -> QCl -- who walks --: = QuestVP ; --% mkQCl : IP -> V -> QCl -- who walks = \s,v -> QuestVP s (UseV v); --% @@ -1122,13 +1168,13 @@ incomplete resource Constructors = open Grammar in { = \x,y -> QuestVP x (UseComp (CompAdv y)) ; --% mkQCl : IP -> NP -> V2 -> QCl -- who does John love = \ip,np,v -> QuestSlash ip (SlashVP np (SlashV2a v)) ; --% - mkQCl : IP -> ClSlash -> QCl -- who does John today + mkQCl : IP -> ClSlash -> QCl -- who does John today --: = QuestSlash ; --% -- Adverbial 'wh' questions are built with interrogative adverbials, with the -- special case of prepositional phrases with interrogative pronouns. - mkQCl : IAdv -> Cl -> QCl -- why does John walk + mkQCl : IAdv -> Cl -> QCl -- why does John walk --: = QuestIAdv ; --% mkQCl : Prep -> IP -> Cl -> QCl -- with whom does John walk = \p,ip -> QuestIAdv (PrepIP p ip) ; --% @@ -1140,12 +1186,12 @@ incomplete resource Constructors = open Grammar in { -- Asking about a known subject. - mkQCl : IComp -> NP -> QCl -- who is this man + mkQCl : IComp -> NP -> QCl -- who is this man --: = \a -> QuestIComp a ; --% -- Existentials are a special construction. - mkQCl : IP -> QCl -- which houses are there + mkQCl : IP -> QCl -- which houses are there --: = ExistIP ; --% } ; --% @@ -1157,10 +1203,12 @@ incomplete resource Constructors = open Grammar in { -- Interrogative pronouns -- can be formed much like noun phrases, by using interrogative quantifiers. - mkIP : IDet -> CN -> IP -- which five big cities + mkIP : IDet -> CN -> IP -- which five big cities --: = IdetCN ; --% mkIP : IDet -> N -> IP -- which five cities = \i,n -> IdetCN i (UseN n) ; --% + mkIP : IDet -> IP -- which five --: + = IdetIP ; --% mkIP : IQuant -> CN -> IP -- which big cities = \i,n -> IdetCN (IdetQuant i NumSg) n ; --% mkIP : IQuant -> Num -> CN -> IP -- which five cities @@ -1171,7 +1219,7 @@ incomplete resource Constructors = open Grammar in { -- An interrogative pronoun can be modified by an adverb. - mkIP : IP -> Adv -> IP -- who in Paris + mkIP : IP -> Adv -> IP -- who in Paris --: = AdvIP ; --% } ; --% @@ -1245,7 +1293,7 @@ incomplete resource Constructors = open Grammar in { = TUseRCl ; --% mkRS : Conj -> RS -> RS -> RS -- who walks and whose mother runsx = \c,x,y -> ConjRS c (BaseRS x y) ; --% - mkRS : Conj -> ListRS -> RS -- who walks, whom I see and who sleeps + mkRS : Conj -> ListRS -> RS -- who walks, whom I see and who sleeps --: = \c,xy -> ConjRS c xy ; --% } ; --% @@ -1259,9 +1307,9 @@ incomplete resource Constructors = open Grammar in { -- The latter uses the 'slash' category of objectless clauses (see below); -- we give the common special case with a two-place verb. - mkRCl : RP -> VP -> RCl -- that loves John + mkRCl : RP -> VP -> RCl -- that loves John --: = RelVP ; --% - mkRCl : RP -> ClSlash -> RCl -- whom John loves today + mkRCl : RP -> ClSlash -> RCl -- whom John loves today --: = RelSlash ; --% mkRCl : RP -> NP -> V2 -> RCl -- whom John loves = \rp,np,v2 -> RelSlash rp (SlashVP np (SlashV2a v2)) ; --% @@ -1277,18 +1325,23 @@ incomplete resource Constructors = open Grammar in { -- There is an atomic relative pronoun - which_RP : RP -- which + which_RP : RP -- which --: = IdRP ; --% -- A relative pronoun can be made into a kind of a prepositional phrase. - mkRP : Prep -> NP -> RP -> RP -- all the houses in which + mkRP : Prep -> NP -> RP -> RP -- all the houses in which --: = FunRP ; --% +--3 SSlash, objectless sentences + mkSSlash = overload { --% + mkSSlash : Temp -> Pol -> ClSlash -> SSlash --: + = UseSlash --% + } ; --% ---3 ClSlash, objectless sentences +--3 ClSlash, objectless clauses mkClSlash = overload { --% @@ -1296,7 +1349,7 @@ incomplete resource Constructors = open Grammar in { -- The most common way of constructing them is by using a two-place verb -- with a subject but without an object. - mkClSlash : NP -> VPSlash -> ClSlash -- (whom) he sees here + mkClSlash : NP -> VPSlash -> ClSlash -- (whom) he sees here --: = \np,vps -> SlashVP np vps ; --% mkClSlash : NP -> V2 -> ClSlash -- (whom) he sees = \np,v2 -> SlashVP np (SlashV2a v2) ; --% @@ -1308,13 +1361,19 @@ incomplete resource Constructors = open Grammar in { -- The missing object can also be the noun phrase in a prepositional phrase. - mkClSlash : Cl -> Prep -> ClSlash -- (with whom) he walks + mkClSlash : Cl -> Prep -> ClSlash -- (with whom) he walks --: = SlashPrep ; --% -- An objectless sentence can be modified by an adverb. - mkClSlash : ClSlash -> Adv -> ClSlash -- (whom) he sees tomorrow + mkClSlash : ClSlash -> Adv -> ClSlash -- (whom) he sees tomorrow --: = AdvSlash ; --% + +-- Slash can be transferred to an embedded sentence. + + mkClSlash : NP -> VS -> SSlash -> ClSlash -- (whom) she says that he loves --: + = SlashVS --% + } ; --% @@ -1324,18 +1383,22 @@ incomplete resource Constructors = open Grammar in { -- This is the deep level of many-argument predication, permitting extraction. - mkVPSlash : V2 -> VPSlash -- (whom) (John) loves + mkVPSlash : V2 -> VPSlash -- (whom) (John) loves --: = SlashV2a ; --% - mkVPSlash : V3 -> NP -> VPSlash -- (whom) (John) gives an apple + mkVPSlash : V3 -> NP -> VPSlash -- (whom) (John) gives an apple --: = Slash2V3 ; --% - mkVPSlash : V2A -> AP -> VPSlash -- (whom) (John) paints red + mkVPSlash : V2A -> AP -> VPSlash -- (whom) (John) paints red --: = SlashV2A ; --% - mkVPSlash : V2Q -> QS -> VPSlash -- (whom) (John) asks who sleeps + mkVPSlash : V2Q -> QS -> VPSlash -- (whom) (John) asks who sleeps --: = SlashV2Q ; --% - mkVPSlash : V2S -> S -> VPSlash -- (whom) (John) tells that we sleep + mkVPSlash : V2S -> S -> VPSlash -- (whom) (John) tells that we sleep --: = SlashV2S ; --% - mkVPSlash : V2V -> VP -> VPSlash -- (whom) (John) forces to sleep + mkVPSlash : V2V -> VP -> VPSlash -- (whom) (John) forces to sleep --: = SlashV2V ; --% + mkVPSlash : VV -> VPSlash -> VPSlash -- want always to buy --: + = SlashVV ; --% + mkVPSlash : V2V -> NP -> VPSlash -> VPSlash -- beg me always to buy --: + = SlashV2VNP ; --% } ; --% @@ -1347,18 +1410,18 @@ incomplete resource Constructors = open Grammar in { --3 ListS, sentence lists mkListS = overload { --% - mkListS : S -> S -> ListS + mkListS : S -> S -> ListS --: = BaseS ; --% - mkListS : S -> ListS -> ListS + mkListS : S -> ListS -> ListS --: = ConsS ; --% } ; --% --3 ListAdv, adverb lists mkListAdv = overload { --% - mkListAdv : Adv -> Adv -> ListAdv + mkListAdv : Adv -> Adv -> ListAdv --: = BaseAdv ; --% - mkListAdv : Adv -> ListAdv -> ListAdv + mkListAdv : Adv -> ListAdv -> ListAdv --: = ConsAdv ; --% } ; --% @@ -1367,9 +1430,9 @@ incomplete resource Constructors = open Grammar in { --3 ListAP, adjectival phrase lists mkListAP = overload { --% - mkListAP : AP -> AP -> ListAP + mkListAP : AP -> AP -> ListAP --: = BaseAP ; --% - mkListAP : AP -> ListAP -> ListAP + mkListAP : AP -> ListAP -> ListAP --: = ConsAP ; --% } ; --% @@ -1378,18 +1441,18 @@ incomplete resource Constructors = open Grammar in { --3 ListNP, noun phrase lists mkListNP = overload { --% - mkListNP : NP -> NP -> ListNP + mkListNP : NP -> NP -> ListNP --: = BaseNP ; --% - mkListNP : NP -> ListNP -> ListNP + mkListNP : NP -> ListNP -> ListNP --: = ConsNP ; --% } ; --% --3 ListRS, relative clause lists mkListRS = overload { --% - mkListRS : RS -> RS -> ListRS + mkListRS : RS -> RS -> ListRS --: = BaseRS ; --% - mkListRS : RS -> ListRS -> ListRS + mkListRS : RS -> ListRS -> ListRS --: = ConsRS ; --% } ; --% @@ -1568,4 +1631,60 @@ oper } ; } ; + n1_Digits : Digits -- 1 + = IDig D_1 ; --% + n2_Digits : Digits -- 2 + = IDig D_2 ; --% + n3_Digits : Digits -- 3 + = IDig D_3 ; --% + n4_Digits : Digits -- 4 + = IDig D_4 ; --% + n5_Digits : Digits -- 5 + = IDig D_5 ; --% + n6_Digits : Digits -- 6 + = IDig D_6 ; --% + n7_Digits : Digits -- 7 + = IDig D_7 ; --% + n8_Digits : Digits -- 8 + = IDig D_8 ; --% + n9_Digits : Digits -- 9 + = IDig D_9 ; --% + n10_Digits : Digits -- 10 + = IIDig D_1 (IDig D_0) ; --% + n20_Digits : Digits -- 20 + = IIDig D_2 (IDig D_0) ; --% + n100_Digits : Digits -- 100 + = IIDig D_1 (IIDig D_0 (IDig D_0)) ; --% + n1000_Digits : Digits -- 1000 + = IIDig D_1 (IIDig D_0 (IIDig D_0 (IDig D_0))) ; --% + +-- Some "round" numbers are here given as shorthands. + + n1_Numeral : Numeral + = num (pot2as3 (pot1as2 (pot0as1 pot01))) ; --% + n2_Numeral : Numeral + = num (pot2as3 (pot1as2 (pot0as1 (pot0 n2)))) ; --% + n3_Numeral : Numeral + = num (pot2as3 (pot1as2 (pot0as1 (pot0 n3)))) ; --% + n4_Numeral : Numeral + = num (pot2as3 (pot1as2 (pot0as1 (pot0 n4)))) ; --% + n5_Numeral : Numeral + = num (pot2as3 (pot1as2 (pot0as1 (pot0 n5)))) ; --% + n6_Numeral : Numeral + = num (pot2as3 (pot1as2 (pot0as1 (pot0 n6)))) ; --% + n7_Numeral : Numeral + = num (pot2as3 (pot1as2 (pot0as1 (pot0 n7)))) ; --% + n8_Numeral : Numeral + = num (pot2as3 (pot1as2 (pot0as1 (pot0 n8)))) ; --% + n9_Numeral : Numeral + = num (pot2as3 (pot1as2 (pot0as1 (pot0 n9)))) ; --% + n10_Numeral : Numeral + = num (pot2as3 (pot1as2 pot110)) ; --% + n20_Numeral : Numeral + = num (pot2as3 (pot1as2 (pot1 n2))) ; --% + n100_Numeral : Numeral + = num (pot2as3 (pot2 pot01)) ; --% + n1000_Numeral : Numeral + = num (pot3 (pot1as2 (pot0as1 pot01))) ; --% + }