mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-14 05:32:51 -06:00
German numerals and coordination
This commit is contained in:
@@ -9,7 +9,7 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
|
|||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
ComparA a np = {
|
ComparA a np = {
|
||||||
s = \\af => a.s ! Compar ! af ++ "als" ++ np.s ! Nom ;
|
s = \\af => a.s ! Compar ! af ++ conjThan ++ np.s ! Nom ;
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ concrete CatGer of Cat = open ResGer, Prelude 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 = {s : Gender => Case => Str} ;
|
Num = {s : Gender => Case => Str} ;
|
||||||
Ord = {s : Adjf => Gender => Case => Str} ;
|
Ord = {s : AForm => 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} ;
|
||||||
@@ -54,11 +54,11 @@ concrete CatGer of Cat = open ResGer, Prelude in {
|
|||||||
|
|
||||||
RP = {s : GenNum => Case => Str ; a : RAgr} ;
|
RP = {s : GenNum => Case => Str ; a : RAgr} ;
|
||||||
|
|
||||||
-- Numeral = {s : CardOrd => Str ; n : Number} ;
|
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||||
|
|
||||||
CAdv = {s : Str} ;
|
CAdv = {s : Str} ;
|
||||||
|
|
||||||
-- Conj = {s : Str ; n : Number} ;
|
Conj = {s : Str ; n : Number} ;
|
||||||
-- DConj = {s1,s2 : Str ; n : Number} ;
|
DConj = {s1,s2 : Str ; n : Number} ;
|
||||||
--
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,45 +1,45 @@
|
|||||||
concrete ConjunctionGer of Conjunction =
|
concrete ConjunctionGer of Conjunction =
|
||||||
CatGer ** open ResGer, Coordination, Prelude in {
|
CatGer ** open ResGer, Coordination, Prelude in {
|
||||||
--
|
|
||||||
-- flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
--
|
|
||||||
-- lin
|
lin
|
||||||
--
|
|
||||||
-- ConjS = conjunctSS ;
|
ConjS conj ss = conjunctTable Order conj ss ;
|
||||||
-- DConjS = conjunctDistrSS ;
|
DConjS conj ss = conjunctDistrTable Order conj ss ;
|
||||||
--
|
|
||||||
-- ConjAdv = conjunctSS ;
|
ConjAdv conj ss = conjunctSS conj ss ;
|
||||||
-- DConjAdv = conjunctDistrSS ;
|
DConjAdv conj ss = conjunctDistrSS conj ss ;
|
||||||
--
|
|
||||||
-- ConjNP conj ss = conjunctTable Case conj ss ** {
|
ConjNP conj ss = conjunctTable Case conj ss ** {
|
||||||
-- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||||
-- } ;
|
} ;
|
||||||
-- DConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
DConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||||
-- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||||
-- } ;
|
} ;
|
||||||
--
|
|
||||||
-- ConjAP conj ss = conjunctTable Agr conj ss ** {
|
ConjAP conj ss = conjunctTable AForm conj ss ** {
|
||||||
-- isPre = ss.isPre
|
isPre = ss.isPre
|
||||||
-- } ;
|
} ;
|
||||||
-- DConjAP conj ss = conjunctDistrTable Agr conj ss ** {
|
DConjAP conj ss = conjunctDistrTable AForm conj ss ** {
|
||||||
-- isPre = ss.isPre
|
isPre = ss.isPre
|
||||||
-- } ;
|
} ;
|
||||||
--
|
|
||||||
---- These fun's are generated from the list cat's.
|
-- These fun's are generated from the list cat's.
|
||||||
--
|
|
||||||
-- BaseS = twoSS ;
|
BaseS = twoTable Order ;
|
||||||
-- ConsS = consrSS comma ;
|
ConsS = consrTable Order comma ;
|
||||||
-- BaseAdv = twoSS ;
|
BaseAdv = twoSS ;
|
||||||
-- ConsAdv = consrSS comma ;
|
ConsAdv = consrSS comma ;
|
||||||
-- BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
|
BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
|
||||||
-- ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
|
ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||||
-- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
|
BaseAP x y = twoTable AForm x y ** {isPre = andB x.isPre y.isPre} ;
|
||||||
-- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
ConsAP xs x = consrTable AForm comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
||||||
--
|
|
||||||
-- lincat
|
lincat
|
||||||
-- [S] = {s1,s2 : Str} ;
|
[S] = {s1,s2 : Order => Str} ;
|
||||||
-- [Adv] = {s1,s2 : Str} ;
|
[Adv] = {s1,s2 : Str} ;
|
||||||
-- [NP] = {s1,s2 : Case => Str ; a : Agr} ;
|
[NP] = {s1,s2 : Case => Str ; a : Agr} ;
|
||||||
-- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
|
[AP] = {s1,s2 : AForm => Str ; isPre : Bool} ;
|
||||||
--
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,13 +45,19 @@ concrete LexGer of Lex = CatGer ** open ResGer, Prelude in {
|
|||||||
whichPl_IDet = {s = appAdj (regA "welch") ! Sg ; n = Pl} ;
|
whichPl_IDet = {s = appAdj (regA "welch") ! Sg ; n = Pl} ;
|
||||||
|
|
||||||
-- one_Numeral = {s = table {NCard => "one" ; NOrd => "first"} ; n = Sg} ;
|
-- one_Numeral = {s = table {NCard => "one" ; NOrd => "first"} ; n = Sg} ;
|
||||||
-- forty_Numeral = {s = table {NCard => "forty" ; NOrd => "fortieth"} ; n = Pl} ;
|
forty_Numeral = {
|
||||||
|
s = table {
|
||||||
|
NCard => "vierzig" ;
|
||||||
|
NOrd af => (regA "vierzigt").s ! Posit ! af
|
||||||
|
} ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
|
||||||
in_Prep = {s = "in" ; c = Dat} ;
|
in_Prep = {s = "in" ; c = Dat} ;
|
||||||
of_Prep = {s = "von" ; c = Dat} ;
|
of_Prep = {s = "von" ; c = Dat} ;
|
||||||
|
|
||||||
-- and_Conj = {s = "and" ; n = Pl} ;
|
and_Conj = {s = "und" ; n = Pl} ;
|
||||||
-- either7or_DConj = {s1 = "either" ; s2 = "or" ; n = Sg} ;
|
either7or_DConj = {s1 = "entweder" ; s2 = "oder" ; n = Sg} ;
|
||||||
|
|
||||||
if_Subj = ss "wenn" ;
|
if_Subj = ss "wenn" ;
|
||||||
because_Subj = ss "weil" ;
|
because_Subj = ss "weil" ;
|
||||||
|
|||||||
@@ -4,15 +4,9 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
DetCN det cn = {
|
DetCN det cn = {
|
||||||
s = \\c => det.s ! cn.g ! c ++ cn.s ! adjfCase c ! det.n ! c ;
|
s = \\c => det.s ! cn.g ! c ++ cn.s ! adjfCase det.a c ! det.n ! c ;
|
||||||
a = agrP3 det.n ;
|
a = agrP3 det.n ;
|
||||||
isPron = False
|
isPron = False
|
||||||
}
|
|
||||||
where {
|
|
||||||
adjfCase : Case -> Adjf = \c -> case <det.a,c> of {
|
|
||||||
<Strong, Nom|Acc> => Strong ;
|
|
||||||
_ => Weak
|
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UsePN pn = pn ** {a = agrP3 Sg} ;
|
UsePN pn = pn ** {a = agrP3 Sg} ;
|
||||||
@@ -27,7 +21,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
a = quant.a
|
a = quant.a
|
||||||
in {
|
in {
|
||||||
s = \\g,c => pred.s ! n ! g ! c ++ quant.s ! g ! c ++
|
s = \\g,c => pred.s ! n ! g ! c ++ quant.s ! g ! c ++
|
||||||
num.s ! g ! c ++ ord.s ! a ! g ! c ;
|
num.s ! g ! c ++ ord.s ! agrAdj g (adjfCase a c) n c ;
|
||||||
n = n ;
|
n = n ;
|
||||||
a = a
|
a = a
|
||||||
} ;
|
} ;
|
||||||
@@ -46,17 +40,16 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
|
|
||||||
NoPredet = {s = \\_,_,_ => []} ;
|
NoPredet = {s = \\_,_,_ => []} ;
|
||||||
NoNum = {s = \\_,_ => []} ;
|
NoNum = {s = \\_,_ => []} ;
|
||||||
NoOrd = {s = \\_,_,_ => []} ;
|
NoOrd = {s = \\_ => []} ;
|
||||||
|
|
||||||
NumInt n = {s = \\_,_ => n.s} ;
|
NumInt n = {s = \\_,_ => n.s} ;
|
||||||
|
|
||||||
--
|
NumNumeral numeral = {s = \\_,_ => numeral.s ! NCard} ;
|
||||||
-- NumNumeral numeral = {s = numeral.s ! NCard} ;
|
OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ;
|
||||||
-- OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
|
||||||
--
|
AdNum adn num = {s = \\g,c => adn.s ++ num.s ! g ! c} ;
|
||||||
-- AdNum adn num = {s = adn.s ++ num.s} ;
|
|
||||||
--
|
OrdSuperl a = {s = a.s ! Superl} ;
|
||||||
-- OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
|
||||||
|
|
||||||
DefSg = {
|
DefSg = {
|
||||||
s = \\g,c => artDef ! GSg g ! c ;
|
s = \\g,c => artDef ! GSg g ! c ;
|
||||||
|
|||||||
@@ -68,10 +68,10 @@ resource ParamGer = ParamX ** {
|
|||||||
|
|
||||||
RAgr = RNoAg | RAg {n : Number ; p : Person} ;
|
RAgr = RNoAg | RAg {n : Number ; p : Person} ;
|
||||||
|
|
||||||
----2 For $Numeral$
|
--2 For $Numeral$
|
||||||
--
|
|
||||||
-- CardOrd = NCard | NOrd ;
|
CardOrd = NCard | NOrd AForm ;
|
||||||
-- DForm = unit | teen | ten ;
|
DForm = unit | teen | ten ;
|
||||||
|
|
||||||
--2 Transformations between parameter types
|
--2 Transformations between parameter types
|
||||||
|
|
||||||
@@ -96,6 +96,13 @@ resource ParamGer = ParamX ** {
|
|||||||
agrAdj : Gender -> Adjf -> Number -> Case -> AForm = \g,a,n,c ->
|
agrAdj : Gender -> Adjf -> Number -> Case -> AForm = \g,a,n,c ->
|
||||||
AMod a (gennum g n) c ;
|
AMod a (gennum g n) c ;
|
||||||
|
|
||||||
|
-- This is used twice in NounGer.
|
||||||
|
|
||||||
|
adjfCase : Adjf -> Case -> Adjf = \a,c -> case <a,c> of {
|
||||||
|
<Strong, Nom|Acc> => Strong ;
|
||||||
|
_ => Weak
|
||||||
|
} ;
|
||||||
|
|
||||||
vFin : Tense -> Agr -> VForm = \t,a ->
|
vFin : Tense -> Agr -> VForm = \t,a ->
|
||||||
case t of {
|
case t of {
|
||||||
Pres => VPresInd a.n a.p ;
|
Pres => VPresInd a.n a.p ;
|
||||||
@@ -103,9 +110,9 @@ resource ParamGer = ParamX ** {
|
|||||||
_ => VInf --- never used
|
_ => VInf --- never used
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- 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
|
||||||
-- } ;
|
} ;
|
||||||
--
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
|
|||||||
n = idet.n
|
n = idet.n
|
||||||
in {
|
in {
|
||||||
s = \\c =>
|
s = \\c =>
|
||||||
idet.s ! g ! c ++ num.s ! g ! c ++ ord.s ! Weak ! g ! c ++ cn.s ! Weak ! n ! c ;
|
idet.s ! g ! c ++ num.s ! g ! c ++ ord.s ! agrAdj g Weak n c ++
|
||||||
|
cn.s ! Weak ! n ! c ;
|
||||||
n = n
|
n = n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -117,5 +117,23 @@ NounGer: RelCN
|
|||||||
> p -cat=RCl -mcfg "der geht" | l -table
|
> p -cat=RCl -mcfg "der geht" | l -table
|
||||||
> p -cat=NP -mcfg "der Hund dem wir helfen wollen" | l -table
|
> p -cat=NP -mcfg "der Hund dem wir helfen wollen" | l -table
|
||||||
|
|
||||||
|
NounGer: Num and Ord related rules
|
||||||
|
CatGer: Ord has parametric AForm; Num has no params
|
||||||
|
ParamGer: CardOrd
|
||||||
|
LexGer: Numeral
|
||||||
|
> p -cat=NP "meine vierzig warmen Hünde"
|
||||||
|
> p -cat=NP "mein vierzigter Hund"
|
||||||
|
|
||||||
|
CatGer: Conj, DConj
|
||||||
|
ConjunctionGer: all (mostly from Scand)
|
||||||
|
LexGer: Conj, DConj
|
||||||
|
> p -cat=NP "ich und der Hund" | l -table
|
||||||
|
> p -cat=S -mcfg "ich und der Hund sind entweder warm oder warm"
|
||||||
|
|
||||||
|
> pm -printer=missing
|
||||||
|
TestGer
|
||||||
|
AdVVP AdvSC ComplV2A ComplVA EmbedQS EmbedS EmbedVP PassV2 ReflA2 ReflV2 UttVP
|
||||||
|
one_Numeral
|
||||||
|
|
||||||
|
wc german/*.gfc
|
||||||
|
1231 4116 98878 total
|
||||||
Reference in New Issue
Block a user