From d9686ef5cbfb99419911f290ec55120a647b8eb2 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 14 Mar 2014 08:36:10 +0000 Subject: [PATCH] documentation files for Spa (terminology to be checked; verb forms not shared in Romance missing) --- lib/src/spanish/AllSpa.gf | 2 +- lib/src/spanish/DocumentationSpa.gf | 6 + lib/src/spanish/DocumentationSpaFunctor.gf | 218 +++++++++++++++++++++ lib/src/spanish/TerminologySpa.gf | 67 +++++++ 4 files changed, 292 insertions(+), 1 deletion(-) create mode 100644 lib/src/spanish/DocumentationSpa.gf create mode 100644 lib/src/spanish/DocumentationSpaFunctor.gf create mode 100644 lib/src/spanish/TerminologySpa.gf diff --git a/lib/src/spanish/AllSpa.gf b/lib/src/spanish/AllSpa.gf index 4aa98fd55..2d93fe31e 100644 --- a/lib/src/spanish/AllSpa.gf +++ b/lib/src/spanish/AllSpa.gf @@ -1,4 +1,4 @@ ---# -path=.:../romance:../abstract:../common:prelude +--# -path=.:../romance:../abstract:../common:../api concrete AllSpa of AllSpaAbs = LangSpa, diff --git a/lib/src/spanish/DocumentationSpa.gf b/lib/src/spanish/DocumentationSpa.gf new file mode 100644 index 000000000..6b755b830 --- /dev/null +++ b/lib/src/spanish/DocumentationSpa.gf @@ -0,0 +1,6 @@ +--# -path=.:../abstract:../common + +-- documentation of Spanish in Spanish: the default introduced in LangSpa + +concrete DocumentationSpa of Documentation = CatSpa ** + DocumentationSpaFunctor with (Terminology = TerminologySpa) ; diff --git a/lib/src/spanish/DocumentationSpaFunctor.gf b/lib/src/spanish/DocumentationSpaFunctor.gf new file mode 100644 index 000000000..b575b8ca8 --- /dev/null +++ b/lib/src/spanish/DocumentationSpaFunctor.gf @@ -0,0 +1,218 @@ +--# -path=.:../abstract:../common + +incomplete concrete DocumentationSpaFunctor of Documentation = CatSpa ** open + Terminology, -- the interface to be instantiated + ResSpa, + CommonRomance, + ParadigmsSpa, + (G = GrammarSpa), + (S = SyntaxSpa), + (L = LexiconSpa), + Prelude, + HTML +in { + + +lincat + Inflection = {t : Str; s1,s2 : Str} ; + Document = {s : Str} ; + Tag = {s : Str} ; + +{- +-} --# notpresent + +oper + heading : N -> Str = \n -> (nounHeading n).s ; + +lin + InflectionN, InflectionN3, InflectionN3 = \noun -> { + t = "n" ; + s1 = heading1 (heading noun_Category ++ + case noun.g of { + Masc => "("+heading masculine_Parameter+")" ; + Fem => "("+heading feminine_Parameter+")" + }) ; + s2 = frameTable ( + tr (th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++ + tr (td (noun.s ! Sg) ++ td (noun.s ! Pl)) + ) + } ; + + InflectionA, InflectionA2 = \adj -> { + t = "a" ; + s1 = heading1 (nounHeading adjective_Category).s ; + s2 = frameTable ( + tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++ + tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (AF Masc Sg)) ++ td (adj.s ! Posit ! (AF Masc Pl))) ++ + tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (AF Fem Sg)) ++ td (adj.s ! Posit ! (AF Fem Pl))) + ) + } ; + + InflectionAdv adv = { + t = "adv" ; + s1 = heading1 "Adverbe" ; + s2 = paragraph adv.s + } ; + + InflectionPrep p = { + t = "prep" ; + s1 = heading1 "Préposition" ; + s2 = paragraph p.s + } ; + + InflectionV v = { + t = "v" ; + s1 = heading1 (heading verb_Category) ++ + paragraph (verbExample (S.mkCl S.she_NP v)) ; + s2 = inflVerb v + } ; + + InflectionV2 v = { + t = "v" ; + s1 = heading1 (heading verb_Category) ++ + paragraph (verbExample (S.mkCl S.she_NP v S.something_NP)) ; + s2 = inflVerb v + } ; + + InflectionV3 v = { + t = "v" ; + s1 = heading1 (heading verb_Category) ++ + paragraph (verbExample (S.mkCl S.she_NP v S.something_NP S.something_NP)) ; + s2 = inflVerb v + } ; + + InflectionV2V v = { + t = "v" ; + s1 = heading1 (heading verb_Category) ++ + paragraph (verbExample (S.mkCl S.she_NP (lin V2V v) S.we_NP (S.mkVP (L.sleep_V)))) ; + s2 = inflVerb v + } ; + + InflectionV2S v = { + t = "v" ; + s1 = heading1 (heading verb_Category) ; + s2 = inflVerb v + } ; + + InflectionV2Q v = { + t = "v" ; + s1 = heading1 (heading verb_Category) ; + s2 = inflVerb v + } ; + + InflectionV2A v = { + t = "v" ; + s1 = heading1 "Verb" ; + s2 = inflVerb v + } ; + + InflectionVV v = { + t = "v" ; + s1 = heading1 (heading verb_Category) ++ + paragraph (verbExample (S.mkCl S.she_NP v (S.mkVP (L.sleep_V)))) ; + s2 = inflVerb v + } ; + + InflectionVS v = { + t = "v" ; + s1 = heading1 "Verb" ; + s2 = inflVerb v + } ; + + InflectionVQ v = { + t = "v" ; + s1 = heading1 "Verb" ; + s2 = inflVerb v + } ; + + InflectionVA v = { + t = "v" ; + s1 = heading1 "Verb" ; + s2 = inflVerb v + } ; + + MkDocument b i e = ss (i.s1 ++ paragraph b.s ++ i.s2 ++ paragraph e.s) ; -- explanation appended in a new paragraph + MkTag i = ss i.t ; + +oper + verbExample : CatSpa.Cl -> Str = \cl -> + (S.mkUtt cl).s + ++ ";" ++ (S.mkUtt (S.mkS S.anteriorAnt cl)).s --# notpresent + ; + + inflVerb : Verb -> Str = \verb -> + let + vfin : CommonRomance.VF -> Str = \f -> + verb.s ! f ; + + ttable : TMood -> Str = \tense -> + frameTable ( + tr (th "" ++ + th (heading singular_Parameter) ++ + th (heading plural_Parameter)) ++ + tr (th "1.p" ++ + td (vfin (VFin tense Sg P1)) ++ + td (vfin (VFin tense Pl P1))) ++ + tr (th "2.p" ++ + td (vfin (VFin tense Sg P2)) ++ + td (vfin (VFin tense Pl P2))) ++ + tr (th "3.p" ++ + td (vfin (VFin tense Sg P3)) ++ + td (vfin (VFin tense Pl P3))) + ) ; + + ttable2 : (Mood -> TMood) -> Str = \f -> + frameTable ( + tr (intagAttr "th" "colspan=2" "" ++ + th (heading indicative_Parameter) ++ + th (heading conjunctive_Parameter)) ++ + tr (intagAttr "th" "rowspan=3" (heading singular_Parameter) ++ + th "1.p" ++ + td (vfin (VFin (f Indic) Sg P1)) ++ + td (vfin (VFin (f Conjunct) Sg P1))) ++ + tr (th "2.p" ++ + td (vfin (VFin (f Indic) Sg P2)) ++ + td (vfin (VFin (f Conjunct) Sg P2))) ++ + tr (th "3.p" ++ + td (vfin (VFin (f Indic) Sg P3)) ++ + td (vfin (VFin (f Conjunct) Sg P3))) ++ + tr (intagAttr "th" "rowspan=3" (heading plural_Parameter) ++ + th "1.p" ++ + td (vfin (VFin (f Indic) Pl P1)) ++ + td (vfin (VFin (f Conjunct) Pl P1))) ++ + tr (th "2.p" ++ + td (vfin (VFin (f Indic) Pl P2)) ++ + td (vfin (VFin (f Conjunct) Pl P2))) ++ + tr (th "3.p" ++ + td (vfin (VFin (f Indic) Pl P3)) ++ + td (vfin (VFin (f Conjunct) Pl P3))) + ) ; + + in heading2 (heading present_Parameter) ++ + ttable2 VPres ++ + heading2 (heading imperfect_Parameter) ++ + ttable2 VImperf + ++ heading2 (heading simple_past_Parameter) ++ --# notpresent + ttable VPasse --# notpresent + ++ heading2 (heading future_Parameter) ++ --# notpresent + ttable VFut --# notpresent + ++ heading2 (heading conditional_Parameter) ++ --# notpresent + ttable VCondit --# notpresent + ++ heading2 (heading infinitive_Parameter) ++ + paragraph (vfin (VInfin False)) ++ + heading2 (heading imperative_Parameter) ++ + frameTable ( + tr (th "sg.2.p" ++ td (vfin (VImper SgP2))) ++ + tr (th "pl.1.p" ++ td (vfin (VImper PlP1))) ++ + tr (th "pl.2.p" ++ td (vfin (VImper PlP2))) + ) ++ + heading2 (heading participle_Parameter) ++ + frameTable ( + tr (th (heading past_Parameter) ++ td (vfin (VPart Masc Sg))) ++ + tr (th (heading present_Parameter) ++ td (vfin VGer)) + ) ; + +{- --# notpresent +-} + +} diff --git a/lib/src/spanish/TerminologySpa.gf b/lib/src/spanish/TerminologySpa.gf new file mode 100644 index 000000000..78c7e7384 --- /dev/null +++ b/lib/src/spanish/TerminologySpa.gf @@ -0,0 +1,67 @@ +--# -path=.:../abstract:../common + +concrete TerminologySpa of Terminology = CatSpa ** open + ResSpa, + CommonRomance, + ParadigmsSpa, + (G = GrammarSpa), + (S = SyntaxSpa), + (L = LexiconSpa), + Prelude + +in { + + +lincat + Category = G.N ; + ParameterType = G.N ; + Parameter = G.N ; + + Heading = {s : Str} ; + + +lin + noun_Category = mkN "sustantivo" ; + adjective_Category = mkN "adjetivo" ; + verb_Category = mkN "verbo" masculine ; + + gender_ParameterType = mkN "género" masculine ; + + singular_Parameter = mkN "singular" ; + plural_Parameter = mkN "plural" ; + + masculine_Parameter = mkN "masculino" ; + feminine_Parameter = mkN "femenino" ; + neuter_Parameter = mkN "neutro" ; + + nominative_Parameter = mkN "nominativo" ; + genitive_Parameter = mkN "genitivo" ; + dative_Parameter = mkN "dativo" ; + accusative_Parameter = mkN "accusativo" ; + + imperative_Parameter = mkN "imperativo" ; + indicative_Parameter = mkN "indicativo" ; + conjunctive_Parameter = mkN "subjuntivo" ; + infinitive_Parameter = mkN "infinitivo" ; + + present_Parameter = mkN "presente" ; + past_Parameter = mkN "pretérito" ; + future_Parameter = mkN "futuro" ; + conditional_Parameter = mkN "condicional" ; + perfect_Parameter = mkN "perfecto compuesto" ; ---- + imperfect_Parameter = mkN "imperfecto" ; + simple_past_Parameter = mkN "perfecto simple" ; ---- + + participle_Parameter = mkN "participio" ; + aux_verb_Parameter = mkN "auxiliar" ; ---- + + positive_Parameter = mkN "positivo" ; + comparative_Parameter = mkN "comparativo" ; + superlative_Parameter = mkN "superlativo" ; + predicative_Parameter = mkN "predicativo" ; + + nounHeading n = ss (n.s ! Sg) ; + + exampleGr_N = mkN "ejemplo" masculine ; + +} \ No newline at end of file