diff --git a/lib/resource-1.0/api/Constructors.gf b/lib/resource-1.0/api/Constructors.gf index 2abf3c104..e8c883bf7 100644 --- a/lib/resource-1.0/api/Constructors.gf +++ b/lib/resource-1.0/api/Constructors.gf @@ -357,7 +357,7 @@ incomplete resource Constructors = open Grammar in { mkNP : Num -> N -> NP ; -- 11. almost twenty men mkNP : Num -> CN -> NP ; -- 12. almost twenty old men mkNP : Pron -> N -> NP ; -- 13. my man - mkNP : Pron -> CN -> NP; -- 14. my old man + mkNP : Pron -> CN -> NP ; -- 14. my old man -- Proper names and pronouns can be used as noun phrases. diff --git a/lib/resource-1.0/doc/MkSynopsis.hs b/lib/resource-1.0/doc/MkSynopsis.hs index d296598e7..6de3913ed 100644 --- a/lib/resource-1.0/doc/MkSynopsis.hs +++ b/lib/resource-1.0/doc/MkSynopsis.hs @@ -20,14 +20,17 @@ main = do cs1 <- getCats isLatex True commonAPI cs2 <- getCats isLatex False catAPI let cs = cs1 ++ cs2 - delimit cs + append "==A hierarchic view==\n" + include "categories-intro.txt" + append "==Explanations==\n" + delimit $ reCat cs space title "Syntax Rules" space link "Source:" syntaxAPI space rs <- getRules True isLatex syntaxAPI - delimit rs + delimit $ reTable rs space title "Structural Words" space @@ -154,3 +157,44 @@ link s f = append $ s ++ " [``" ++ fa ++ "`` " ++ f ++ "]" where ttf s = "``" ++ s ++ "``" itf s = "//" ++ s ++ "//" + +----------------- + +-- sort category synopsis by category, retain one table + +reCat t = let (hd,tb) = splitHeader t in hd : sortCat tb + +sortCat = sortBy (\r s -> compare (cat r) (cat s)) where + cat r = unquote $ words r !! 1 + +unquote = takeWhile (/='`') . dropWhile (=='`') + +-- sort function synopsis by category, into separate tables + +-- table: +-- || Function | Type | Example || +-- | ``mkText`` | ``Phr -> Text`` | //But John walks.// | + +reTable t = let (hd,tb) = splitHeader t in sortTable hd tb + +splitHeader (hd:tb) = (hd,tb) + +sortTable hd = map (printBack hd) . sortVal . groupVal + +groupVal = groupBy sameVal where + sameVal r1 r2 = valRow r1 == valRow r2 + +-- row: | ``mkText`` | ``Phr -> Text`` | //But John walks.// | +valRow r = case words r of + "|":_:"|":rest -> val where + typ = takeWhile (/="|") rest + val = unquote $ last typ + _ -> error "no row value for: " ++ r + +sortVal = sortBy (\t u -> compare (hd t) (hd u)) where + hd = (valRow . head) + +printBack hd tb = unlines $ subtitle (valRow (head tb)) : "\n" : [hd] ++ tb + +subtitle cat = "==" ++ cat ++ "==" + diff --git a/lib/resource-1.0/doc/categories-intro.txt b/lib/resource-1.0/doc/categories-intro.txt new file mode 100644 index 000000000..4ca6cc3a4 --- /dev/null +++ b/lib/resource-1.0/doc/categories-intro.txt @@ -0,0 +1,17 @@ + + + +The chart below shows the categories in a hierarchical top-down order. +The edges do not define the complete dependency structure; if they did, +the graph would have many many more edges, and also many cycles. The precise +meaning of a directed edge from //C// to //D// is: there is a constructor +of //C// that takes //D// as an argument. What the constructors exactly are, +and what other arguments they take, is described by separate tables for +each category. + + | [categories.png] | + +The rectangular boxes mark open lexical categories, which have constructors +also in the ``Paradigms`` modules. + + diff --git a/lib/resource-1.0/doc/categories.dot b/lib/resource-1.0/doc/categories.dot new file mode 100644 index 000000000..dc0a053f4 --- /dev/null +++ b/lib/resource-1.0/doc/categories.dot @@ -0,0 +1,139 @@ +digraph { + +size = "12,8" ; + +Text [style = "solid", shape = "ellipse"]; +Text -> Punct [style = "solid"]; +Text -> Phr [style = "solid"]; + +Punct [style = "solid", shape = "ellipse"]; + +Phr [style = "solid", shape = "ellipse"]; +Phr -> PConj [style = "solid"]; +Phr -> Utt [style = "solid"]; +Phr -> Voc [style = "solid"]; + +PConj [style = "solid", shape = "ellipse"]; +Voc [style = "solid", shape = "ellipse"]; + +Utt [style = "solid", shape = "ellipse"]; +Utt -> Imp [style = "solid"]; +Utt -> S [style = "solid"]; +Utt -> QS [style = "solid"]; + +Imp [style = "solid", shape = "ellipse"]; + +S [style = "solid", shape = "ellipse"]; +S -> Tense [style = "solid"]; +S -> Ant [style = "solid"]; +S -> Pol [style = "solid"]; +S -> Cl [style = "solid"]; +S -> ListS [style = "solid"]; +S -> Conjs [style = "solid"]; + +Conjs [label = "Conj,DConj", style = "solid", shape = "ellipse"]; + +Tense [style = "solid", shape = "ellipse"]; +Ant [style = "solid", shape = "ellipse"]; +Pol [style = "solid", shape = "ellipse"]; + +Cl [style = "solid", shape = "ellipse"]; +Cl -> NP [style = "solid"]; +Cl -> VP [style = "solid"]; +Cl -> Adv [style = "solid"]; + +Adv [style = "solid", shape = "rectangle"]; +Adv -> ListAdv [style = "solid"]; + + +NP [style = "solid", shape = "ellipse"]; +NP -> Predet [style = "solid"]; +NP -> Pron [style = "solid"]; +NP -> PN [style = "solid"]; +NP -> Det [style = "solid"]; +NP -> CN [style = "solid"]; +NP -> ListNP [style = "solid"]; + +Predet [style = "solid", shape = "ellipse"]; + +Pron [style = "solid", shape = "ellipse"]; +PN [style = "solid", shape = "rectangle"]; + +Det [style = "solid", shape = "ellipse"]; +Det -> Quants [style = "solid"]; +Det -> Num [style = "solid"]; +Det -> Ord [style = "solid"]; + + +Quants [label = "QuantSg,QuantPl", style = "solid", shape = "ellipse"]; +Quants -> Quant [style = "solid"]; + +Quant [style = "solid", shape = "ellipse"]; + + +Num [style = "solid", shape = "ellipse"]; +Num -> Numerals [style = "solid"]; +Num -> AdN [style = "solid"]; + +AdN [style = "solid", shape = "ellipse"]; +AdN -> CAdv [style = "solid"]; + + +Numerals [label = "Numeral,Int", style = "solid", shape = "ellipse"]; + + +Ord [style = "solid", shape = "ellipse"]; + +CN [style = "solid", shape = "ellipse"]; +CN -> Ns [style = "solid"]; +CN -> RS [style = "solid"]; + +Ns [label = "N,N2,N3", style = "solid", shape = "rectangle"]; + + +VP [style = "solid", shape = "ellipse"]; +VP -> AdV [style = "solid"]; +VP -> Vs [style = "solid"]; +VP -> AP [style = "solid"]; + +AdV [style = "solid", shape = "ellipse"]; + +Vs [label = "V,V2,V3,VV,VS,VQ,VA,V2A", style = "solid", shape = "rectangle"]; + +AP [style = "solid", shape = "ellipse"]; +AP -> AdA [style = "solid"]; +AP -> As [style = "solid"]; +AP -> ListAP [style = "solid"]; + +As [label = "A, A2", style = "solid", shape = "rectangle"]; + + + + +QS [style = "solid", shape = "ellipse"]; +QS -> QCl [style = "solid"]; + +QCl [style = "solid", shape = "ellipse"]; +QCl -> IP [style = "solid"]; +QCl -> IAdv [style = "solid"]; +QCl -> Slash [style = "solid"]; + +IP [style = "solid", shape = "ellipse"]; +IP -> IDet [style = "solid"]; + +IDet [style = "solid", shape = "ellipse"]; + +IAdv [style = "solid", shape = "ellipse"]; + +Slash [style = "solid", shape = "ellipse"]; + +RS [style = "solid", shape = "ellipse"]; +RS -> RCl [style = "solid"]; + +RCl [style = "solid", shape = "ellipse"]; +RCl -> RP [style = "solid"]; + +RP [style = "solid", shape = "ellipse"]; + + +} diff --git a/lib/resource-1.0/doc/categories.png b/lib/resource-1.0/doc/categories.png new file mode 100644 index 000000000..079b70ea4 Binary files /dev/null and b/lib/resource-1.0/doc/categories.png differ diff --git a/lib/resource-1.0/doc/synopsis.html b/lib/resource-1.0/doc/synopsis.html index 862af0eb0..c04203fd3 100644 --- a/lib/resource-1.0/doc/synopsis.html +++ b/lib/resource-1.0/doc/synopsis.html @@ -14,20 +14,64 @@
http://www.cs.chalmers.se/~aarne
Source 2: http://www.cs.chalmers.se/~aarne/GF/lib/resource/abstract/Cat.gf
+
+A hierarchic view
+
+The chart below shows the categories in a hierarchical top-down order.
+The edges do not define the complete dependency structure; if they did,
+the graph would have many many more edges, and also many cycles. The precise
+meaning of a directed edge from C to D is: there is a constructor
+of C that takes D as an argument. What the constructors exactly are,
+and what other arguments they take, is described by separate tables for
+each category.
+
+
+
+
+
+
+
+
+
+The rectangular boxes mark open lexical categories, which have constructors
+also in the Paradigms modules.
+
+
+Explanations
Category
@@ -68,44 +136,19 @@ Source 2: http://www.cs.chalmers.se/~aarne/GF
Example
-Text
-text consisting of several phrases
-"He is here. Why?"
+A
+one-place adjective
+"warm"
-Phr
-phrase in a text
-"but be quiet please"
+A2
+two-place adjective
+"divisible"
-Utt
-sentence, question, word...
-"be quiet"
-
-
-Voc
-vocative or "please"
-"my darling"
-
-
-PConj
-phrase-beginning conj.
-"therefore"
-
-
-SC
-embedded sentence or question
-"that it rains"
-
-
-Adv
-verb-phrase-modifying adverb,
-"in the house"
-
-
-AdV
-adverb directly attached to verb
-"always"
+AP
+adjectival phrase
+"very warm"
AdA
@@ -118,24 +161,14 @@ Source 2: http://www.cs.chalmers.se/~aarne/GF
"more than"
-IAdv
-interrogative adverb
-"why"
+AdV
+adverb directly attached to verb
+"always"
-CAdv
-comparative adverb
-"more"
-
-
-Tense
-tense
-present, past, future
-
-
-Pol
-polarity
-positive, negative
+Adv
+verb-phrase-modifying adverb,
+"in the house"
Ant
@@ -143,79 +176,9 @@ Source 2: http://www.cs.chalmers.se/~aarne/GF
simultaneous, anterior
-S
-declarative sentence
-"she lived here"
-
-
-QS
-question
-"where did she live"
-
-
-RS
-relative
-"in which she lived"
-
-
-Cl
-declarative clause, with all tenses
-"she looks at this"
-
-
-Slash
-clause missing NP (S/NP in GPSG)
-"she looks at"
-
-
-Imp
-imperative
-"look at this"
-
-
-QCl
-question clause, with all tenses
-"why does she walk"
-
-
-IP
-interrogative pronoun
-"who"
-
-
-IComp
-interrogative complement of copula
-"where"
-
-
-IDet
-interrogative determiner
-"which"
-
-
-RCl
-relative clause, with all tenses
-"in which she lives"
-
-
-RP
-relative pronoun
-"in which"
-
-
-VP
-verb phrase
-"is very warm"
-
-
-Comp
-complement of copula, such as AP
-"very warm"
-
-
-AP
-adjectival phrase
-"very warm"
+CAdv
+comparative adverb
+"more"
CN
@@ -223,39 +186,14 @@ Source 2: http://www.cs.chalmers.se/~aarne/GF
"red house"
-NP
-noun phrase (subject or object)
-"the red house"
+Cl
+declarative clause, with all tenses
+"she looks at this"
-Pron
-personal pronoun
-"she"
-
-
-Det
-determiner phrase
-"those seven"
-
-
-Predet
-predeterminer (prefixed Quant)
-"all"
-
-
-Quant
-quantifier with both sg and pl
-"this/these"
-
-
-Num
-cardinal number (used with QuantPl)
-"seven"
-
-
-Ord
-ordinal number (used in Det)
-"seventh"
+Comp
+complement of copula, such as AP
+"very warm"
Conj
@@ -268,64 +206,34 @@ Source 2: http://www.cs.chalmers.se/~aarne/GF
"both - and"
-Subj
-subjunction,
-"if"
+Det
+determiner phrase
+"those seven"
-Prep
-preposition, or just case
-"in"
+IAdv
+interrogative adverb
+"why"
-V
-one-place verb
-"sleep"
+IComp
+interrogative complement of copula
+"where"
-V2
-two-place verb
-"love"
+IDet
+interrogative determiner
+"which"
-V3
-three-place verb
-"show"
+IP
+interrogative pronoun
+"who"
-VV
-verb-phrase-complement verb
-"want"
-
-
-VS
-sentence-complement verb
-"claim"
-
-
-VQ
-question-complement verb
-"ask"
-
-
-VA
-adjective-complement verb
-"look"
-
-
-V2A
-verb with NP and AP complement
-"paint"
-
-
-A
-one-place adjective
-"warm"
-
-
-A2
-two-place adjective
-"divisible"
+Imp
+imperative
+"look at this"
N
@@ -343,17 +251,180 @@ Source 2: http://www.cs.chalmers.se/~aarne/GF
"connection"
+NP
+noun phrase (subject or object)
+"the red house"
+
+
+Num
+cardinal number (used with QuantPl)
+"seven"
+
+
+Ord
+ordinal number (used in Det)
+"seventh"
+
+
+PConj
+phrase-beginning conj.
+"therefore"
+
+
PN
proper name
"Paris"
+
+Phr
+phrase in a text
+"but be quiet please"
+
+
+Pol
+polarity
+positive, negative
+
+
+Predet
+predeterminer (prefixed Quant)
+"all"
+
+
+Prep
+preposition, or just case
+"in"
+
+
+Pron
+personal pronoun
+"she"
+
+
+QCl
+question clause, with all tenses
+"why does she walk"
+
+
+QS
+question
+"where did she live"
+
+
+Quant
+quantifier with both sg and pl
+"this/these"
+
+
+RCl
+relative clause, with all tenses
+"in which she lives"
+
+
+RP
+relative pronoun
+"in which"
+
+
+RS
+relative
+"in which she lived"
+
+
+S
+declarative sentence
+"she lived here"
+
+
+SC
+embedded sentence or question
+"that it rains"
+
+
+Slash
+clause missing NP (S/NP in GPSG)
+"she looks at"
+
+
+Subj
+subjunction,
+"if"
+
+
+Tense
+tense
+present, past, future
+
+
+Text
+text consisting of several phrases
+"He is here. Why?"
+
+
+Utt
+sentence, question, word...
+"be quiet"
+
+
+V
+one-place verb
+"sleep"
+
+
+V2
+two-place verb
+"love"
+
+
+V2A
+verb with NP and AP complement
+"paint"
+
+
+V3
+three-place verb
+"show"
+
+
+VA
+adjective-complement verb
+"look"
+
+
+VP
+verb phrase
+"is very warm"
+
+
+VQ
+question-complement verb
+"ask"
+
+
+VS
+sentence-complement verb
+"claim"
+
+
+VV
+verb-phrase-complement verb
+"want"
+
+
+Voc
+vocative or "please"
+"my darling"
+
-
+
+
Syntax Rules
Source: http://www.cs.chalmers.se/~aarne/GF/lib/resource/api/Constructors.gf
+
+AP
Function
@@ -361,164 +432,157 @@ Source: http://www.cs.chalmers.se/~aarne/
Example
-mkText
-Phr -> Text
-But John walks.
+mkAP
+A -> AP
+old
-mkText
-Phr -> (Punct) -> (Text) -> Text
-John walks? Yes.
+mkAP
+A -> NP -> AP
+older than John
-mkText
-Utt -> Text
-John.
+mkAP
+A2 -> NP -> AP
+married to her
-mkText
-S -> Text
-John walked.
+mkAP
+A2 -> AP
+married to myself
-mkText
-Cl -> Text
-John walks.
+mkAP
+AP -> S -> AP
+probable that John walks
-mkText
-QS -> Text
-Did John walk?
+mkAP
+AP -> QS -> AP
+uncertain if John walks
-mkText
-Imp -> Text
-Walk!
+mkAP
+AP -> VP -> AP
+ready to go
-emptyText
-Text
-(empty text)
+mkAP
+AdA -> A -> AP
+very old
-fullStopPunct
-Punct
-.
+mkAP
+AdA -> AP -> AP
+very very old
-questMarkPunct
-Punct
-?
+mkAP
+Conj -> AP -> AP -> AP
+old and big
-exclMarkPunct
-Punct
-!
+mkAP
+Conj -> ListAP -> AP
+old, big, and warm
-mkPhr
-Utt -> Phr
-why
+mkAP
+DConj -> AP -> AP -> AP
+either old or big
-mkPhr
-(PConj) -> Utt -> (Voc) -> Phr
-but why John
+mkAP
+DConj -> ListAP -> AP
+either old, big, or warm
+
+
+
+
+
+AdN
+
+
+Function
+Type
+Example
-mkPhr
-S -> Phr
-John walked
+mkAdN
+CAdv -> AdN
+more than
+
+
+
+
+
+Adv
+
+
+Function
+Type
+Example
-mkPhr
-Cl -> Phr
-John walks
+mkAdv
+A -> Adv
+warmly
-mkPhr
-QS -> Phr
-did John walk
+mkAdv
+Prep -> NP -> Adv
+with John
-mkPhr
-Imp -> Phr
-walk
+mkAdv
+Subj -> S -> Adv
+when John walks
-mkPConj
-Conj -> PConj
-and
+mkAdv
+CAdv -> A -> NP -> Adv
+more warmly than John
-mkVoc
-NP -> Voc
-John
+mkAdv
+CAdv -> A -> S -> Adv
+more warmly than John walks
-mkUtt
-S -> Utt
-John walked
+mkAdv
+AdA -> Adv -> Adv
+very warmly
-mkUtt
-Cl -> Utt
-John walks
+mkAdv
+Conj -> Adv -> Adv -> Adv
+here and now
-mkUtt
-QS -> Utt
-did John walk
+mkAdv
+Conj -> ListAdv -> Adv
+with John, here and now
-mkUtt
-Imp -> Utt
-love yourself
+mkAdv
+DConj -> Adv -> Adv -> Adv
+either here or now
-mkUtt
-(ImpForm) -> (Pol) -> Imp -> Utt
-don't love yourselves
+mkAdv
+DConj -> ListAdv -> Adv
+either here, now, or with John
+
+
+
+
+Ant
+
-mkUtt
-IP -> Utt
-who
-
-
-mkUtt
-IAdv -> Utt
-why
-
-
-mkUtt
-NP -> Utt
-John
-
-
-mkUtt
-Adv -> Utt
-here
-
-
-mkUtt
-VP -> Utt
-to walk
-
-
-lets_Utt
-VP -> Utt
-let's walk
-
-
-positivePol
-Pol
-(John walks) [default]
-
-
-negativePol
-Pol
-(John doesn't walk)
+Function
+Type
+Example
simultaneousAnt
@@ -530,75 +594,117 @@ Source: http://www.cs.chalmers.se/~aarne/
Ant
(John has walked) --# notpresent
+
+
+
+
+CN
+
-presentTense
-Tense
-(John walks) [default]
+Function
+Type
+Example
-pastTense
-Tense
-(John walked) --# notpresent
+mkCN
+N -> CN
+house
-futureTense
-Tense
-(John will walk) --# notpresent
+mkCN
+N2 -> NP -> CN
+mother of John
-conditionalTense
-Tense
-(John would walk) --# notpresent
+mkCN
+N3 -> NP -> NP -> CN
+distance from this city to Paris
-singularImpForm
-ImpForm
-(help yourself) [default]
+mkCN
+N2 -> CN
+son
-pluralImpForm
-ImpForm
-(help yourselves)
+mkCN
+N3 -> CN
+flight
-politeImpForm
-ImpForm
-(help yourself) (polite singular)
+mkCN
+A -> N -> CN
+big house
-mkS
-Cl -> S
-John walks
+mkCN
+A -> CN -> CN
+big blue house
-mkS
-(Tense) -> (Ant) -> (Pol) -> Cl -> S
-John wouldn't have walked
+mkCN
+AP -> N -> CN
+very big house
-mkS
-Conj -> S -> S -> S
-John walks and I run
+mkCN
+AP -> CN -> CN
+very big blue house
-mkS
-Conj -> ListS -> S
-John walks, I run and you sleep
+mkCN
+N -> RS -> CN
+house that John loves
-mkS
-DConj -> S -> S -> S
-either John walk or I run
+mkCN
+CN -> RS -> CN
+big house that John loves
-mkS
-DConj -> ListS -> S
-either John walks, I run or you sleep
+mkCN
+N -> Adv -> CN
+house in the city
-mkS
-Adv -> S -> S
-today, John walks
+mkCN
+CN -> Adv -> CN
+big house in the city
+
+
+mkCN
+CN -> S -> CN
+rule that John walks
+
+
+mkCN
+CN -> QS -> CN
+question if John walks
+
+
+mkCN
+CN -> VP -> CN
+reason to walk
+
+
+mkCN
+N -> NP -> CN
+king John
+
+
+mkCN
+CN -> NP -> CN
+old king John
+
+
+
+
+
+Cl
+
+
+Function
+Type
+Example
mkCl
@@ -725,6 +831,1107 @@ Source: http://www.cs.chalmers.se/~aarne/
VP -> Cl
one walks
+
+
+
+
+Det
+
+
+Function
+Type
+Example
+
+
+mkDet
+QuantSg -> Det
+this
+
+
+mkDet
+QuantSg -> (Ord) -> Det
+this first
+
+
+mkDet
+QuantPl -> Det
+these
+
+
+mkDet
+QuantPl -> (Num) -> (Ord) -> Det
+these five best
+
+
+mkDet
+Quant -> Det
+this
+
+
+mkDet
+Quant -> Num -> Det
+these five
+
+
+mkDet
+Num -> Det
+almost twenty
+
+
+mkDet
+Numeral -> Det
+five
+
+
+mkDet
+Int -> Det
+51
+
+
+mkDet
+Pron -> Det
+my
+
+
+defSgDet
+Det
+the (house)
+
+
+defPlDet
+Det
+the (houses)
+
+
+indefSgDet
+Det
+a (house)
+
+
+indefPlDet
+Det
+(houses)
+
+
+
+
+
+IAdv
+
+
+Function
+Type
+Example
+
+
+mkIAdv
+Prep -> IP -> IAdv
+in which city
+
+
+
+
+
+IP
+
+
+Function
+Type
+Example
+
+
+mkIP
+IDet -> N -> IP
+which city
+
+
+mkIP
+IDet -> (Num) -> (Ord) -> CN -> IP
+which five best cities
+
+
+mkIP
+IP -> Adv -> IP
+who in Paris
+
+
+
+
+
+Imp
+
+
+Function
+Type
+Example
+
+
+mkImp
+V -> Imp
+go
+
+
+mkImp
+V2 -> NP -> Imp
+take it
+
+
+mkImp
+VP -> Imp
+go there now
+
+
+
+
+
+ImpForm
+
+
+Function
+Type
+Example
+
+
+singularImpForm
+ImpForm
+(help yourself) [default]
+
+
+pluralImpForm
+ImpForm
+(help yourselves)
+
+
+politeImpForm
+ImpForm
+(help yourself) (polite singular)
+
+
+
+
+
+ListAP
+
+
+Function
+Type
+Example
+
+
+mkListAP
+AP -> AP -> ListAP
+old, big
+
+
+mkListAP
+AP -> ListAP -> ListAP
+old, big, warm
+
+
+
+
+
+ListAdv
+
+
+Function
+Type
+Example
+
+
+mkListAdv
+Adv -> Adv -> ListAdv
+here, now
+
+
+mkListAdv
+Adv -> ListAdv -> ListAdv
+to me, here, now
+
+
+
+
+
+ListNP
+
+
+Function
+Type
+Example
+
+
+mkListNP
+NP -> NP -> ListNP
+John, I
+
+
+mkListNP
+NP -> ListNP -> ListNP
+John, I, that
+
+
+
+
+
+ListS
+
+
+Function
+Type
+Example
+
+
+mkListS
+S -> S -> ListS
+he walks, I run
+
+
+mkListS
+S -> ListS -> ListS
+John walks, I run, you sleep
+
+
+
+
+
+NP
+
+
+Function
+Type
+Example
+
+
+mkNP
+Det -> N -> NP
+the first man
+
+
+mkNP
+Det -> CN -> NP
+the first old man
+
+
+mkNP
+QuantSg -> N -> NP
+this man
+
+
+mkNP
+QuantSg -> CN -> NP
+this old man
+
+
+mkNP
+QuantPl -> N -> NP
+these men
+
+
+mkNP
+QuantPl -> CN -> NP
+these old men
+
+
+mkNP
+Numeral -> N -> NP
+twenty men
+
+
+mkNP
+Numeral -> CN -> NP
+twenty old men
+
+
+mkNP
+Int -> N -> NP
+45 men
+
+
+mkNP
+Int -> CN -> NP
+45 old men
+
+
+mkNP
+Num -> N -> NP
+almost twenty men
+
+
+mkNP
+Num -> CN -> NP
+almost twenty old men
+
+
+mkNP
+Pron -> N -> NP
+my man
+
+
+mkNP
+Pron -> CN -> NP
+my old man
+
+
+mkNP
+PN -> NP
+John
+
+
+mkNP
+Pron -> NP
+he
+
+
+mkNP
+Predet -> NP -> NP
+only John
+
+
+mkNP
+NP -> V2 -> NP
+John killed
+
+
+mkNP
+NP -> Adv -> NP
+John in Paris
+
+
+mkNP
+Conj -> NP -> NP -> NP
+John and I
+
+
+mkNP
+Conj -> ListNP -> NP
+John, I, and that
+
+
+mkNP
+DConj -> NP -> NP -> NP
+either John or I
+
+
+mkNP
+DConj -> ListNP -> NP
+either John, I, or that
+
+
+
+
+
+Num
+
+
+Function
+Type
+Example
+
+
+mkNum
+Numeral -> Num
+twenty
+
+
+mkNum
+Int -> Num
+51
+
+
+mkNum
+AdN -> Num -> Num
+almost ten
+
+
+
+
+
+Numeral
+
+
+Function
+Type
+Example
+
+
+n1_Numeral
+Numeral
+one
+
+
+n2_Numeral
+Numeral
+two
+
+
+n3_Numeral
+Numeral
+three
+
+
+n4_Numeral
+Numeral
+four
+
+
+n5_Numeral
+Numeral
+five
+
+
+n6_Numeral
+Numeral
+six
+
+
+n7_Numeral
+Numeral
+seven
+
+
+n8_Numeral
+Numeral
+eight
+
+
+n9_Numeral
+Numeral
+nine
+
+
+n10_Numeral
+Numeral
+ten
+
+
+n20_Numeral
+Numeral
+twenty
+
+
+n100_Numeral
+Numeral
+hundred
+
+
+n1000_Numeral
+Numeral
+thousand
+
+
+
+
+
+Ord
+
+
+Function
+Type
+Example
+
+
+mkOrd
+Numeral -> Ord
+twentieth
+
+
+mkOrd
+Int -> Ord
+51st
+
+
+mkOrd
+A -> Ord
+best
+
+
+
+
+
+PConj
+
+
+Function
+Type
+Example
+
+
+mkPConj
+Conj -> PConj
+and
+
+
+
+
+
+Phr
+
+
+Function
+Type
+Example
+
+
+mkPhr
+Utt -> Phr
+why
+
+
+mkPhr
+(PConj) -> Utt -> (Voc) -> Phr
+but why John
+
+
+mkPhr
+S -> Phr
+John walked
+
+
+mkPhr
+Cl -> Phr
+John walks
+
+
+mkPhr
+QS -> Phr
+did John walk
+
+
+mkPhr
+Imp -> Phr
+walk
+
+
+
+
+
+Pol
+
+
+Function
+Type
+Example
+
+
+positivePol
+Pol
+(John walks) [default]
+
+
+negativePol
+Pol
+(John doesn't walk)
+
+
+
+
+
+Punct
+
+
+Function
+Type
+Example
+
+
+fullStopPunct
+Punct
+.
+
+
+questMarkPunct
+Punct
+?
+
+
+exclMarkPunct
+Punct
+!
+
+
+
+
+
+QCl
+
+
+Function
+Type
+Example
+
+
+mkQCl
+Cl -> QCl
+does John walk
+
+
+mkQCl
+IP -> VP -> QCl
+who walks
+
+
+mkQCl
+IP -> NP -> V2 -> QCl
+whom does John love
+
+
+mkQCl
+IP -> Slash -> QCl
+whom does John love today
+
+
+mkQCl
+IAdv -> Cl -> QCl
+why does John walk
+
+
+mkQCl
+Prep -> IP -> Cl -> QCl
+with who does John walk
+
+
+mkQCl
+IAdv -> NP -> QCl
+where is John
+
+
+mkQCl
+IP -> QCl
+what is there
+
+
+
+
+
+QS
+
+
+Function
+Type
+Example
+
+
+mkQS
+QCl -> QS
+who walks
+
+
+mkQS
+(Tense) -> (Ant) -> (Pol) -> QCl -> QS
+who wouldn't have walked
+
+
+mkQS
+Cl -> QS
+does John walk
+
+
+
+
+
+Quant
+
+
+Function
+Type
+Example
+
+
+defQuant
+Quant
+the
+
+
+indefQuant
+Quant
+a
+
+
+
+
+
+QuantPl
+
+
+Function
+Type
+Example
+
+
+mkQuantPl
+Quant -> QuantPl
+these
+
+
+the_QuantPl
+QuantPl
+the
+
+
+a_QuantPl
+QuantPl
+(indefinite plural)
+
+
+these_QuantPl
+QuantPl
+these
+
+
+those_QuantPl
+QuantPl
+those
+
+
+
+
+
+QuantSg
+
+
+Function
+Type
+Example
+
+
+mkQuantSg
+Quant -> QuantSg
+this
+
+
+massQuant
+QuantSg
+(mass terms)
+
+
+the_QuantSg
+QuantSg
+the
+
+
+a_QuantSg
+QuantSg
+a
+
+
+this_QuantSg
+QuantSg
+this
+
+
+that_QuantSg
+QuantSg
+that
+
+
+
+
+
+RCl
+
+
+Function
+Type
+Example
+
+
+mkRCl
+RP -> VP -> RCl
+that walk
+
+
+mkRCl
+RP -> NP -> V2 -> RCl
+which John loves
+
+
+mkRCl
+RP -> Slash -> RCl
+which John loves today
+
+
+mkRCl
+Cl -> RCl
+such that John loves her
+
+
+
+
+
+RP
+
+
+Function
+Type
+Example
+
+
+which_RP
+RP
+which
+
+
+mkRP
+Prep -> NP -> RP -> RP
+all the houses in which
+
+
+
+
+
+RS
+
+
+Function
+Type
+Example
+
+
+mkRS
+RCl -> RS
+that walk
+
+
+mkRS
+(Tense) -> (Ant) -> (Pol) -> RCl -> RS
+that wouldn't have walked
+
+
+
+
+
+S
+
+
+Function
+Type
+Example
+
+
+mkS
+Cl -> S
+John walks
+
+
+mkS
+(Tense) -> (Ant) -> (Pol) -> Cl -> S
+John wouldn't have walked
+
+
+mkS
+Conj -> S -> S -> S
+John walks and I run
+
+
+mkS
+Conj -> ListS -> S
+John walks, I run and you sleep
+
+
+mkS
+DConj -> S -> S -> S
+either John walk or I run
+
+
+mkS
+DConj -> ListS -> S
+either John walks, I run or you sleep
+
+
+mkS
+Adv -> S -> S
+today, John walks
+
+
+
+
+
+Slash
+
+
+Function
+Type
+Example
+
+
+mkSlash
+NP -> V2 -> Slash
+(whom) John loves
+
+
+mkSlash
+NP -> VV -> V2 -> Slash
+(whom) John wants to see
+
+
+mkSlash
+Cl -> Prep -> Slash
+(with whom) John walks
+
+
+mkSlash
+Slash -> Adv -> Slash
+(whom) John loves today
+
+
+
+
+
+Tense
+
+
+Function
+Type
+Example
+
+
+presentTense
+Tense
+(John walks) [default]
+
+
+pastTense
+Tense
+(John walked) --# notpresent
+
+
+futureTense
+Tense
+(John will walk) --# notpresent
+
+
+conditionalTense
+Tense
+(John would walk) --# notpresent
+
+
+
+
+
+Text
+
+
+Function
+Type
+Example
+
+
+mkText
+Phr -> Text
+But John walks.
+
+
+mkText
+Phr -> (Punct) -> (Text) -> Text
+John walks? Yes.
+
+
+mkText
+Utt -> Text
+John.
+
+
+mkText
+S -> Text
+John walked.
+
+
+mkText
+Cl -> Text
+John walks.
+
+
+mkText
+QS -> Text
+Did John walk?
+
+
+mkText
+Imp -> Text
+Walk!
+
+
+emptyText
+Text
+(empty text)
+
+
+
+
+
+Utt
+
+
+Function
+Type
+Example
+
+
+mkUtt
+S -> Utt
+John walked
+
+
+mkUtt
+Cl -> Utt
+John walks
+
+
+mkUtt
+QS -> Utt
+did John walk
+
+
+mkUtt
+Imp -> Utt
+love yourself
+
+
+mkUtt
+(ImpForm) -> (Pol) -> Imp -> Utt
+don't love yourselves
+
+
+mkUtt
+IP -> Utt
+who
+
+
+mkUtt
+IAdv -> Utt
+why
+
+
+mkUtt
+NP -> Utt
+John
+
+
+mkUtt
+Adv -> Utt
+here
+
+
+mkUtt
+VP -> Utt
+to walk
+
+
+lets_Utt
+VP -> Utt
+let's walk
+
+
+
+
+
+VP
+
+
+Function
+Type
+Example
+
mkVP
V -> VP
@@ -835,754 +2042,26 @@ Source: http://www.cs.chalmers.se/~aarne/
VP -> VP
be sleeping
+
+
+
+
+Voc
+
-mkImp
-V -> Imp
-go
+Function
+Type
+Example
-mkImp
-V2 -> NP -> Imp
-take it
-
-
-mkImp
-VP -> Imp
-go there now
-
-
-mkNP
-Det -> N -> NP
-the first man
-
-
-mkNP
-Det -> CN -> NP
-the first old man
-
-
-mkNP
-QuantSg -> N -> NP
-this man
-
-
-mkNP
-QuantSg -> CN -> NP
-this old man
-
-
-mkNP
-QuantPl -> N -> NP
-these men
-
-
-mkNP
-QuantPl -> CN -> NP
-these old men
-
-
-mkNP
-Numeral -> N -> NP
-twenty men
-
-
-mkNP
-Numeral -> CN -> NP
-twenty old men
-
-
-mkNP
-Int -> N -> NP
-45 men
-
-
-mkNP
-Int -> CN -> NP
-45 old men
-
-
-mkNP
-Num -> N -> NP
-almost twenty men
-
-
-mkNP
-Num -> CN -> NP
-almost twenty old men
-
-
-mkNP
-Pron -> N -> NP
-my man
-
-
-mkNP
-Pron -> CN -> NP;
-my old man
-
-
-mkNP
-PN -> NP
+mkVoc
+NP -> Voc
John
-
-mkNP
-Pron -> NP
-he
-
-
-mkNP
-Predet -> NP -> NP
-only John
-
-
-mkNP
-NP -> V2 -> NP
-John killed
-
-
-mkNP
-NP -> Adv -> NP
-John in Paris
-
-
-mkNP
-Conj -> NP -> NP -> NP
-John and I
-
-
-mkNP
-Conj -> ListNP -> NP
-John, I, and that
-
-
-mkNP
-DConj -> NP -> NP -> NP
-either John or I
-
-
-mkNP
-DConj -> ListNP -> NP
-either John, I, or that
-
-
-mkDet
-QuantSg -> Det
-this
-
-
-mkDet
-QuantSg -> (Ord) -> Det
-this first
-
-
-mkDet
-QuantPl -> Det
-these
-
-
-mkDet
-QuantPl -> (Num) -> (Ord) -> Det
-these five best
-
-
-mkDet
-Quant -> Det
-this
-
-
-mkDet
-Quant -> Num -> Det
-these five
-
-
-mkDet
-Num -> Det
-almost twenty
-
-
-mkDet
-Numeral -> Det
-five
-
-
-mkDet
-Int -> Det
-51
-
-
-mkDet
-Pron -> Det
-my
-
-
-defSgDet
-Det
-the (house)
-
-
-defPlDet
-Det
-the (houses)
-
-
-indefSgDet
-Det
-a (house)
-
-
-indefPlDet
-Det
-(houses)
-
-
-defQuant
-Quant
-the
-
-
-indefQuant
-Quant
-a
-
-
-mkQuantSg
-Quant -> QuantSg
-this
-
-
-massQuant
-QuantSg
-(mass terms)
-
-
-the_QuantSg
-QuantSg
-the
-
-
-a_QuantSg
-QuantSg
-a
-
-
-this_QuantSg
-QuantSg
-this
-
-
-that_QuantSg
-QuantSg
-that
-
-
-mkQuantPl
-Quant -> QuantPl
-these
-
-
-the_QuantPl
-QuantPl
-the
-
-
-a_QuantPl
-QuantPl
-(indefinite plural)
-
-
-these_QuantPl
-QuantPl
-these
-
-
-those_QuantPl
-QuantPl
-those
-
-
-mkNum
-Numeral -> Num
-twenty
-
-
-mkNum
-Int -> Num
-51
-
-
-mkNum
-AdN -> Num -> Num
-almost ten
-
-
-mkOrd
-Numeral -> Ord
-twentieth
-
-
-mkOrd
-Int -> Ord
-51st
-
-
-mkOrd
-A -> Ord
-best
-
-
-mkAdN
-CAdv -> AdN
-more than
-
-
-n1_Numeral
-Numeral
-one
-
-
-n2_Numeral
-Numeral
-two
-
-
-n3_Numeral
-Numeral
-three
-
-
-n4_Numeral
-Numeral
-four
-
-
-n5_Numeral
-Numeral
-five
-
-
-n6_Numeral
-Numeral
-six
-
-
-n7_Numeral
-Numeral
-seven
-
-
-n8_Numeral
-Numeral
-eight
-
-
-n9_Numeral
-Numeral
-nine
-
-
-n10_Numeral
-Numeral
-ten
-
-
-n20_Numeral
-Numeral
-twenty
-
-
-n100_Numeral
-Numeral
-hundred
-
-
-n1000_Numeral
-Numeral
-thousand
-
-
-mkCN
-N -> CN
-house
-
-
-mkCN
-N2 -> NP -> CN
-mother of John
-
-
-mkCN
-N3 -> NP -> NP -> CN
-distance from this city to Paris
-
-
-mkCN
-N2 -> CN
-son
-
-
-mkCN
-N3 -> CN
-flight
-
-
-mkCN
-A -> N -> CN
-big house
-
-
-mkCN
-A -> CN -> CN
-big blue house
-
-
-mkCN
-AP -> N -> CN
-very big house
-
-
-mkCN
-AP -> CN -> CN
-very big blue house
-
-
-mkCN
-N -> RS -> CN
-house that John loves
-
-
-mkCN
-CN -> RS -> CN
-big house that John loves
-
-
-mkCN
-N -> Adv -> CN
-house in the city
-
-
-mkCN
-CN -> Adv -> CN
-big house in the city
-
-
-mkCN
-CN -> S -> CN
-rule that John walks
-
-
-mkCN
-CN -> QS -> CN
-question if John walks
-
-
-mkCN
-CN -> VP -> CN
-reason to walk
-
-
-mkCN
-N -> NP -> CN
-king John
-
-
-mkCN
-CN -> NP -> CN
-old king John
-
-
-mkAP
-A -> AP
-old
-
-
-mkAP
-A -> NP -> AP
-older than John
-
-
-mkAP
-A2 -> NP -> AP
-married to her
-
-
-mkAP
-A2 -> AP
-married to myself
-
-
-mkAP
-AP -> S -> AP
-probable that John walks
-
-
-mkAP
-AP -> QS -> AP
-uncertain if John walks
-
-
-mkAP
-AP -> VP -> AP
-ready to go
-
-
-mkAP
-AdA -> A -> AP
-very old
-
-
-mkAP
-AdA -> AP -> AP
-very very old
-
-
-mkAP
-Conj -> AP -> AP -> AP
-old and big
-
-
-mkAP
-Conj -> ListAP -> AP
-old, big, and warm
-
-
-mkAP
-DConj -> AP -> AP -> AP
-either old or big
-
-
-mkAP
-DConj -> ListAP -> AP
-either old, big, or warm
-
-
-mkAdv
-A -> Adv
-warmly
-
-
-mkAdv
-Prep -> NP -> Adv
-with John
-
-
-mkAdv
-Subj -> S -> Adv
-when John walks
-
-
-mkAdv
-CAdv -> A -> NP -> Adv
-more warmly than John
-
-
-mkAdv
-CAdv -> A -> S -> Adv
-more warmly than John walks
-
-
-mkAdv
-AdA -> Adv -> Adv
-very warmly
-
-
-mkAdv
-Conj -> Adv -> Adv -> Adv
-here and now
-
-
-mkAdv
-Conj -> ListAdv -> Adv
-with John, here and now
-
-
-mkAdv
-DConj -> Adv -> Adv -> Adv
-either here or now
-
-
-mkAdv
-DConj -> ListAdv -> Adv
-either here, now, or with John
-
-
-mkQS
-QCl -> QS
-who walks
-
-
-mkQS
-(Tense) -> (Ant) -> (Pol) -> QCl -> QS
-who wouldn't have walked
-
-
-mkQS
-Cl -> QS
-does John walk
-
-
-mkQCl
-Cl -> QCl
-does John walk
-
-
-mkQCl
-IP -> VP -> QCl
-who walks
-
-
-mkQCl
-IP -> NP -> V2 -> QCl
-whom does John love
-
-
-mkQCl
-IP -> Slash -> QCl
-whom does John love today
-
-
-mkQCl
-IAdv -> Cl -> QCl
-why does John walk
-
-
-mkQCl
-Prep -> IP -> Cl -> QCl
-with who does John walk
-
-
-mkQCl
-IAdv -> NP -> QCl
-where is John
-
-
-mkQCl
-IP -> QCl
-what is there
-
-
-mkIP
-IDet -> N -> IP
-which city
-
-
-mkIP
-IDet -> (Num) -> (Ord) -> CN -> IP
-which five best cities
-
-
-mkIP
-IP -> Adv -> IP
-who in Paris
-
-
-mkIAdv
-Prep -> IP -> IAdv
-in which city
-
-
-mkRS
-RCl -> RS
-that walk
-
-
-mkRS
-(Tense) -> (Ant) -> (Pol) -> RCl -> RS
-that wouldn't have walked
-
-
-mkRCl
-RP -> VP -> RCl
-that walk
-
-
-mkRCl
-RP -> NP -> V2 -> RCl
-which John loves
-
-
-mkRCl
-RP -> Slash -> RCl
-which John loves today
-
-
-mkRCl
-Cl -> RCl
-such that John loves her
-
-
-which_RP
-RP
-which
-
-
-mkRP
-Prep -> NP -> RP -> RP
-all the houses in which
-
-
-mkSlash
-NP -> V2 -> Slash
-(whom) John loves
-
-
-mkSlash
-NP -> VV -> V2 -> Slash
-(whom) John wants to see
-
-
-mkSlash
-Cl -> Prep -> Slash
-(with whom) John walks
-
-
-mkSlash
-Slash -> Adv -> Slash
-(whom) John loves today
-
-
-mkListS
-S -> S -> ListS
-he walks, I run
-
-
-mkListS
-S -> ListS -> ListS
-John walks, I run, you sleep
-
-
-mkListAdv
-Adv -> Adv -> ListAdv
-here, now
-
-
-mkListAdv
-Adv -> ListAdv -> ListAdv
-to me, here, now
-
-
-mkListAP
-AP -> AP -> ListAP
-old, big
-
-
-mkListAP
-AP -> ListAP -> ListAP
-old, big, warm
-
-
-mkListNP
-NP -> NP -> ListNP
-John, I
-
-
-mkListNP
-NP -> ListNP -> ListNP
-John, I, that
-
-
+
+
Structural Words
Source: http://www.cs.chalmers.se/~aarne/GF/lib/resource/abstract/Structural.gf
@@ -1978,7 +2457,8 @@ Source: http://www.cs.chalmers.se/~aar
-
+
+
Paradigms for Danish
source http://www.cs.chalmers.se/~aarne/GF/lib/resource/danish/ParadigmsDan.gf
@@ -2222,7 +2702,8 @@ source http://www.cs.chalmers.se/~aarn
-
+
+
Paradigms for English
source http://www.cs.chalmers.se/~aarne/GF/lib/resource/english/ParadigmsEng.gf
@@ -2450,7 +2931,8 @@ source http://www.cs.chalmers.se/~aar
-
+
+
Paradigms for Finnish
source http://www.cs.chalmers.se/~aarne/GF/lib/resource/finnish/ParadigmsFin.gf
@@ -2786,7 +3268,8 @@ source http://www.cs.chalmers.se/~aar
-
+
+
Paradigms for French
source http://www.cs.chalmers.se/~aarne/GF/lib/resource/french/ParadigmsFre.gf
@@ -3014,7 +3497,8 @@ source http://www.cs.chalmers.se/~aarn
-
+
+
Paradigms for German
source http://www.cs.chalmers.se/~aarne/GF/lib/resource/german/ParadigmsGer.gf
@@ -3266,7 +3750,8 @@ source http://www.cs.chalmers.se/~aarn
-
+
+
Paradigms for Italian
source http://www.cs.chalmers.se/~aarne/GF/lib/resource/italian/ParadigmsIta.gf
@@ -3498,7 +3983,8 @@ source http://www.cs.chalmers.se/~aar
-
+
+
Paradigms for Norwegian
source http://www.cs.chalmers.se/~aarne/GF/lib/resource/norwegian/ParadigmsNor.gf
@@ -3742,7 +4228,8 @@ source http://www.cs.chalmers.se/~a
-
+
+
Paradigms for Russian
source http://www.cs.chalmers.se/~aarne/GF/lib/resource/russian/ParadigmsRus.gf
@@ -3982,7 +4469,8 @@ source http://www.cs.chalmers.se/~aar
-
+
+
Paradigms for Spanish
source http://www.cs.chalmers.se/~aarne/GF/lib/resource/spanish/ParadigmsSpa.gf
@@ -4218,7 +4706,8 @@ source http://www.cs.chalmers.se/~aar
-
+
+
Paradigms for Swedish
source http://www.cs.chalmers.se/~aarne/GF/lib/resource/swedish/ParadigmsSwe.gf
@@ -4458,7 +4947,8 @@ source http://www.cs.chalmers.se/~aar
-
+
+
Browsing the libraries with GF commands
All of the following assume
@@ -4488,7 +4978,7 @@ To view linearizations in all languages by parsing from English:
> p -cat=S -lang=LangEng "this grammar is too big" | tb
-
+
An Example of Usage
The standard way of building an application has the following modules.
@@ -4553,6 +5043,6 @@ For each language, an instantiation of the functor:
-
+