# -path=.:../abstract:../../prelude
Aarne Ranta 2003
This is an API to the user of the resource grammar for adding lexical items. It give shortcuts for forming expressions of basic categories: nouns, adjectives, verbs. Closed categories (determiners, pronouns, conjunctions) are accessed through the resource syntax API, Resource.gf. Their original typings via abstract syntax are in Structural.gf, which also contains documentation.
The main difference with MorphoGer.gf is that the types referred to are compiled resource grammar types. We have moreover had the design principle of always having existing forms, not stems, as string arguments of the paradigms.
The following modules are presupposed:
resource ParadigmsGer = open Prelude, (Morpho=MorphoGer), SyntaxGer, ResourceGer in {
To abstract over gender names, we define the following identifiers.
oper masculine : Gender ; feminine : Gender ; neuter : Gender ;To abstract over case names, we define the following.
nominative : Case ; accusative : Case ; dative : Case ; genitive : Case ;To abstract over number names, we define the following.
singular : Number ; plural : Number ;
mkN : (_,_,_,_,_,_ : Str) -> Gender -> N ; -- mann, mann, manne, mannes, männer, männernOften it is enough with singular and plural nominatives, and singular genitive. The plural dative is computed by the heuristic that it is the same as the nominative this ends with n or s, otherwise n is added.
nGen : Str -> Str -> Str -> Gender -> N ; -- punkt,punktes,punktHere are some common patterns. Singular nominative or two nominatives are needed. Two forms are needed in case of Umlaut, which would be complicated to define. For the same reason, we have separate patterns for multisyllable stems. The weak masculine pattern nSoldat avoids duplicating the final e.
nRaum : (_,_ : Str) -> N ; -- Raum, (Raumes,) Räume (masc) nTisch : Str -> N ; -- Tisch, (Tisches, Tische) (masc) nVater : (_,_ : Str) -> N ; -- Vater, (Vaters,) Väter (masc) nFehler : Str -> N ; -- Fehler, (fehlers, Fehler) (masc) nSoldat : Str -> N ; -- Soldat (, Soldaten) ; Kunde (, Kunden) (masc)Neuter patterns.
nBuch : (_,_ : Str) -> N ; -- Buch, (Buches, Bücher) (neut) nMesser : Str -> N ; -- Messer, (Messers, Messer) (neut) nAuto : Str -> N ; -- Auto, (Autos, Autos) (neut)Feminine patterns. Duplicated e is avoided in nFrau.
nHand : (_,_ : Str) -> N ; -- Hand, Hände; Mutter, Mütter (fem) nFrau : Str -> N ; -- Frau (, Frauen) ; Wiese (, Wiesen) (fem)Nouns used as functions need a preposition. The most common is von.
mkFun : N -> Preposition -> Case -> Fun ; funVon : N -> Fun ;Proper names, with their possibly irregular genitive. The regular genitive is s, omitted after s.
mkPN : (karolus, karoli : Str) -> PN ; -- karolus, karoli pnReg : (Johann : Str) -> PN ; -- Johann, Johanns ; Johannes, JohannesOn the top level, it is maybe CN that is used rather than N, and NP rather than PN.
mkCN : N -> CN ; mkNP : (karolus,karoli : Str) -> NP ; npReg : Str -> NP ; -- Johann, JohannsIn some cases, you may want to make a complex CN into a function.
mkFunCN : CN -> Preposition -> Case -> Fun ; funVonCN : CN -> Fun ;
mkAdj1 : (teuer,teur : Str) -> Adj1 ;Invariable adjective are a special case.
adjInvar : Str -> Adj1 ; -- primaThe following heuristic recognizes the the end of the word, and builds the second form depending on if it is e, er, or something else. N.B. a contraction is made with er, which works for teuer but not for bitter.
adjGen : Str -> Adj1 ; -- gut; teuer; böseTwo-place adjectives need a preposition and a case as extra arguments.
mkAdj2 : Adj1 -> Str -> Case -> Adj2 ; -- teilbar, durch, accComparison adjectives may need three adjective, corresponding to the three comparison forms.
mkAdjDeg : (gut,besser,best : Adj1) -> AdjDeg ;In many cases, each of these adjectives is itself regular. Then we only need three strings. Notice that contraction with er is not performed (bessere, not bessre).
aDeg3 : (gut,besser,best : Str) -> AdjDeg ;In the completely regular case, the comparison forms are constructed by the endings er and st.
aReg : Str -> AdjDeg ; -- billig, billiger, billigstThe past participle of a verb can be used as an adjective.
aPastPart : V -> Adj1 ; -- gefangenOn top level, there are adjectival phrases. The most common case is just to use a one-place adjective. The variation in adjGen is taken into account.
apReg : Str -> AP ;
The fragment only has present tense so far, but in all persons. It also has the infinitive and the past participles. The worst case macro needs four forms: : the infinitive and the third person singular (where Umlaut may occur), the singular imperative, and the past participle. The function recognizes if the stem ends with s or t and performs the appropriate contractions.
mkV : (_,_,_,_ : Str) -> V ; -- geben, gibt, gib, gegebenRegular verbs are those where no Umlaut occurs.
vReg : Str -> V ; -- führenThe verbs 'be' and 'have' are special.
vSein : V ; vHaben : V ;Some irregular verbs.
vFahren : V ;Verbs with a detachable particle, with regular ones as a special case.
vPart : (_,_,_,_,_ : Str) -> V ; -- sehen, sieht, sieh, gesehen, aus vPartReg : (_,_ : Str) -> V ; -- bringen, um mkVPart : V -> Str -> V ; -- vFahren, ausTwo-place verbs, and the special case with direct object. Notice that a particle can be included in a V.
mkTV : V -> Str -> Case -> TV ; -- hören, zu, dative tvReg : Str -> Str -> Case -> TV ; -- hören, zu, dative tvDir : V -> TV ; -- umbringen tvDirReg : Str -> TV ; -- liebenThree-place verbs require two prepositions and cases.
mkV3 : V -> Str -> Case -> Str -> Case -> V3 ; -- geben,[],dative,[],accusativeSentence-complement verbs are just verbs.
mkVS : V -> VS ;Verb-complement verbs either need the zu particle or don't. The ones that don't are usually auxiliary verbs.
vsAux : V -> VV ; vsZu : V -> VV ;
Adverbials for modifying verbs, adjectives, and sentences can be formed from strings.
mkAdV : Str -> AdV ; mkAdA : Str -> AdA ; mkAdS : Str -> AdS ;Prepositional phrases are another productive form of adverbials.
mkPP : Case -> Str -> NP -> AdV ;One can also use the function ResourceGer.PrepNP with one of the given prepositions or a preposition formed by giving a string and a case:
mkPrep : Str -> Case -> Prep ;The definitions should not bother the user of the API. So they are hidden from the document.