mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-17 23:22:51 -06:00
German determiners
This commit is contained in:
@@ -20,7 +20,7 @@ concrete LexEng of Lex = CatEng ** open ResEng, Prelude in {
|
|||||||
always_AdV = {s = "always"} ;
|
always_AdV = {s = "always"} ;
|
||||||
|
|
||||||
only_Predet = {s = "only"} ;
|
only_Predet = {s = "only"} ;
|
||||||
all_Predet = {s = "only"} ;
|
all_Predet = {s = "all"} ;
|
||||||
this_Quant = {s = "this" ; n = Sg} ;
|
this_Quant = {s = "this" ; n = Sg} ;
|
||||||
these_Quant = {s = "these" ; n = Pl} ;
|
these_Quant = {s = "these" ; n = Pl} ;
|
||||||
|
|
||||||
|
|||||||
@@ -37,12 +37,14 @@ concrete CatGer of Cat = open ResGer, Prelude, (R = ParamX) in {
|
|||||||
|
|
||||||
Det, Quant = {s : Gender => Case => Str ; n : Number ; a : Adjf} ;
|
Det, Quant = {s : Gender => Case => Str ; n : Number ; a : Adjf} ;
|
||||||
Predet = {s : Number => Gender => Case => Str} ;
|
Predet = {s : Number => Gender => Case => Str} ;
|
||||||
Num, Ord = {s : Gender => Case => Str} ;
|
Num = {s : Gender => Case => Str} ;
|
||||||
|
Ord = {s : Adjf => Gender => Case => Str} ;
|
||||||
|
|
||||||
CN = {s : Adjf => Number => Case => Str ; g : Gender} ;
|
CN = {s : Adjf => Number => Case => Str ; g : Gender} ;
|
||||||
N = {s : Number => Case => Str ; g : Gender} ;
|
N = {s : Number => Case => Str ; g : Gender} ;
|
||||||
PN = {s : Case => Str} ;
|
PN = {s : Case => Str} ;
|
||||||
Pron, NP = {s : Case => Str ; a : Agr} ;
|
Pron = {s : NPForm => Str ; a : Agr} ;
|
||||||
|
NP = {s : Case => Str ; a : Agr} ;
|
||||||
N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Preposition} ;
|
N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Preposition} ;
|
||||||
N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Preposition} ;
|
N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Preposition} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,55 @@
|
|||||||
concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
||||||
--
|
|
||||||
-- flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
--
|
|
||||||
-- lin
|
lin
|
||||||
-- DetCN det cn = {
|
DetCN det cn = {
|
||||||
-- s = \\c => det.s ++ cn.s ! det.n ! c ;
|
s = \\c => det.s ! cn.g ! c ++ cn.s ! adjfCase c ! det.n ! c ;
|
||||||
-- a = agrP3 det.n
|
a = agrP3 det.n ;
|
||||||
-- } ;
|
isPron = False
|
||||||
-- UsePN pn = pn ** {a = agrP3 Sg} ;
|
}
|
||||||
-- UsePron p = p ;
|
where {
|
||||||
--
|
adjfCase : Case -> Adjf = \c -> case <det.a,c> of {
|
||||||
-- MkDet pred quant num ord = {
|
<Strong, Nom|Acc> => Strong ;
|
||||||
-- s = pred.s ++ quant.s ++ num.s ++ ord.s ;
|
_ => Weak
|
||||||
-- n = quant.n
|
}
|
||||||
-- } ;
|
} ;
|
||||||
--
|
|
||||||
-- PossPronSg p = {s = p.s ! Gen ; n = Sg} ;
|
UsePN pn = pn ** {a = agrP3 Sg} ;
|
||||||
-- PossPronPl p = {s = p.s ! Gen ; n = Pl} ;
|
UsePron pron = {
|
||||||
--
|
s = \\c => pron.s ! NPCase c ;
|
||||||
-- NoPredet, NoNum, NoOrd = {s = []} ;
|
a = pron.a
|
||||||
-- NumInt n = n ;
|
} ;
|
||||||
|
|
||||||
|
MkDet pred quant num ord =
|
||||||
|
let
|
||||||
|
n = quant.n ;
|
||||||
|
a = quant.a
|
||||||
|
in {
|
||||||
|
s = \\g,c => pred.s ! n ! g ! c ++ quant.s ! g ! c ++
|
||||||
|
num.s ! g ! c ++ ord.s ! a ! g ! c ;
|
||||||
|
n = n ;
|
||||||
|
a = a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PossPronSg p = {
|
||||||
|
s = \\g,c => p.s ! NPPoss (gennum g Sg) c ;
|
||||||
|
n = Sg ;
|
||||||
|
a = Strong
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PossPronPl p = {
|
||||||
|
s = \\g,c => p.s ! NPPoss (gennum g Pl) c ;
|
||||||
|
n = Pl ;
|
||||||
|
a = Strong
|
||||||
|
} ;
|
||||||
|
|
||||||
|
NoPredet = {s = \\_,_,_ => []} ;
|
||||||
|
NoNum = {s = \\_,_ => []} ;
|
||||||
|
NoOrd = {s = \\_,_,_ => []} ;
|
||||||
|
|
||||||
|
NumInt n = {s = \\_,_ => n.s} ;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- NumNumeral numeral = {s = numeral.s ! NCard} ;
|
-- NumNumeral numeral = {s = numeral.s ! NCard} ;
|
||||||
-- OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
-- OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||||
@@ -27,24 +57,51 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
-- AdNum adn num = {s = adn.s ++ num.s} ;
|
-- AdNum adn num = {s = adn.s ++ num.s} ;
|
||||||
--
|
--
|
||||||
-- OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
-- OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
||||||
--
|
|
||||||
-- DefSg = {s = artDef ; n = Sg} ;
|
DefSg = {
|
||||||
-- DefPl = {s = artDef ; n = Pl} ;
|
s = \\g,c => artDef ! GSg g ! c ;
|
||||||
--
|
n = Sg ;
|
||||||
-- IndefSg = {s = artIndef ; n = Sg} ;
|
a = Weak
|
||||||
-- IndefPl = {s = [] ; n = Pl} ;
|
} ;
|
||||||
|
DefPl = {
|
||||||
|
s = \\_,c => artDef ! GPl ! c ;
|
||||||
|
n = Pl ;
|
||||||
|
a = Weak
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IndefSg = {
|
||||||
|
s = \\g,c => "ein" + pronEnding ! GSg g ! c ;
|
||||||
|
n = Sg ;
|
||||||
|
a = Strong
|
||||||
|
} ;
|
||||||
|
IndefPl = {
|
||||||
|
s = \\_,_ => [] ;
|
||||||
|
n = Pl ;
|
||||||
|
a = Strong
|
||||||
|
} ;
|
||||||
--
|
--
|
||||||
-- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
|
-- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
|
||||||
-- ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
|
-- ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
|
||||||
--
|
|
||||||
-- AdjCN ap cn = {
|
AdjCN ap cn =
|
||||||
-- s = \\n,c => preOrPost ap.isPre (ap.s ! agrP3 n) (cn.s ! n ! c)
|
let
|
||||||
-- } ;
|
g = cn.g
|
||||||
|
in {
|
||||||
|
s = \\a,n,c =>
|
||||||
|
preOrPost ap.isPre
|
||||||
|
(ap.s ! agrAdj g a n c)
|
||||||
|
(cn.s ! a ! n ! c) ;
|
||||||
|
g = g
|
||||||
|
} ;
|
||||||
|
|
||||||
-- RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
-- RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
||||||
--
|
--
|
||||||
-- SentCN cn s = {s = \\n,c => cn.s ! n ! c ++ conjThat ++ s.s} ;
|
-- SentCN cn s = {s = \\n,c => cn.s ! n ! c ++ conjThat ++ s.s} ;
|
||||||
-- QuestCN cn qs = {s = \\n,c => cn.s ! n ! c ++ qs.s ! QIndir} ;
|
-- QuestCN cn qs = {s = \\n,c => cn.s ! n ! c ++ qs.s ! QIndir} ;
|
||||||
--
|
|
||||||
-- UseN n = n ;
|
UseN n = {
|
||||||
--
|
s = \\_ => n.s ;
|
||||||
|
g = n.g
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,16 +22,20 @@ resource ParamGer = ParamX ** {
|
|||||||
|
|
||||||
GenNum = GSg Gender | GPl ;
|
GenNum = GSg Gender | GPl ;
|
||||||
|
|
||||||
---- Agreement of $NP$ is a record. We'll add $Gender$ later.
|
-- Agreement of $NP$ is a record.
|
||||||
--
|
|
||||||
oper Agr = {n : Number ; p : Person} ;
|
oper Agr = {n : Number ; p : Person} ;
|
||||||
|
|
||||||
----2 For $Adjective$
|
-- Pronouns are the worst-case noun phrases, which have both case
|
||||||
|
-- and possessive forms.
|
||||||
|
|
||||||
|
param NPForm = NPCase Case | NPPoss GenNum Case ;
|
||||||
|
|
||||||
|
--2 For $Adjective$
|
||||||
|
|
||||||
-- The predicative form of adjectives is not inflected further.
|
-- The predicative form of adjectives is not inflected further.
|
||||||
|
|
||||||
param
|
param AForm = APred | AMod Adjf GenNum Case ;
|
||||||
AForm = APred | AMod Adjf GenNum Case ;
|
|
||||||
|
|
||||||
|
|
||||||
--2 For $Verb$
|
--2 For $Verb$
|
||||||
@@ -60,13 +64,23 @@ resource ParamGer = ParamX ** {
|
|||||||
--
|
--
|
||||||
-- CardOrd = NCard | NOrd ;
|
-- CardOrd = NCard | NOrd ;
|
||||||
-- DForm = unit | teen | ten ;
|
-- DForm = unit | teen | ten ;
|
||||||
--
|
|
||||||
----2 Transformations between parameter types
|
--2 Transformations between parameter types
|
||||||
--
|
|
||||||
-- oper
|
oper
|
||||||
-- agrP3 : Number -> Agr = \n ->
|
agrP3 : Number -> Agr = \n ->
|
||||||
-- {n = n ; p = P3} ;
|
{n = n ; p = P3} ;
|
||||||
--
|
|
||||||
|
gennum : Gender -> Number -> GenNum = \g,n ->
|
||||||
|
case n of {
|
||||||
|
Sg => GSg g ;
|
||||||
|
Pl => GPl
|
||||||
|
} ;
|
||||||
|
|
||||||
|
agrAdj : Gender -> Adjf -> Number -> Case -> AForm = \g,a,n,c ->
|
||||||
|
AMod a (gennum g n) c ;
|
||||||
|
|
||||||
|
|
||||||
-- conjAgr : Agr -> Agr -> Agr = \a,b -> {
|
-- conjAgr : Agr -> Agr -> Agr = \a,b -> {
|
||||||
-- n = conjNumber a.n b.n ;
|
-- n = conjNumber a.n b.n ;
|
||||||
-- p = conjPerson a.p b.p
|
-- p = conjPerson a.p b.p
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
-- More paradigms are given in $ParadigmsGer$.
|
-- More paradigms are given in $ParadigmsGer$.
|
||||||
|
|
||||||
-- The worst-case constructor for common nouns needs six forms: all plural forms
|
-- The worst-case constructor for common nouns needs six forms: all plural forms
|
||||||
-- are always the same except for the dative.
|
-- are always the same except for the dative. Actually the six forms are never
|
||||||
|
-- needed at the same time, but just subsets of them.
|
||||||
|
|
||||||
Noun : Type = {s : Number => Case => Str ; g : Gender} ;
|
Noun : Type = {s : Number => Case => Str ; g : Gender} ;
|
||||||
|
|
||||||
@@ -44,15 +45,6 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
g = g
|
g = g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- But we never need all the six forms at the same time. Often
|
|
||||||
-- we need just two or four forms.
|
|
||||||
|
|
||||||
mkN4 : (x1,_,_,x4 : Str) -> Gender -> Noun = \wein,weines,weine,weinen ->
|
|
||||||
mkN wein wein wein weines weine weinen ;
|
|
||||||
|
|
||||||
mkN2 : (x1,x2 : Str) -> Gender -> Noun = \frau,frauen ->
|
|
||||||
mkN4 frau frau frauen frauen ;
|
|
||||||
|
|
||||||
-- Adjectives need four forms: two for the positive and one for the other degrees.
|
-- Adjectives need four forms: two for the positive and one for the other degrees.
|
||||||
|
|
||||||
Adjective : Type = {s : Degree => AForm => Str} ;
|
Adjective : Type = {s : Degree => AForm => Str} ;
|
||||||
@@ -65,9 +57,6 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
regA : Str -> Adjective = \blau ->
|
|
||||||
mkA blau blau (blau + "er") (blau + "est") ;
|
|
||||||
|
|
||||||
-- This auxiliary gives the forms in each degree.
|
-- This auxiliary gives the forms in each degree.
|
||||||
|
|
||||||
adjForms : (x1,x2 : Str) -> AForm => Str = \teuer,teur ->
|
adjForms : (x1,x2 : Str) -> AForm => Str = \teuer,teur ->
|
||||||
@@ -156,7 +145,88 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Weak verbs, including "lächeln", "kümmern".
|
-- This function decides whether to add an "e" to the stem before "t".
|
||||||
|
-- Examples: "töten - tötet", "kehren - kehrt", "lernen - lernt", "atmen - atmet".
|
||||||
|
|
||||||
|
addE : Str -> Str = \stem ->
|
||||||
|
let
|
||||||
|
r = init (Predef.dp 2 stem) ;
|
||||||
|
n = last stem ;
|
||||||
|
e = case n of {
|
||||||
|
"t" | "d" => "e" ;
|
||||||
|
"e" | "h" => [] ;
|
||||||
|
_ => case r of {
|
||||||
|
"l" | "r" | "a" | "o" | "u" | "e" | "i" | "ü" | "ä" | "ö"|"h" => [] ;
|
||||||
|
_ => "e"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in
|
||||||
|
stem + e ;
|
||||||
|
|
||||||
|
-- Prepositions for complements indicate the complement case.
|
||||||
|
|
||||||
|
Preposition : Type = {s : Str ; c : Case} ;
|
||||||
|
|
||||||
|
-- Pronouns and articles
|
||||||
|
-- Here we define personal and relative pronouns.
|
||||||
|
-- All personal pronouns, except "ihr", conform to the simple
|
||||||
|
-- pattern $mkPronPers$.
|
||||||
|
|
||||||
|
ProPN = {s : NPForm => Str ; n : Number ; p : Person} ;
|
||||||
|
|
||||||
|
mkPronPers : (_,_,_,_,_ : Str) -> Number -> Person -> ProPN =
|
||||||
|
\ich,mich,mir,meiner,mein,n,p -> {
|
||||||
|
s = table {
|
||||||
|
NPCase c => caselist ich mich mir meiner ! c ;
|
||||||
|
NPPoss gn c => mein + pronEnding ! gn ! c
|
||||||
|
} ;
|
||||||
|
n = n ;
|
||||||
|
p = p
|
||||||
|
} ;
|
||||||
|
|
||||||
|
pronEnding : GenNum => Case => Str = table {
|
||||||
|
GSg Masc => caselist "" "en" "em" "es" ;
|
||||||
|
GSg Fem => caselist "e" "e" "er" "er" ;
|
||||||
|
GSg Neut => caselist "" "" "em" "es" ;
|
||||||
|
GPl => caselist "e" "e" "en" "er"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
artDef : GenNum => Case => Str = table {
|
||||||
|
GSg Masc => caselist "der" "den" "dem" "des" ;
|
||||||
|
GSg Fem => caselist "die" "die" "der" "der" ;
|
||||||
|
GSg Neut => caselist "das" "das" "dem" "des" ;
|
||||||
|
GPl => caselist "die" "die" "den" "der"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} =
|
||||||
|
-- \i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ;
|
||||||
|
--
|
||||||
|
-- mkNP : (i,me,my : Str) -> Number -> Person -> {s : Case => Str ; a : Agr} =
|
||||||
|
-- \i,me,my,n,p -> {
|
||||||
|
-- s = table {
|
||||||
|
-- Nom => i ;
|
||||||
|
-- Acc => me ;
|
||||||
|
-- Gen => my
|
||||||
|
-- } ;
|
||||||
|
-- a = {
|
||||||
|
-- n = n ;
|
||||||
|
-- p = p
|
||||||
|
-- }
|
||||||
|
-- } ;
|
||||||
|
--
|
||||||
|
-- These functions cover many cases; full coverage inflectional patterns are
|
||||||
|
-- in $MorphoGer$.
|
||||||
|
|
||||||
|
mkN4 : (x1,_,_,x4 : Str) -> Gender -> Noun = \wein,weines,weine,weinen ->
|
||||||
|
mkN wein wein wein weines weine weinen ;
|
||||||
|
|
||||||
|
mkN2 : (x1,x2 : Str) -> Gender -> Noun = \frau,frauen ->
|
||||||
|
mkN4 frau frau frauen frauen ;
|
||||||
|
|
||||||
|
regA : Str -> Adjective = \blau ->
|
||||||
|
mkA blau blau (blau + "er") (blau + "est") ;
|
||||||
|
|
||||||
regV : Str -> Verb = \legen ->
|
regV : Str -> Verb = \legen ->
|
||||||
let
|
let
|
||||||
@@ -178,60 +248,9 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- This function decides whether to add an "e" to the stem before "t".
|
|
||||||
-- Examples: "töten - tötet", "kehren - kehrt", "lernen - lernt", "atmen - atmet".
|
|
||||||
|
|
||||||
addE : Str -> Str = \stem ->
|
|
||||||
let
|
|
||||||
r = init (Predef.dp 2 stem) ;
|
|
||||||
n = last stem ;
|
|
||||||
e = case n of {
|
|
||||||
"t" | "d" => "e" ;
|
|
||||||
"e" => [] ;
|
|
||||||
_ => case r of {
|
|
||||||
"l" | "r" | "a" | "o" | "u" | "e" | "i" | "ü" | "ä" | "ö" | "h" => [] ;
|
|
||||||
_ => "e"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
in
|
|
||||||
stem + e ;
|
|
||||||
|
|
||||||
-- Prepositions for complements indicate the complement case.
|
|
||||||
|
|
||||||
Preposition : Type = {s : Str ; c : Case} ;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} =
|
|
||||||
-- \i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ;
|
|
||||||
--
|
|
||||||
-- mkNP : (i,me,my : Str) -> Number -> Person -> {s : Case => Str ; a : Agr} =
|
|
||||||
-- \i,me,my,n,p -> {
|
|
||||||
-- s = table {
|
|
||||||
-- Nom => i ;
|
|
||||||
-- Acc => me ;
|
|
||||||
-- Gen => my
|
|
||||||
-- } ;
|
|
||||||
-- a = {
|
|
||||||
-- n = n ;
|
|
||||||
-- p = p
|
|
||||||
-- }
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- These functions cover many cases; full coverage inflectional patterns are
|
|
||||||
-- in $MorphoGer$.
|
|
||||||
--
|
|
||||||
-- regN : Str -> {s : Number => Case => Str} = \car ->
|
|
||||||
-- mkNoun car (car + "'s") (car + "s") (car + "s'") ;
|
|
||||||
--
|
|
||||||
-- regA : Str -> {s : AForm => Str} = \warm ->
|
|
||||||
-- mkAdjective warm (warm + "er") (warm + "est") (warm + "ly") ;
|
|
||||||
--
|
|
||||||
-- regV : Str -> {s : VForm => Str} = \walk ->
|
|
||||||
-- mkVerb walk (walk + "s") (walk + "ed") (walk + "ed") (walk + "ing") ;
|
|
||||||
--
|
|
||||||
-- regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n ->
|
|
||||||
-- mkNP that that (that + "'s") n P3 ;
|
|
||||||
--
|
|
||||||
-- We have just a heuristic definition of the indefinite article.
|
-- We have just a heuristic definition of the indefinite article.
|
||||||
-- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic
|
-- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic
|
||||||
-- "o" ("one-sided"), vocalic "u" ("umbrella").
|
-- "o" ("one-sided"), vocalic "u" ("umbrella").
|
||||||
|
|||||||
Reference in New Issue
Block a user