mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 09:52:55 -06:00
added examples to the documentation of verbs and prepositions
This commit is contained in:
@@ -13,10 +13,11 @@ cat
|
|||||||
Modifier ; -- e.g. finite, transitive
|
Modifier ; -- e.g. finite, transitive
|
||||||
|
|
||||||
fun
|
fun
|
||||||
noun_Category : Category ;
|
noun_Category : Category ;
|
||||||
adjective_Category : Category ;
|
adjective_Category : Category ;
|
||||||
verb_Category : Category ;
|
verb_Category : Category ;
|
||||||
adverb_Category : Category ;
|
adverb_Category : Category ;
|
||||||
|
preposition_Category : Category ;
|
||||||
|
|
||||||
number_ParameterType : ParameterType ;
|
number_ParameterType : ParameterType ;
|
||||||
gender_ParameterType : ParameterType ;
|
gender_ParameterType : ParameterType ;
|
||||||
@@ -87,12 +88,25 @@ fun
|
|||||||
|
|
||||||
nounHeading : N -> Heading ;
|
nounHeading : N -> Heading ;
|
||||||
|
|
||||||
InflectionN : N -> Inflection ;
|
InflectionN : N -> Inflection ;
|
||||||
InflectionA : A -> Inflection ;
|
InflectionN2 : N2 -> Inflection ;
|
||||||
InflectionV : V -> Inflection ;
|
InflectionN3 : N3 -> Inflection ;
|
||||||
InflectionV2 : V2 -> Inflection ;
|
InflectionA : A -> Inflection ;
|
||||||
InflectionVV : VV -> Inflection ;
|
InflectionV : V -> Inflection ;
|
||||||
|
InflectionV2 : V2 -> Inflection ;
|
||||||
|
InflectionVV : VV -> Inflection ;
|
||||||
|
InflectionVS : VS -> Inflection ;
|
||||||
|
InflectionVQ : VQ -> Inflection ;
|
||||||
|
InflectionVA : VA -> Inflection ;
|
||||||
|
InflectionV3 : V3 -> Inflection ;
|
||||||
|
InflectionV2V : V2V -> Inflection ;
|
||||||
|
InflectionV2S : V2S -> Inflection ;
|
||||||
|
InflectionV2Q : V2Q -> Inflection ;
|
||||||
|
InflectionV2A : V2A -> Inflection ;
|
||||||
|
InflectionAdv : Adv -> Inflection ;
|
||||||
|
InflectionPrep : Prep -> Inflection ;
|
||||||
|
|
||||||
|
ExplainInflection : String -> Inflection -> Inflection ;
|
||||||
|
|
||||||
-- generic grammar terms
|
-- generic grammar terms
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ concrete DocumentationEng of Documentation = CatEng ** open
|
|||||||
ResEng,
|
ResEng,
|
||||||
ParadigmsEng,
|
ParadigmsEng,
|
||||||
(G = GrammarEng),
|
(G = GrammarEng),
|
||||||
|
(S = SyntaxEng),
|
||||||
|
(L = LexiconEng),
|
||||||
Prelude,
|
Prelude,
|
||||||
HTML
|
HTML
|
||||||
in {
|
in {
|
||||||
@@ -79,10 +81,19 @@ lin
|
|||||||
)
|
)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
InflectionV v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V v))) v ;
|
||||||
|
InflectionV2 v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V2 v) S.something_NP)) (lin V v) ;
|
||||||
|
--- InflectionVV v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin VV v) (S.mkVP (L.sleep_V)))) (lin V v) ;
|
||||||
|
InflectionV2V v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V2V v) S.we_NP (S.mkVP (L.sleep_V)))) (lin V v) ;
|
||||||
|
|
||||||
|
ExplainInflection e i = ss (i.s ++ paragraph e.s) ; -- explanation appended in a new paragraph
|
||||||
|
|
||||||
InflectionV, InflectionV2 = \verb -> {
|
oper
|
||||||
|
verbExample : Cl -> Str = \cl -> (S.mkUtt cl).s ;
|
||||||
|
|
||||||
|
inflectionVerb : Str -> V -> {s : Str} = \ex,verb -> {
|
||||||
s = heading1 (heading verb_Category) ++
|
s = heading1 (heading verb_Category) ++
|
||||||
|
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" ex) ++
|
||||||
frameTable (
|
frameTable (
|
||||||
tr (th (heading infinitive_Parameter) ++ tdf (verb.s ! VInf)) ++
|
tr (th (heading infinitive_Parameter) ++ tdf (verb.s ! VInf)) ++
|
||||||
tr (th (heading present_Parameter) ++ tdf (verb.s ! VPres)) ++
|
tr (th (heading present_Parameter) ++ tdf (verb.s ! VPres)) ++
|
||||||
@@ -92,5 +103,9 @@ lin
|
|||||||
)
|
)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
exampleGr_N = mkN "example" ;
|
||||||
|
formGr_N = mkN "form" ;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ concrete DocumentationFin of Documentation = CatFin ** open
|
|||||||
ParadigmsFin,
|
ParadigmsFin,
|
||||||
(G = GrammarFin),
|
(G = GrammarFin),
|
||||||
(S = SyntaxFin),
|
(S = SyntaxFin),
|
||||||
|
(L = LexiconFin),
|
||||||
Prelude,
|
Prelude,
|
||||||
HTML
|
HTML
|
||||||
in {
|
in {
|
||||||
@@ -26,6 +27,7 @@ lin
|
|||||||
adjective_Category = mkN "adjektiivi" ;
|
adjective_Category = mkN "adjektiivi" ;
|
||||||
verb_Category = mkN "verbi" ;
|
verb_Category = mkN "verbi" ;
|
||||||
adverb_Category = mkN "adverbi" ;
|
adverb_Category = mkN "adverbi" ;
|
||||||
|
preposition_Category = mkN "prepositio" ;
|
||||||
|
|
||||||
singular_Parameter = mkN "yksikkö" ;
|
singular_Parameter = mkN "yksikkö" ;
|
||||||
plural_Parameter = mkN "monikko" ;
|
plural_Parameter = mkN "monikko" ;
|
||||||
@@ -119,7 +121,18 @@ lin
|
|||||||
inflectionN (\nf -> (snoun2nounSep {s = \\f => adj.s ! Superl ! sAN f ; h = adj.h}).s ! nf)
|
inflectionN (\nf -> (snoun2nounSep {s = \\f => adj.s ! Superl ! sAN f ; h = adj.h}).s ! nf)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV, InflectionV2 = \verb0 ->
|
|
||||||
|
InflectionV v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V v))) v ;
|
||||||
|
InflectionV2 v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V2 v) S.something_NP)) (lin V v) ;
|
||||||
|
InflectionVV v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin VV v) (S.mkVP (L.sleep_V)))) (lin V v) ;
|
||||||
|
InflectionV2V v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V2V v) S.we_NP (S.mkVP (L.sleep_V)))) (lin V v) ;
|
||||||
|
|
||||||
|
ExplainInflection e i = ss (i.s ++ paragraph e.s) ; -- explanation appended in a new paragraph
|
||||||
|
|
||||||
|
oper
|
||||||
|
verbExample : Cl -> Str = \cl -> (S.mkUtt cl).s ;
|
||||||
|
|
||||||
|
inflectionVerb : Str -> V -> {s : Str} = \ex,verb0 ->
|
||||||
let
|
let
|
||||||
verb = sverb2verbSep verb0 ;
|
verb = sverb2verbSep verb0 ;
|
||||||
vfin : VForm -> Str = \f ->
|
vfin : VForm -> Str = \f ->
|
||||||
@@ -133,6 +146,7 @@ lin
|
|||||||
in {
|
in {
|
||||||
s =
|
s =
|
||||||
heading1 (heading verb_Category) ++
|
heading1 (heading verb_Category) ++
|
||||||
|
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" ex) ++
|
||||||
heading2 "finiittimuodot" ++ ---
|
heading2 "finiittimuodot" ++ ---
|
||||||
frameTable (
|
frameTable (
|
||||||
tr (intagAttr "th" "rowspan=2" "" ++
|
tr (intagAttr "th" "rowspan=2" "" ++
|
||||||
@@ -213,6 +227,15 @@ lin
|
|||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
InflectionPrep p = {
|
||||||
|
s = heading1 (heading preposition_Category) ++
|
||||||
|
paragraph (intag "b" (heading exampleGr_N ++ ":") ++
|
||||||
|
intag "i" ((S.mkAdv (lin Prep p) S.it_NP).s ++ ";" ++ (S.mkAdv (lin Prep p) S.we_NP).s))
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
formGF_N = mkN "muoto" ;
|
formGF_N = mkN "muoto" ;
|
||||||
|
exampleGr_N = mkN "esimerkki" ;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -26,6 +26,8 @@ lin
|
|||||||
adjective_Category = mkN "adjectif" ;
|
adjective_Category = mkN "adjectif" ;
|
||||||
verb_Category = mkN "verbe" masculine ;
|
verb_Category = mkN "verbe" masculine ;
|
||||||
|
|
||||||
|
gender_ParameterType = mkN "genre" masculine ;
|
||||||
|
|
||||||
singular_Parameter = mkN "singulier" ;
|
singular_Parameter = mkN "singulier" ;
|
||||||
plural_Parameter = mkN "pluriel" ;
|
plural_Parameter = mkN "pluriel" ;
|
||||||
|
|
||||||
@@ -72,11 +74,11 @@ oper
|
|||||||
lin
|
lin
|
||||||
InflectionN noun = {
|
InflectionN noun = {
|
||||||
s = heading1 (heading noun_Category) ++
|
s = heading1 (heading noun_Category) ++
|
||||||
heading (nounGender noun) ++
|
paragraph (intag "b" (heading (gender_ParameterType)) ++ ":" ++ heading (nounGender noun)) ++
|
||||||
frameTable (
|
paragraph (frameTable (
|
||||||
tr (th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
|
tr (th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
|
||||||
tr (tdf (noun.s ! Sg) ++ tdf (noun.s ! Pl))
|
tr (tdf (noun.s ! Sg) ++ tdf (noun.s ! Pl))
|
||||||
)
|
))
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionA adj = {
|
InflectionA adj = {
|
||||||
@@ -88,11 +90,19 @@ lin
|
|||||||
)
|
)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV v = inflectionVerb (S.mkUtt (S.mkCl S.she_NP (lin V v))).s v ;
|
InflectionV v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V v))) v ;
|
||||||
InflectionV2 v = inflectionVerb (S.mkUtt (S.mkCl S.she_NP (lin V2 v) S.something_NP)).s (lin V v) ;
|
InflectionV2 v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V2 v) S.something_NP)) (lin V v) ;
|
||||||
InflectionVV v = inflectionVerb (S.mkUtt (S.mkCl S.she_NP (lin VV v) (S.mkVP (L.sleep_V)))).s (lin V v) ;
|
InflectionVV v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin VV v) (S.mkVP (L.sleep_V)))) (lin V v) ;
|
||||||
|
InflectionV2V v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V2V v) S.we_NP (S.mkVP (L.sleep_V)))) (lin V v) ;
|
||||||
|
|
||||||
|
ExplainInflection e i = ss (i.s ++ paragraph e.s) ; -- explanation appended in a new paragraph
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
verbExample : Cl -> Str = \cl ->
|
||||||
|
(S.mkUtt cl).s
|
||||||
|
++ ";" ++ (S.mkUtt (S.mkS S.anteriorAnt cl)).s --# notpresent
|
||||||
|
;
|
||||||
|
|
||||||
inflectionVerb : Str -> V -> {s : Str} = \ex,verb ->
|
inflectionVerb : Str -> V -> {s : Str} = \ex,verb ->
|
||||||
let
|
let
|
||||||
vfin : VF -> Str = \f ->
|
vfin : VF -> Str = \f ->
|
||||||
@@ -127,7 +137,7 @@ oper
|
|||||||
in {
|
in {
|
||||||
s =
|
s =
|
||||||
heading1 (heading verb_Category)
|
heading1 (heading verb_Category)
|
||||||
++ paragraph (intag "b" "exemple :" ++ intag "i" ex)
|
++ paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" ex)
|
||||||
++ ttable gforms
|
++ ttable gforms
|
||||||
(tr (intagAttr "th" "colspan=2 rowspan=2" ""
|
(tr (intagAttr "th" "colspan=2 rowspan=2" ""
|
||||||
++ intagAttr "th" "colspan=2" (heading present_Parameter)
|
++ intagAttr "th" "colspan=2" (heading present_Parameter)
|
||||||
@@ -153,4 +163,8 @@ oper
|
|||||||
)
|
)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
exampleGr_N = mkN "exemple" masculine ;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@ concrete DocumentationGer of Documentation = CatGer ** open
|
|||||||
ResGer,
|
ResGer,
|
||||||
ParadigmsGer,
|
ParadigmsGer,
|
||||||
(G = GrammarGer),
|
(G = GrammarGer),
|
||||||
|
(S = SyntaxGer),
|
||||||
|
(L = LexiconGer),
|
||||||
Prelude,
|
Prelude,
|
||||||
HTML
|
HTML
|
||||||
in {
|
in {
|
||||||
@@ -22,6 +24,9 @@ lin
|
|||||||
noun_Category = mkN "Substantiv" ;
|
noun_Category = mkN "Substantiv" ;
|
||||||
adjective_Category = mkN "Adjektiv" ;
|
adjective_Category = mkN "Adjektiv" ;
|
||||||
verb_Category = mkN "Verb" ;
|
verb_Category = mkN "Verb" ;
|
||||||
|
preposition_Category = mkN "Präposition" ;
|
||||||
|
|
||||||
|
gender_ParameterType = mkN "Geschlecht" ;
|
||||||
|
|
||||||
singular_Parameter = mkN "Singular" ;
|
singular_Parameter = mkN "Singular" ;
|
||||||
plural_Parameter = mkN "Plural" ;
|
plural_Parameter = mkN "Plural" ;
|
||||||
@@ -59,9 +64,18 @@ lin
|
|||||||
oper
|
oper
|
||||||
tdf : Str -> Str = \s -> td (intag "i" s) ;
|
tdf : Str -> Str = \s -> td (intag "i" s) ;
|
||||||
heading : N -> Str = \n -> (nounHeading n).s ;
|
heading : N -> Str = \n -> (nounHeading n).s ;
|
||||||
|
|
||||||
|
nounGender : N -> Parameter = \n -> case n.g of {
|
||||||
|
Masc => masculine_Parameter ;
|
||||||
|
Fem => feminine_Parameter ;
|
||||||
|
Neutr => neuter_Parameter
|
||||||
|
} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
InflectionN noun = {
|
InflectionN noun = {
|
||||||
s = heading1 (heading noun_Category) ++ frameTable (
|
s = heading1 (heading noun_Category) ++
|
||||||
|
paragraph (intag "b" (heading (gender_ParameterType)) ++ ":" ++ heading (nounGender noun)) ++
|
||||||
|
frameTable (
|
||||||
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
|
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
|
||||||
tr (th (heading nominative_Parameter) ++ tdf (noun.s ! Sg ! Nom) ++ tdf (noun.s ! Pl ! Nom)) ++
|
tr (th (heading nominative_Parameter) ++ tdf (noun.s ! Sg ! Nom) ++ tdf (noun.s ! Pl ! Nom)) ++
|
||||||
tr (th (heading genitive_Parameter) ++ tdf (noun.s ! Sg ! Gen) ++ tdf (noun.s ! Pl ! Gen)) ++
|
tr (th (heading genitive_Parameter) ++ tdf (noun.s ! Sg ! Gen) ++ tdf (noun.s ! Pl ! Gen)) ++
|
||||||
@@ -92,7 +106,25 @@ lin
|
|||||||
dtable positive_Parameter Posit ++ dtable comparative_Parameter Compar ++ dtable superlative_Parameter Superl ;
|
dtable positive_Parameter Posit ++ dtable comparative_Parameter Compar ++ dtable superlative_Parameter Superl ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV, InflectionV2 = \verb ->
|
InflectionV v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V v))) v ;
|
||||||
|
InflectionV2 v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V2 v) S.something_NP)) (lin V v) ;
|
||||||
|
InflectionVV v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin VV v) (S.mkVP (L.sleep_V)))) (lin V v) ;
|
||||||
|
InflectionV2V v = inflectionVerb (verbExample (S.mkCl S.she_NP (lin V2V v) S.we_NP (S.mkVP (L.sleep_V)))) (lin V v) ;
|
||||||
|
|
||||||
|
InflectionPrep p = {
|
||||||
|
s = heading1 (heading preposition_Category) ++
|
||||||
|
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" (S.mkAdv (lin Prep p) (S.mkNP S.a_Det L.computer_N)).s)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ExplainInflection e i = ss (i.s ++ paragraph e.s) ; -- explanation appended in a new paragraph
|
||||||
|
|
||||||
|
oper
|
||||||
|
verbExample : Cl -> Str = \cl ->
|
||||||
|
(S.mkUtt cl).s
|
||||||
|
++ ";" ++ (S.mkUtt (S.mkS S.anteriorAnt cl)).s --# notpresent
|
||||||
|
;
|
||||||
|
|
||||||
|
inflectionVerb : Str -> V -> {s : Str} = \ex,verb ->
|
||||||
let
|
let
|
||||||
vfin : VForm -> Str = \f ->
|
vfin : VForm -> Str = \f ->
|
||||||
verb.s ! f ++ verb.prefix ;
|
verb.s ! f ++ verb.prefix ;
|
||||||
@@ -105,6 +137,7 @@ lin
|
|||||||
in {
|
in {
|
||||||
s =
|
s =
|
||||||
heading1 (heading verb_Category) ++
|
heading1 (heading verb_Category) ++
|
||||||
|
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" ex) ++
|
||||||
paragraph (frameTable (
|
paragraph (frameTable (
|
||||||
tr (th "" ++ intagAttr "th" "colspan=2" (heading present_Parameter) ++ intagAttr "th" "colspan=2" (heading past_Parameter)) ++
|
tr (th "" ++ intagAttr "th" "colspan=2" (heading present_Parameter) ++ intagAttr "th" "colspan=2" (heading past_Parameter)) ++
|
||||||
tr (th "" ++ th (heading indicative_Parameter) ++ th (heading conjunctive_Parameter ++ "I") ++
|
tr (th "" ++ th (heading indicative_Parameter) ++ th (heading conjunctive_Parameter ++ "I") ++
|
||||||
@@ -127,5 +160,7 @@ lin
|
|||||||
))
|
))
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
exampleGr_N = mkN "Beispiel" "Beispiele" neuter ;
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user