some more doc in ParadigmsGer

This commit is contained in:
aarne
2007-06-08 15:53:24 +00:00
parent 5c0f1a3fc0
commit e8a580414a

View File

@@ -2,7 +2,7 @@
--1 German Lexical Paradigms
--
-- Aarne Ranta & Harald Hammarström 2003--2006
-- Aarne Ranta, Harald Hammarström and Björn Bringert2003--2007
--
-- This is an API for the user of the resource grammar
-- for adding lexical items. It gives functions for forming
@@ -11,18 +11,14 @@
-- Closed categories (determiners, pronouns, conjunctions) are
-- accessed through the resource syntax API, $Structural.gf$.
--
-- 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, rather
-- than stems, as string arguments of the paradigms.
--
-- The structure of functions for each word class $C$ is the following:
-- first we give a handful of patterns that aim to cover all
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
-- escape to construct the most irregular words of type $C$.
-- However, this function should only seldom be needed: we have a
-- separate module [``IrregGer`` ../../german/IrregGer.gf]
-- which covers irregularly inflected verbs.
-- cases, from the most regular (with just one argument) to the worst.
-- The name of this function is $mkC$.
--
-- There is also a module [``IrregGer`` ../../german/IrregGer.gf]
-- which covers irregular verbs.
resource ParadigmsGer = open
(Predef=Predef),
@@ -67,26 +63,35 @@ mkN : overload {
-- guesses the gender and the declension: "e, ung, ion" give the
-- feminine with plural ending "-n, -en", and the rest are masculines
-- with the plural "-e" (without Umlaut).
mkN : Str -> N ;
mkN : (Stufe : Str) -> N ;
-- The 'almost regular' case is much like the information given in an ordinary
-- dictionary. It takes the singular and plural nominative and the
-- gender, and infers the other forms from these.
mkN : (x1,x2 : Str) -> Gender -> N ;
mkN : (Bild,Bilder : Str) -> Gender -> N ;
-- Worst case: give all four singular forms, two plural forms (others + dative),
-- and the gender.
mkN : (x1,_,_,_,_,x6 : Str) -> Gender -> N
-- mann, mann, manne, mannes, männer, männern
};
};
-- Relational nouns need a preposition. The most common is "von" with
-- the dative. Some prepositions are constructed in [StructuralGer StructuralGer.html].
-- the dative, and there is a special case for regular nouns.
mkN2 : N -> Prep -> N2 ;
vonN2 : N -> N2 ;
mkN2 : overload {
mkN2 : Str -> N2 ;
mkN2 : N -> N2 ;
mkN2 : N -> Prep -> N2
} ;
-- Use the function $mkPrep$ or see the section on prepositions below to
-- form other prepositions.
-- Some prepositions are moreover constructed in [StructuralGer StructuralGer.html].
--
-- Three-place relational nouns ("die Verbindung von x nach y") need two prepositions.
@@ -95,22 +100,37 @@ mkN : overload {
--3 Proper names and noun phrases
--
-- Proper names, with a regular genitive, are formed as follows
-- The regular genitive is "s", omitted after "s".
-- Proper names, with an "s" genitive and other cases like the
-- nominative, are formed from a string. Final "s" ("Johannes-Johannes") is
-- taken into account.
mkPN : overload {
mkPN : Str -> PN ;
-- If only the genitive differs, two strings are needed.
mkPN : (nom,gen : Str) -> PN ;
-- In the worst case, all four forms are needed.
mkPN : (nom,acc,dat,gen : Str) -> PN
} ;
mkPN : (karolus, karoli : Str) -> PN ; -- karolus, karoli
regPN : (Johann : Str) -> PN ;
-- Johann, Johanns ; Johannes, Johannes
--2 Adjectives
mkA : overload {
-- The regular adjective formation works for most cases, and includes
-- variations such as "teuer - teurer", "böse - böser".
mkA : Str -> A ;
-- Adjectives need three forms, one for each degree.
-- In the worst case, adjectives need three forms - one for each degree.
mkA : (gut,besser,beste : Str) -> A -- gut,besser,beste
};
-- Invariable adjective are a special case.
@@ -123,7 +143,7 @@ mkN : overload {
--2 Adverbs
-- Adverbs are just strings.
-- Adverbs are formed from strings.
mkAdv : Str -> Adv ;
@@ -148,10 +168,15 @@ mkN : overload {
--2 Verbs
mkV : overload {
-- Weak verbs are sometimes called regular verbs.
mkV : Str -> V ; -- führen
-- Regular verbs ("weak verbs") need just the infinitive form.
mkV : (führen : Str) -> V ;
-- Irregular verbs use Ablaut and, in the worst cases, also Umlaut.
mkV : (x1,_,_,_,x5 : Str) -> V ; -- sehen, sieht, sah, sähe, gesehen
mkV : (sehen,sieht,sah,sähe,gesehen : Str) -> V ;
-- The worst-case constructor needs six forms:
-- - Infinitive,
-- - 3p sg pres. indicative,
@@ -159,19 +184,22 @@ mkV : overload {
-- - 1/3p sg imperfect indicative,
-- - 1/3p sg imperfect subjunctive (because this uncommon form can have umlaut)
-- - the perfect participle
mkV : (x1,_,_,_,_,x6 : Str) -> V ; -- geben, gibt, gib, gab, gäbe, gegeben
--
--
mkV : (geben, gibt, gib, gab, gäbe, gegeben : Str) -> V ;
-- To add a movable suffix e.g. "auf(fassen)".
mkV : Str -> V -> V
};
-- To remove the past participle prefix "ge", e.g. for the verbs
-- prefixed by "be-, ver-".
no_geV : V -> V ;
-- To change the auxiliary from "haben" (default) to "sein" and
-- vice-versa.
@@ -186,11 +214,17 @@ mkV : overload {
--3 Two-place verbs
mkV2 : overload {
-- Two-place verbs with a preposition.
mkV2 : V -> Prep -> V2 ;
-- Two-place verbs with direct object (accusative, transitive verbs).
mkV2 : V -> V2 ;
-- Two-place verbs with object in the given case.
mkV2 : V -> Case -> V2
};
@@ -285,15 +319,34 @@ mkV2 : overload {
_ => regN hund
} ;
mkN2 : N -> Prep -> N2 = \n,p -> n ** {c2 = p ; lock_N2 = <>} ;
mkN2 = overload {
mkN2 : Str -> N2 = \s -> vonN2 (regN s) ;
mkN2 : N -> N2 = vonN2 ;
mkN2 : N -> Prep -> N2 = mmkN2
} ;
mmkN2 : N -> Prep -> N2 = \n,p -> n ** {c2 = p ; lock_N2 = <>} ;
vonN2 : N -> N2 = \n -> n ** {c2 = {s = "von" ; c = dative} ; lock_N2 = <>} ;
mkN3 = \n,p,q -> n ** {c2 = p ; c3 = q ; lock_N3 = <>} ;
mkPN = \karolus, karoli ->
mk2PN = \karolus, karoli ->
{s = table {Gen => karoli ; _ => karolus} ; lock_PN = <>} ;
regPN = \horst ->
mkPN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) ;
mk2PN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) ;
mkPN = overload {
mkPN : Str -> PN = regPN ;
mkPN : (nom,gen : Str) -> PN = mk2PN ;
mkPN : (nom,acc,dat,gen : Str) -> PN = \nom,acc,dat,gen ->
{s = table {Nom => nom ; Acc => acc ; Dat => dat ; Gen => gen} ; lock_PN = <>}
} ;
mk2PN : (karolus, karoli : Str) -> PN ; -- karolus, karoli
regPN : (Johann : Str) -> PN ;
-- Johann, Johanns ; Johannes, Johannes
mk3A : (gut,besser,beste : Str) -> A = \a,b,c ->
let aa : Str = case a of {