add DocumentationEst

This commit is contained in:
inari
2014-10-17 10:39:19 +00:00
parent 942c244c3b
commit e3c7b1e9fa
5 changed files with 442 additions and 0 deletions

View File

@@ -0,0 +1,148 @@
--# -path=alltenses:.:../abstract
concrete ConstructionEst of Construction = CatEst **
open SyntaxEst, SymbolicEst, ParadigmsEst, (L = LexiconEst), (E = ExtraEst), (R = ResEst), Prelude in {
flags coding=utf8 ;
lin
hungry_VP = mkVP have_V2 (lin NP (mkNP (mkPN "kõht tühi"))) ;
thirsty_VP = mkVP have_V2 (lin NP (mkNP (ParadigmsEst.mkN "janu"))) ;
has_age_VP card = mkVP (mkAP (lin AdA (mkUtt (lin NP (mkNP <lin Card card : Card> L.year_N)))) L.old_A) ;
have_name_Cl x y = mkCl (mkNP (E.GenNP x) L.name_N) (lin NP y) ;
married_Cl x y = mkCl (mkNP and_Conj (lin NP x) (lin NP y)) (ParadigmsEst.mkAdv "abielus") ;
what_name_QCl x = mkQCl (mkIComp whatSg_IP) (mkNP (E.GenNP x) L.name_N) ;
how_old_QCl x = mkQCl (E.ICompAP (mkAP L.old_A)) (lin NP x) ;
how_far_QCl x = mkQCl (E.IAdvAdv L.far_Adv) (lin NP x) ;
-- some more things
weather_adjCl ap = mkCl (mkVP (lin AP ap)) ;
is_right_VP = mkVP have_V2 (lin NP (mkNP (ParadigmsEst.mkN "õigus"))) ;
is_wrong_VP = mkVP (ParadigmsEst.mkV "eksima") ;
n_units_AP card cn a = mkAP (lin AdA (mkUtt (lin NP (mkNP <lin Card card : Card> (lin CN cn))))) (lin A a) ;
{-
glass_of_CN np = mkCN (lin N2 (mkN2 (mkN "klaas") (mkPrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "klaasitäis") (mkPrep partitive))) (lin NP np) ;
where_go_QCl np = mkQCl (lin IAdv (ss "kuhu")) (mkCl np (mkVP L.go_V)) ;
where_come_from_QCl np = mkQCl (lin IAdv (ss "kust")) (mkCl np (mkVP L.come_V)) ;
go_here_VP = mkVP (mkVP L.go_V) (mkAdv "siia") ;
come_here_VP = mkVP (mkVP L.come_V) (mkAdv "siia") ;
come_from_here_VP = mkVP (mkVP L.come_V) (mkAdv "sealt") ;
go_there_VP = mkVP (mkVP L.go_V) (mkAdv "siia") ;
come_there_VP = mkVP (mkVP L.come_V) (mkAdv "siia") ;
come_from_there_VP = mkVP (mkVP L.come_V) (mkAdv "sealt") ;
-}
lincat
Weekday = {noun : N ; habitual : SyntaxEst.Adv} ;
Monthday = NP ;
Month = N ;
Year = NP ;
lin
weekdayPunctualAdv w = lin Adv {s = pointWeekday w} ;
weekdayHabitualAdv w = w.habitual ;
weekdayLastAdv w = ParadigmsEst.mkAdv ("eelmisel" ++ pointWeekday w) ;
weekdayNextAdv w = ParadigmsEst.mkAdv ("järgmisel" ++ pointWeekday w) ;
monthAdv m = SyntaxEst.mkAdv in_Prep (mkNP m) ;
yearAdv y = SyntaxEst.mkAdv (prePrep nominative "aastal") y ;
---- dayMonthAdv d m = ParadigmsEst.mkAdv (d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part) ;
---- monthYearAdv m y = SyntaxEst.mkAdv in_Prep (mkNP (mkNP m) (SyntaxEst.mkAdv (casePrep nominative) y)) ;
---- dayMonthYearAdv d m y =
---- lin Adv {s = d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part ++ y.s ! R.NPCase R.Nom} ;
intYear = symb ;
intMonthday = symb ;
oper
pointWeekday : Weekday -> Str = \w -> (SyntaxEst.mkAdv (casePrep essive) (mkNP w.noun)).s ;
lincat Language = PN ;
--lin InLanguage l = SyntaxEst.mkAdv (mkPrep translative) (mkNP l) ;
lin
weekdayN w = w.noun ;
monthN m = m ;
languagePN l = l ;
--------------- lexicon of special names
oper mkLanguage : Str -> PN = \s -> mkPN (s ++ "keel") ;
oper mkWeekday : Str -> Weekday = \d ->
lin Weekday {
noun = mkN d ;
habitual = ParadigmsEst.mkAdv (d + "iti") ; --kolmapäeviti
} ;
lin monday_Weekday = mkWeekday "esmaspäev" ;
lin tuesday_Weekday = mkWeekday "teisipäev" ;
lin wednesday_Weekday = mkWeekday "kolmapäev" ;
lin thursday_Weekday = mkWeekday "neljapäev" ;
lin friday_Weekday = mkWeekday "reede" ;
lin saturday_Weekday = mkWeekday "laupäev" ;
lin sunday_Weekday = mkWeekday "pühapäev" ;
lin january_Month = mkN "jaanuar" ;
lin february_Month = mkN "veebruar" ;
lin march_Month = mkN "märts" ;
lin april_Month = mkN "aprill" ;
lin may_Month = mkN "mai" ;
lin june_Month = mkN "juuni" ;
lin july_Month = mkN "juuli" ;
lin august_Month = mkN "august" ;
lin september_Month = mkN "september" ;
lin october_Month = mkN "oktoober" ;
lin november_Month = mkN "november" ;
lin december_Month = mkN "december" ;
lin afrikaans_Language = mkLanguage "afrikaani" ;
lin amharic_Language = mkLanguage "amhara" ;
lin arabic_Language = mkLanguage "araabia" ;
lin bulgarian_Language = mkLanguage "bulgaaria" ;
lin catalan_Language = mkLanguage "katalaani" ;
lin chinese_Language = mkLanguage "hiina" ;
lin danish_Language = mkLanguage "taani" ;
lin dutch_Language = mkLanguage "hollandi" ;
lin english_Language = mkLanguage "inglise" ;
lin estonian_Language = mkLanguage "eesti" ;
lin finnish_Language = mkLanguage "soome" ;
lin french_Language = mkLanguage "prantsuse" ;
lin german_Language = mkLanguage "saksa" ;
lin greek_Language = mkLanguage "kreeka" ;
lin hebrew_Language = mkLanguage "heebrea" ;
lin hindi_Language = mkLanguage "hindi" ;
lin japanese_Language = mkLanguage "jaapani" ;
lin italian_Language = mkLanguage "itaalia" ;
lin latin_Language = mkLanguage "ladina" ;
lin latvian_Language = mkLanguage "läti" ;
lin maltese_Language = mkLanguage "malta" ;
lin nepali_Language = mkLanguage "nepali" ;
lin norwegian_Language = mkLanguage "norra" ;
lin persian_Language = mkLanguage "pärsia" ;
lin polish_Language = mkLanguage "poola" ;
lin punjabi_Language = mkLanguage "pandžabi" ;
lin romanian_Language = mkLanguage "rumeenia" ;
lin russian_Language = mkLanguage "vene" ;
lin sindhi_Language = mkLanguage "sindhi" ;
lin spanish_Language = mkLanguage "hispaania" ;
lin swahili_Language = mkLanguage "swahili" ;
lin swedish_Language = mkLanguage "rootsi" ;
lin thai_Language = mkLanguage "thai" ;
lin turkish_Language = mkLanguage "türgi" ;
lin urdu_Language = mkLanguage "urdu" ;
}

View File

@@ -0,0 +1,6 @@
--# -path=.:../abstract:../common
-- documentation of Estonian in Estonian: the default introduced in LangEst
concrete DocumentationEst of Documentation = CatEst **
DocumentationEstFunctor with (Terminology = TerminologyEst) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:../abstract:../common
-- documentation of Estonian in English
concrete DocumentationEstEng of Documentation = CatEst **
DocumentationEstFunctor with (Terminology = TerminologyEng) ;

View File

@@ -0,0 +1,280 @@
--# -path=.:../abstract:../common
incomplete concrete DocumentationEstFunctor of Documentation = CatEst ** open
Terminology, -- the interface
ResEst,
ParadigmsEst,
(G = GrammarEst),
(S = SyntaxEst),
(L = LexiconEst),
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, InflectionN2, InflectionN3 = \noun -> {
t = "s" ;
s1 = heading1 (heading noun_Category) ;
s2 = inflNoun (\nf -> noun.s ! nf)
} ;
InflectionA, InflectionA2 = \adj ->
let posit : (AForm => Str) = adj.s ! Posit ;
compar : (AForm => Str) = adj.s ! Compar ;
superl : (AForm => Str) = adj.s ! Superl ;
in
{ t = "a" ;
s1 = heading1 (heading adjective_Category) ;
s2 = inflNoun (\nf -> posit ! AN nf) ++
heading2 (heading comparative_Parameter) ++
inflNoun (\nf -> compar ! AN nf) ++
heading2 (heading superlative_Parameter) ++
inflNoun (\nf -> superl ! AN nf)
} ;
InflectionAdv adv = {
t = "adv" ;
s1 = heading1 (heading adverb_Category) ;
s2 = paragraph adv.s
} ;
InflectionPrep p = {
t = "prep" ;
s1 = heading1 (heading preposition_Category) ;
s2 = paragraph ((S.mkAdv (lin Prep p) S.it_NP).s ++ ";" ++ (S.mkAdv (lin Prep p) S.we_NP).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 v S.we_NP (S.mkVP (L.sleep_V)))) ;
s2 = inflVerb v
} ;
InflectionV2S v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin S (ss "...")))) ;
s2 = inflVerb v
} ;
InflectionV2Q v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin QS (ss "...")))) ;
s2 = inflVerb v
} ;
InflectionV2A v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP L.beautiful_A)) ;
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 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v (lin S (ss "...")))) ;
s2 = inflVerb v
} ;
InflectionVQ v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v (lin QS (ss "...")))) ;
s2 = inflVerb v
} ;
InflectionVA v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v L.beautiful_A)) ;
s2 = inflVerb v
} ;
oper
verbExample : CatEst.Cl -> Str = \cl -> (S.mkUtt cl).s ;
{-
-} --# notpresent
inflVerb : CatEst.V -> Str = \verb ->
let
--verb = sverb2verbSep verb0 ;
vfin : ResEst.VForm -> Str = \f ->
verb.s ! f ;
nounNounHeading : Parameter -> Parameter -> Str = \n1,n2 ->
(S.mkUtt (G.PossNP (S.mkCN n1) (S.mkNP n2))).s ;
in
heading3 (nounNounHeading present_Parameter indicative_Parameter) ++
frameTable (
tr (th "" ++
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "1.p" ++ td (vfin (Presn Sg P1)) ++ td (vfin (Presn Pl P1))
++ intagAttr "td" "rowspan=3" (vfin (PassPresn True)) --# notpresent
) ++
tr (th "2.p" ++ td (vfin (Presn Sg P2)) ++ td (vfin (Presn Pl P2))) ++
tr (th "3.p" ++ td (vfin (Presn Sg P3)) ++ td (vfin (Presn Pl P3))) ++
tr (th (heading negative_Parameter) ++
intagAttr "td" "colspan=2 align=center" (vfin (Imper Sg)) ++ td (vfin (PassPresn False)))
) ++
heading3 (nounNounHeading past_Parameter indicative_Parameter) ++
frameTable (
tr (th "" ++
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "1.p" ++ td (vfin (Impf Sg P1)) ++ td (vfin (Impf Pl P1))
++ intagAttr "td" "rowspan=3" (vfin (PassImpf True))) ++
tr (th "2.p" ++ td (vfin (Impf Sg P2)) ++ td (vfin (Impf Pl P2))) ++
tr (th "3.p" ++ td (vfin (Impf Sg P3)) ++ td (vfin (Impf Pl P3))) ++
tr (th (heading negative_Parameter) ++
td (vfin (PastPart Act)) ++
td (vfin (PastPart Pass)) ++
td (vfin (PassImpf False)))
) ++
heading3 (nounNounHeading present_Parameter conditional_Parameter) ++
frameTable (
tr (th "" ++
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "1.p" ++ td (vfin (Condit Sg P1)) ++ td (vfin (Condit Pl P1))
++ intagAttr "td" "rowspan=3" "TODO pass condit (nt loetaks)" --# notpresent
) ++
tr (th "2.p" ++ td (vfin (Condit Sg P2)) ++ td (vfin (Condit Pl P2))) ++
tr (th "3.p" ++ td (vfin (Condit Sg P3)) ++ td (vfin (Condit Pl P3)))
) ++
heading3 (nounNounHeading present_Parameter quotative_Parameter) ++
frameTable (
tr (th "" ++
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "isik." ++ td (vfin (Quotative Act))
++ intagAttr "td" "rowspan=3" (vfin (Quotative Act)) --# notpresent
) ++
tr (th "umbis." ++ td (vfin (Quotative Pass)) ++ td (vfin (Quotative Pass))
)) ++
heading3 (nounNounHeading present_Parameter imperative_Parameter) ++
frameTable (
tr (th "" ++
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "1.p" ++ td "" ++ td (vfin ImperP1Pl) ++
intagAttr "td" "rowspan=3" "TODO passive imperative") ++
tr (th "2.p" ++ td (vfin (Imper Sg)) ++ td (vfin (Imper Pl))) ++
tr (th "3.p" ++ td (vfin (ImperP3))) ++
tr (th (heading negative_Parameter) ++
td (vfin (Imper Sg)) ++
td (vfin ImpNegPl))
) ++
heading2 (nounPluralHeading nominal_form_ParameterType).s ++
heading3 (heading infinitive_Parameter) ++
frameTable (
tr (intagAttr "th" "rowspan=2" "da" ++
th (heading nominative_Parameter) ++ td (vfin (Inf InfDa))) ++
tr (th (heading inessive_Parameter) ++ td (vfin (Inf InfDes))) ++
tr (intagAttr "th" "rowspan=6" "ma" ++
th (heading inessive_Parameter) ++ td (vfin (Inf InfMas))) ++
tr (th (heading elative_Parameter) ++ td (vfin (Inf InfMast))) ++
tr (th (heading illative_Parameter) ++ td (vfin (Inf InfMa))) ++
tr (th (heading abessive_Parameter) ++ td (vfin (Inf InfMata))) ++
tr (th (heading adessive_Parameter) ++ td "TODO InfMa adessive") ++
tr (th (heading translative_Parameter) ++ td (vfin (Inf InfMaks))) ++
tr (intagAttr "th" "rowspan=2" "mine" ++
th (heading nominative_Parameter) ++ td "TODO mine") ++
tr (th (heading partitive_Parameter) ++ td "TODO mist")
) ++
heading3 (heading participle_Parameter) ++
frameTable (
tr (intagAttr "th" "rowspan=2" (heading present_Parameter) ++
th (heading active_Parameter) ++
td (vfin (PresPart Act))) ++
tr (th (heading passive_Parameter) ++
td (vfin (PresPart Pass))) ++
tr (intagAttr "th" "rowspan=2" (heading perfect_Parameter) ++
th (heading active_Parameter) ++
td (vfin (PastPart Act ))) ++
tr (th (heading passive_Parameter) ++
td (vfin (PastPart Pass )))
) ; --}
inflNoun : (NForm -> Str) -> Str = \nouns ->
frameTable (
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
tr (th (heading nominative_Parameter) ++ td (nouns (NCase Sg Nom)) ++ td (nouns (NCase Pl Nom))) ++
tr (th (heading genitive_Parameter) ++ td (nouns (NCase Sg Gen)) ++ td (nouns (NCase Pl Gen))) ++
tr (th (heading partitive_Parameter) ++ td (nouns (NCase Sg Part)) ++ td (nouns (NCase Pl Part))) ++
tr (th (heading translative_Parameter) ++ td (nouns (NCase Sg Transl)) ++ td (nouns (NCase Pl Transl))) ++
tr (th (heading essive_Parameter) ++ td (nouns (NCase Sg Ess)) ++ td (nouns (NCase Pl Ess))) ++
tr (th (heading inessive_Parameter) ++ td (nouns (NCase Sg Iness)) ++ td (nouns (NCase Pl Iness))) ++
tr (th (heading elative_Parameter) ++ td (nouns (NCase Sg Elat)) ++ td (nouns (NCase Pl Elat))) ++
tr (th (heading illative_Parameter) ++ td (nouns (NCase Sg Illat)) ++ td (nouns (NCase Pl Illat))) ++
tr (th (heading adessive_Parameter) ++ td (nouns (NCase Sg Adess)) ++ td (nouns (NCase Pl Adess))) ++
tr (th (heading ablative_Parameter) ++ td (nouns (NCase Sg Ablat)) ++ td (nouns (NCase Pl Ablat))) ++
tr (th (heading allative_Parameter) ++ td (nouns (NCase Sg Allat)) ++ td (nouns (NCase Pl Allat))) ++
tr (th (heading abessive_Parameter) ++ td (nouns (NCase Sg Abess)) ++ td (nouns (NCase Pl Abess))) ++
tr (th (heading comitative_Parameter) ++ td (nouns (NCase Sg Comit)) ++ td (nouns (NCase Pl Comit))) ++
tr (th (heading instructive_Parameter) ++ td (nouns (NCase Sg Termin)) ++ td (nouns (NCase Pl Termin))
)) ;
lin
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) ;
{- --# notpresent
-}
}

View File

@@ -3,6 +3,8 @@
concrete LangEst of Lang =
GrammarEst - [Slash2V3,SlashV2A,Slash3V3,SlashV2VNP,SlashVV], ---- to speed up compilation
LexiconEst
,ConstructionEst
,DocumentationEst
** {
flags startcat = Phr ; unlexer = text ; lexer = finnish ;