From 04e3c06aec503acb1c4d55e9dccff35743e573dc Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 17 Sep 2008 07:05:24 +0000 Subject: [PATCH] verb conjugations in Latin --- lib/next-resource/latin/ResLatin.gf | 134 +++++++++++++++++++++++++++- 1 file changed, 133 insertions(+), 1 deletion(-) diff --git a/lib/next-resource/latin/ResLatin.gf b/lib/next-resource/latin/ResLatin.gf index fbe79be33..7d50cea9a 100644 --- a/lib/next-resource/latin/ResLatin.gf +++ b/lib/next-resource/latin/ResLatin.gf @@ -1,9 +1,14 @@ --# -path=.:common -resource ResLatin = open Prelude in { +resource ResLatin = open +-- ParamX, + Prelude + +in { param Number = Sg | Pl ; + Person = P1 | P2 | P3 ; Gender = Masc | Fem | Neutr ; Case = Nom | Acc | Gen | Dat | Abl | Voc ; Degree = DPos | DComp | DSup ; @@ -218,4 +223,131 @@ oper in mkAdjective (noun12 bonus) (noun1 (bon + "a")) (noun2um (bon + "um")) ; +-- verbs + + param + VActForm = VAct VAnter VTense Number Person ; + VPassForm = VPass VTense Number Person ; + VInfForm = VInfActPres | VInfActPerf ; + VImpForm = VImpPres Number | VImpFut2 Number | VImpFut3 Number ; + VGerund = VGenAcc | VGenGen |VGenDat | VGenAbl ; + VSupine = VSupAcc | VSupAbl ; + + VAnter = VSim | VAnt ; + VTense = VPres VMood | VImpf VMood | VFut ; + VMood = VInd | VConj ; + + oper + Verb : Type = { + act : VActForm => Str ; +{- + pass : VPassForm => Str ; + inf : VAnter => Str ; + imp : VImpForm => Str ; + ger : VGerund => Str ; + sup : VSupine => Str ; + partActPres : Adjective ; + partActFut : Adjective ; + partPassPerf : Adjective ; + partPassFut : Adjective +-} + } ; + + mkVerb : + (cela,cele,celab,celo,celare,celavi,celatus,celabo,celabunt,celabi : Str) + -> Verb = + \cela,cele,celab,celo,celare,celavi,celatus,celabo,celabunt,celabi -> + let + celav = init celavi + in { + act = table { + VAct VSim (VPres VInd) Sg P1 => celo ; + VAct VSim (VPres VInd) n p => cela + actPresEnding n p ; + VAct VSim (VPres VConj) n p => cele + actPresEnding n p ; + VAct VSim (VImpf VInd) n p => celab + "ba" + actPresEnding n p ; + VAct VSim (VImpf VConj) n p => celare + actPresEnding n p ; + VAct VSim VFut Sg P1 => celabo ; + VAct VSim VFut Pl P3 => celabunt ; + VAct VSim VFut n p => celabi + actPresEnding n p ; + VAct VAnt (VPres VInd) Pl P3 => celav + "erunt" ; + VAct VAnt (VPres VInd) n p => celavi + actPerfEnding n p ; + VAct VAnt (VPres VConj) n p => celav + "eri" + actPresEnding n p ; + VAct VAnt (VImpf VInd) n p => celav + "era" + actPresEnding n p ; + VAct VAnt (VImpf VConj) n p => celav + "isse" + actPresEnding n p ; + VAct VAnt VFut Sg P1 => celav + "ero" ; + VAct VAnt VFut n p => celav + "eri" + actPresEnding n p + } ; + } ; + + actPresEnding : Number -> Person -> Str = + useEndingTable <"m", "s", "t", "mus", "tis", "nt"> ; + + actPerfEnding : Number -> Person -> Str = + useEndingTable <"", "sti", "t", "mus", "stis", "erunt"> ; + + useEndingTable : (Str*Str*Str*Str*Str*Str) -> Number -> Person -> Str = + \es,n,p -> case n of { + Sg => case p of { + P1 => es.p1 ; + P2 => es.p2 ; + P3 => es.p3 + } ; + Pl => case p of { + P1 => es.p4 ; + P2 => es.p5 ; + P3 => es.p6 + } + } ; + + verb1 : Str -> Verb = \celare -> + let + cela = Predef.tk 2 celare ; + cel = init cela ; + celo = cel + "o" ; + cele = cel + "e" ; + celavi = cela + "vi" ; + celatus = cela + "tus" ; + in mkVerb cela cele cela celo celare celavi celatus + (cela + "bo") (cela + "bunt") (cela + "bi") ; + + verb2 : Str -> Verb = \habere -> + let + habe = Predef.tk 2 habere ; + hab = init habe ; + habeo = habe + "o" ; + habea = habe + "a" ; + habui = hab + "ui" ; + habitus = hab + "itus" ; + in mkVerb habe habea habe habeo habere habui habitus + (habe + "bo") (habe + "bunt") (habe + "bi") ; + + verb3 : (_,_,_ : Str) -> Verb = \gerere,gessi,gestus -> + let + gere = Predef.tk 2 gerere ; + ger = init gere ; + gero = ger + "o" ; + geri = ger + "i" ; + gera = ger + "a" ; + in mkVerb geri gera gere gero gerere gessi gestus + (ger + "am") (ger + "ent") gere ; + + verb3i : (_,_,_ : Str) -> Verb = \iacere,ieci,iactus -> + let + iac = Predef.tk 3 iacere ; + iaco = iac + "io" ; + iaci = iac + "i" ; + iacie = iac + "ie" ; + iacia = iac + "ia" ; + in mkVerb iaci iacia iacie iaco iacere ieci iactus + (iac + "iam") (iac + "ient") iacie ; + + verb4 : (_,_,_ : Str) -> Verb = \sentire,sensi,sensus -> + let + senti = Predef.tk 2 sentire ; + sentio = senti + "o" ; + sentia = senti + "a" ; + sentie = senti + "e" ; + in mkVerb senti sentia sentie sentio sentire sensi sensus + (senti + "am") (senti + "ent") sentie ; + }