mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -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
|
||||
|
||||
fun
|
||||
noun_Category : Category ;
|
||||
adjective_Category : Category ;
|
||||
verb_Category : Category ;
|
||||
adverb_Category : Category ;
|
||||
noun_Category : Category ;
|
||||
adjective_Category : Category ;
|
||||
verb_Category : Category ;
|
||||
adverb_Category : Category ;
|
||||
preposition_Category : Category ;
|
||||
|
||||
number_ParameterType : ParameterType ;
|
||||
gender_ParameterType : ParameterType ;
|
||||
@@ -87,12 +88,25 @@ fun
|
||||
|
||||
nounHeading : N -> Heading ;
|
||||
|
||||
InflectionN : N -> Inflection ;
|
||||
InflectionA : A -> Inflection ;
|
||||
InflectionV : V -> Inflection ;
|
||||
InflectionV2 : V2 -> Inflection ;
|
||||
InflectionVV : VV -> Inflection ;
|
||||
InflectionN : N -> Inflection ;
|
||||
InflectionN2 : N2 -> Inflection ;
|
||||
InflectionN3 : N3 -> Inflection ;
|
||||
InflectionA : A -> 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
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ concrete DocumentationEng of Documentation = CatEng ** open
|
||||
ResEng,
|
||||
ParadigmsEng,
|
||||
(G = GrammarEng),
|
||||
(S = SyntaxEng),
|
||||
(L = LexiconEng),
|
||||
Prelude,
|
||||
HTML
|
||||
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) ++
|
||||
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" ex) ++
|
||||
frameTable (
|
||||
tr (th (heading infinitive_Parameter) ++ tdf (verb.s ! VInf)) ++
|
||||
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,
|
||||
(G = GrammarFin),
|
||||
(S = SyntaxFin),
|
||||
(L = LexiconFin),
|
||||
Prelude,
|
||||
HTML
|
||||
in {
|
||||
@@ -26,6 +27,7 @@ lin
|
||||
adjective_Category = mkN "adjektiivi" ;
|
||||
verb_Category = mkN "verbi" ;
|
||||
adverb_Category = mkN "adverbi" ;
|
||||
preposition_Category = mkN "prepositio" ;
|
||||
|
||||
singular_Parameter = mkN "yksikkö" ;
|
||||
plural_Parameter = mkN "monikko" ;
|
||||
@@ -119,7 +121,18 @@ lin
|
||||
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
|
||||
verb = sverb2verbSep verb0 ;
|
||||
vfin : VForm -> Str = \f ->
|
||||
@@ -133,6 +146,7 @@ lin
|
||||
in {
|
||||
s =
|
||||
heading1 (heading verb_Category) ++
|
||||
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" ex) ++
|
||||
heading2 "finiittimuodot" ++ ---
|
||||
frameTable (
|
||||
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" ;
|
||||
exampleGr_N = mkN "esimerkki" ;
|
||||
|
||||
}
|
||||
@@ -26,6 +26,8 @@ lin
|
||||
adjective_Category = mkN "adjectif" ;
|
||||
verb_Category = mkN "verbe" masculine ;
|
||||
|
||||
gender_ParameterType = mkN "genre" masculine ;
|
||||
|
||||
singular_Parameter = mkN "singulier" ;
|
||||
plural_Parameter = mkN "pluriel" ;
|
||||
|
||||
@@ -72,11 +74,11 @@ oper
|
||||
lin
|
||||
InflectionN noun = {
|
||||
s = heading1 (heading noun_Category) ++
|
||||
heading (nounGender noun) ++
|
||||
frameTable (
|
||||
paragraph (intag "b" (heading (gender_ParameterType)) ++ ":" ++ heading (nounGender noun)) ++
|
||||
paragraph (frameTable (
|
||||
tr (th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
|
||||
tr (tdf (noun.s ! Sg) ++ tdf (noun.s ! Pl))
|
||||
)
|
||||
))
|
||||
} ;
|
||||
|
||||
InflectionA adj = {
|
||||
@@ -88,11 +90,19 @@ lin
|
||||
)
|
||||
} ;
|
||||
|
||||
InflectionV v = inflectionVerb (S.mkUtt (S.mkCl S.she_NP (lin V v))).s v ;
|
||||
InflectionV2 v = inflectionVerb (S.mkUtt (S.mkCl S.she_NP (lin V2 v) S.something_NP)).s (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) ;
|
||||
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
|
||||
++ ";" ++ (S.mkUtt (S.mkS S.anteriorAnt cl)).s --# notpresent
|
||||
;
|
||||
|
||||
inflectionVerb : Str -> V -> {s : Str} = \ex,verb ->
|
||||
let
|
||||
vfin : VF -> Str = \f ->
|
||||
@@ -127,7 +137,7 @@ oper
|
||||
in {
|
||||
s =
|
||||
heading1 (heading verb_Category)
|
||||
++ paragraph (intag "b" "exemple :" ++ intag "i" ex)
|
||||
++ paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" ex)
|
||||
++ ttable gforms
|
||||
(tr (intagAttr "th" "colspan=2 rowspan=2" ""
|
||||
++ 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,
|
||||
ParadigmsGer,
|
||||
(G = GrammarGer),
|
||||
(S = SyntaxGer),
|
||||
(L = LexiconGer),
|
||||
Prelude,
|
||||
HTML
|
||||
in {
|
||||
@@ -22,6 +24,9 @@ lin
|
||||
noun_Category = mkN "Substantiv" ;
|
||||
adjective_Category = mkN "Adjektiv" ;
|
||||
verb_Category = mkN "Verb" ;
|
||||
preposition_Category = mkN "Präposition" ;
|
||||
|
||||
gender_ParameterType = mkN "Geschlecht" ;
|
||||
|
||||
singular_Parameter = mkN "Singular" ;
|
||||
plural_Parameter = mkN "Plural" ;
|
||||
@@ -59,9 +64,18 @@ lin
|
||||
oper
|
||||
tdf : Str -> Str = \s -> td (intag "i" 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
|
||||
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 (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)) ++
|
||||
@@ -92,7 +106,25 @@ lin
|
||||
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
|
||||
vfin : VForm -> Str = \f ->
|
||||
verb.s ! f ++ verb.prefix ;
|
||||
@@ -105,6 +137,7 @@ lin
|
||||
in {
|
||||
s =
|
||||
heading1 (heading verb_Category) ++
|
||||
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" ex) ++
|
||||
paragraph (frameTable (
|
||||
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") ++
|
||||
@@ -127,5 +160,7 @@ lin
|
||||
))
|
||||
} ;
|
||||
|
||||
lin
|
||||
exampleGr_N = mkN "Beispiel" "Beispiele" neuter ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user