mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 08:32:50 -06:00
completed German in 1.4
This commit is contained in:
@@ -28,6 +28,7 @@ concrete CatGer of Cat =
|
|||||||
IP = {s : Case => Str ; n : Number} ;
|
IP = {s : Case => Str ; n : Number} ;
|
||||||
IComp = {s : Agr => Str} ;
|
IComp = {s : Agr => Str} ;
|
||||||
IDet = {s : Gender => Case => Str ; n : Number} ;
|
IDet = {s : Gender => Case => Str ; n : Number} ;
|
||||||
|
IQuant = {s : Number => Gender => Case => Str} ;
|
||||||
|
|
||||||
-- Relative
|
-- Relative
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ concrete CatGer of Cat =
|
|||||||
-- Verb
|
-- Verb
|
||||||
|
|
||||||
VP = ResGer.VP ;
|
VP = ResGer.VP ;
|
||||||
|
VPSlash = ResGer.VP ** {c2 : Preposition} ;
|
||||||
Comp = {s : Agr => Str} ;
|
Comp = {s : Agr => Str} ;
|
||||||
|
|
||||||
-- Adjective
|
-- Adjective
|
||||||
@@ -53,7 +55,8 @@ concrete CatGer of Cat =
|
|||||||
Quant = {s : Number => Gender => Case => Str ; a : Adjf} ;
|
Quant = {s : Number => Gender => Case => Str ; a : Adjf} ;
|
||||||
Art = {s : Bool => Number => Gender => Case => Str ; a : Adjf} ;
|
Art = {s : Bool => Number => Gender => Case => Str ; a : Adjf} ;
|
||||||
Predet = {s : Number => Gender => Case => Str} ;
|
Predet = {s : Number => Gender => Case => Str} ;
|
||||||
Num = {s : Str; n : Number } ;
|
Num = {s : Str ; n : Number ; isNum : Bool} ;
|
||||||
|
Card = {s : Str ; n : Number} ;
|
||||||
Ord = {s : AForm => Str} ;
|
Ord = {s : AForm => Str} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
isPron = False
|
isPron = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
DetNP det = {
|
||||||
|
s = \\c => det.s ! Neutr ! c ; ---- genders
|
||||||
|
a = agrP3 det.n ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
UsePN pn = pn ** {a = agrP3 Sg} ;
|
UsePN pn = pn ** {a = agrP3 Sg} ;
|
||||||
|
|
||||||
UsePron pron = {
|
UsePron pron = {
|
||||||
@@ -31,18 +37,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
a = np.a
|
a = np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{- ---b
|
DetQuantOrd quant num ord =
|
||||||
DetSg quant ord =
|
|
||||||
let
|
|
||||||
n = Sg ;
|
|
||||||
a = quant.a
|
|
||||||
in {
|
|
||||||
s = \\g,c => quant.s ! n ! g ! c ++
|
|
||||||
ord.s ! agrAdj g (adjfCase a c) n c ;
|
|
||||||
n = n ;
|
|
||||||
a = a
|
|
||||||
} ;
|
|
||||||
DetPl quant num ord =
|
|
||||||
let
|
let
|
||||||
n = num.n ;
|
n = num.n ;
|
||||||
a = quant.a
|
a = quant.a
|
||||||
@@ -52,24 +47,60 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
n = n ;
|
n = n ;
|
||||||
a = a
|
a = a
|
||||||
} ;
|
} ;
|
||||||
-}
|
|
||||||
|
DetQuant quant num =
|
||||||
|
let
|
||||||
|
n = num.n ;
|
||||||
|
a = quant.a
|
||||||
|
in {
|
||||||
|
s = \\g,c => quant.s ! n ! g ! c ++ num.s ;
|
||||||
|
n = n ;
|
||||||
|
a = a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetArtOrd quant num ord =
|
||||||
|
let
|
||||||
|
n = num.n ;
|
||||||
|
a = quant.a
|
||||||
|
in {
|
||||||
|
s = \\g,c => quant.s ! num.isNum ! n ! g ! c ++
|
||||||
|
num.s ++ ord.s ! agrAdj g (adjfCase a c) n c ;
|
||||||
|
n = n ;
|
||||||
|
a = a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetArtCard quant num =
|
||||||
|
let
|
||||||
|
n = num.n ;
|
||||||
|
a = quant.a
|
||||||
|
in {
|
||||||
|
s = \\g,c => quant.s ! True ! n ! g ! c ++
|
||||||
|
num.s ;
|
||||||
|
n = n ;
|
||||||
|
a = a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetArtPl det cn = {
|
||||||
|
s = \\c => det.s ! False ! Pl ! cn.g ! c ++ cn.s ! adjfCase det.a c ! Pl ! c ;
|
||||||
|
a = agrP3 Pl ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetArtSg det cn = {
|
||||||
|
s = \\c => det.s ! False ! Sg ! cn.g ! c ++ cn.s ! adjfCase det.a c ! Sg ! c ;
|
||||||
|
a = agrP3 Sg ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
PossPron p = {
|
PossPron p = {
|
||||||
s = \\n,g,c => p.s ! NPPoss (gennum g n) c ;
|
s = \\n,g,c => p.s ! NPPoss (gennum g n) c ;
|
||||||
a = Strong --- need separately weak for Pl ?
|
a = Strong --- need separately weak for Pl ?
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---b NoNum = {s = []; n = Pl } ;
|
NumCard n = n ** {isNum = True} ;
|
||||||
---b NoOrd = {s = \\_ => []} ;
|
|
||||||
|
|
||||||
{- ---b
|
NumPl = {s = []; n = Pl ; isNum = False} ;
|
||||||
NumInt n = {s = n.s; n = table (Predef.Ints 1 * Predef.Ints 9) {
|
NumSg = {s = []; n = Sg ; isNum = False} ;
|
||||||
<0,1> => Sg ;
|
|
||||||
_ => Pl
|
|
||||||
} ! <1,2> ---- parser bug (AR 2/6/2007) <n.size,n.last>
|
|
||||||
} ;
|
|
||||||
OrdInt n = {s = \\_ => n.s ++ "."} ;
|
|
||||||
-}
|
|
||||||
|
|
||||||
NumDigits numeral = {s = numeral.s ! NCard; n = numeral.n } ;
|
NumDigits numeral = {s = numeral.s ! NCard; n = numeral.n } ;
|
||||||
OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ;
|
OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ;
|
||||||
@@ -87,18 +118,22 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
IndefArt = {
|
IndefArt = {
|
||||||
s = \\_ => table {
|
s = table {
|
||||||
|
True => \\_,_,_ => [] ;
|
||||||
|
False => table {
|
||||||
Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ;
|
Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ;
|
||||||
Pl => \\_,_ => []
|
Pl => \\_,_ => []
|
||||||
|
}
|
||||||
} ;
|
} ;
|
||||||
a = Strong
|
a = Strong
|
||||||
} ;
|
} ;
|
||||||
{- ---b
|
|
||||||
MassDet = {
|
MassNP cn = {
|
||||||
s = \\_,g,c => [] ;
|
s = \\c => cn.s ! adjfCase Strong c ! Sg ! c ;
|
||||||
a = Strong
|
a = agrP3 Sg ;
|
||||||
|
isPron = False
|
||||||
} ;
|
} ;
|
||||||
-}
|
|
||||||
UseN, UseN2 = \n -> {
|
UseN, UseN2 = \n -> {
|
||||||
s = \\_ => n.s ;
|
s = \\_ => n.s ;
|
||||||
g = n.g
|
g = n.g
|
||||||
@@ -108,12 +143,25 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
s = \\_,n,c => f.s ! n ! c ++ appPrep f.c2 x.s ;
|
s = \\_,n,c => f.s ! n ! c ++ appPrep f.c2 x.s ;
|
||||||
g = f.g
|
g = f.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplN3 f x = {
|
ComplN3 f x = {
|
||||||
s = \\n,c => f.s ! n ! c ++ appPrep f.c2 x.s ;
|
s = \\n,c => f.s ! n ! c ++ appPrep f.c2 x.s ;
|
||||||
g = f.g ;
|
g = f.g ;
|
||||||
c2 = f.c3
|
c2 = f.c3
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
Use2N3 f = {
|
||||||
|
s = f.s ;
|
||||||
|
g = f.g ;
|
||||||
|
c2 = f.c2
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Use3N3 f = {
|
||||||
|
s = f.s ;
|
||||||
|
g = f.g ;
|
||||||
|
c2 = f.c3
|
||||||
|
} ;
|
||||||
|
|
||||||
AdjCN ap cn =
|
AdjCN ap cn =
|
||||||
let
|
let
|
||||||
g = cn.g
|
g = cn.g
|
||||||
@@ -130,6 +178,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
g = cn.g
|
g = cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
RelNP np rs = {
|
||||||
|
s = \\c => np.s ! c ++ rs.s ! gennum np.a.g np.a.n ;
|
||||||
|
a = np.a ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
SentCN cn s = {
|
SentCN cn s = {
|
||||||
s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
|
s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
|
||||||
g = cn.g
|
g = cn.g
|
||||||
|
|||||||
@@ -67,19 +67,35 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
|
|||||||
n = ip.n
|
n = ip.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{- ---b
|
IdetCN idet cn =
|
||||||
IDetCN idet num ord cn =
|
|
||||||
let
|
let
|
||||||
g = cn.g ;
|
g = cn.g ;
|
||||||
n = idet.n
|
n = idet.n
|
||||||
in {
|
in {
|
||||||
s = \\c =>
|
s = \\c => idet.s ! g ! c ++ cn.s ! Weak ! n ! c ;
|
||||||
idet.s ! g ! c ++ num.s ++ ord.s ! agrAdj g Weak n c ++
|
|
||||||
cn.s ! Weak ! n ! c ;
|
|
||||||
n = n
|
n = n
|
||||||
} ;
|
} ;
|
||||||
-}
|
|
||||||
|
IdetIP idet =
|
||||||
|
let
|
||||||
|
g = Neutr ; ----
|
||||||
|
n = idet.n
|
||||||
|
in {
|
||||||
|
s = idet.s ! g ;
|
||||||
|
n = n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdetQuant idet num =
|
||||||
|
let
|
||||||
|
n = num.n
|
||||||
|
in {
|
||||||
|
s = \\g,c => idet.s ! n ! g ! c ++ num.s ;
|
||||||
|
n = n
|
||||||
|
} ;
|
||||||
|
|
||||||
CompIAdv a = {s = \\_ => a.s} ;
|
CompIAdv a = {s = \\_ => a.s} ;
|
||||||
|
|
||||||
|
CompIP ip = {s = \\_ => ip.s ! Nom} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
insertAdV : Str -> VP -> VP = \adv,vp -> {
|
insertAdV : Str -> VP -> VP = \adv,vp -> {
|
||||||
s = vp.s ;
|
s = vp.s ;
|
||||||
a1 = \\a => vp.a1 ! a ++ adv ;
|
a1 = \\a => adv ++ vp.a1 ! a ; -- immer nicht
|
||||||
n2 = vp.n2 ;
|
n2 = vp.n2 ;
|
||||||
a2 = vp.a2 ;
|
a2 = vp.a2 ;
|
||||||
isAux = vp.isAux ;
|
isAux = vp.isAux ;
|
||||||
|
|||||||
@@ -22,16 +22,12 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
|
|||||||
verb.fin ++ ps.p2 ++
|
verb.fin ++ ps.p2 ++
|
||||||
vp.n2 ! agr ++ vp.a1 ! pol ++ vp.a2 ++ inf ++ vp.ext
|
vp.n2 ! agr ++ vp.a1 ! pol ++ vp.a2 ++ inf ++ vp.ext
|
||||||
} ;
|
} ;
|
||||||
{- ---b
|
|
||||||
SlashV2 np v2 =
|
|
||||||
mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ;
|
|
||||||
|
|
||||||
SlashVVV2 np vv v2 =
|
SlashVP np vp =
|
||||||
mkClause (np.s ! Nom) np.a
|
mkClause
|
||||||
(insertInf (v2.prefix ++ v2.s ! VInf (notB vv.isAux))
|
(np.s ! Nom) np.a
|
||||||
(predVGen vv.isAux vv)) **
|
vp **
|
||||||
{c2 = v2.c2} ;
|
{c2 = vp.c2} ;
|
||||||
-}
|
|
||||||
|
|
||||||
AdvSlash slash adv = {
|
AdvSlash slash adv = {
|
||||||
s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ;
|
s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ;
|
||||||
@@ -66,4 +62,6 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
|
|||||||
|
|
||||||
AdvS a s = {s = \\o => a.s ++ s.s ! Inv} ;
|
AdvS a s = {s = \\o => a.s ++ s.s ! Inv} ;
|
||||||
|
|
||||||
|
RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! gennum Neutr Sg} ; --- "welches"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,30 +20,48 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer in {
|
|||||||
insertExtrapos (q.s ! QIndir) (predV v) ;
|
insertExtrapos (q.s ! QIndir) (predV v) ;
|
||||||
ComplVA v ap = insertObj (\\ _ => ap.s ! APred) (predV v) ;
|
ComplVA v ap = insertObj (\\ _ => ap.s ! APred) (predV v) ;
|
||||||
|
|
||||||
{- ---b
|
SlashV2a v = predV v ** {c2 = v.c2} ;
|
||||||
ComplV2 v np =
|
|
||||||
insertObj (\\_ => appPrep v.c2 np.s) (predV v) ;
|
|
||||||
ComplV3 v np np2 =
|
|
||||||
insertObj (\\_ => appPrep v.c2 np.s ++ appPrep v.c3 np2.s) (predV v) ;
|
|
||||||
|
|
||||||
ComplV2S v np s =
|
Slash2V3 v np =
|
||||||
insertExtrapos (conjThat ++ s.s ! Sub)
|
insertObj (\\_ => appPrep v.c2 np.s) (predV v) ** {c2 = v.c3} ;
|
||||||
(insertObj (\\_ => appPrep v.c2 np.s) (predV v)) ;
|
Slash3V3 v np =
|
||||||
ComplV2Q v np q =
|
insertObj (\\_ => appPrep v.c3 np.s) (predV v) ** {c2 = v.c2} ;
|
||||||
insertExtrapos (q.s ! QIndir)
|
|
||||||
(insertObj (\\_ => appPrep v.c2 np.s) (predV v)) ;
|
SlashV2S v s =
|
||||||
ComplV2V v np vp =
|
insertExtrapos (conjThat ++ s.s ! Sub) (predV v) ** {c2 = v.c2} ;
|
||||||
|
SlashV2Q v q =
|
||||||
|
insertExtrapos (q.s ! QIndir) (predV v) ** {c2 = v.c2} ;
|
||||||
|
SlashV2V v vp =
|
||||||
|
let
|
||||||
|
vpi = infVP False vp
|
||||||
|
in
|
||||||
|
insertExtrapos vpi.p3 (
|
||||||
|
insertInf vpi.p2 (
|
||||||
|
insertObj vpi.p1 ((predV v)))) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
|
SlashV2A v ap =
|
||||||
|
insertObj (\\_ => ap.s ! APred) (predV v) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
|
ComplSlash vp np = insertObj (\\_ => appPrep vp.c2 np.s) vp ;
|
||||||
|
|
||||||
|
SlashVV v vp =
|
||||||
|
let
|
||||||
|
vpi = infVP v.isAux vp
|
||||||
|
in
|
||||||
|
insertExtrapos vpi.p3 (
|
||||||
|
insertInf vpi.p2 (
|
||||||
|
insertObj vpi.p1 (
|
||||||
|
predVGen v.isAux v))) ** {c2 = vp.c2} ;
|
||||||
|
|
||||||
|
SlashV2VNP v np vp =
|
||||||
let
|
let
|
||||||
vpi = infVP False vp
|
vpi = infVP False vp
|
||||||
in
|
in
|
||||||
insertExtrapos vpi.p3 (
|
insertExtrapos vpi.p3 (
|
||||||
insertInf vpi.p2 (
|
insertInf vpi.p2 (
|
||||||
insertObj vpi.p1 (
|
insertObj vpi.p1 (
|
||||||
(insertObj (\\_ => appPrep v.c2 np.s) (predV v))))) ;
|
insertObj (\\_ => appPrep v.c2 np.s) (
|
||||||
|
predV v)))) ** {c2 = v.c2} ;
|
||||||
ComplV2A v np ap =
|
|
||||||
insertObj (\\_ => appPrep v.c2 np.s ++ ap.s ! APred) (predV v) ;
|
|
||||||
-}
|
|
||||||
|
|
||||||
UseComp comp = insertAdv (comp.s ! agrP3 Sg) (predV sein_V) ; -- agr not used
|
UseComp comp = insertAdv (comp.s ! agrP3 Sg) (predV sein_V) ; -- agr not used
|
||||||
-- we want to say "ich liebe sie nicht" but not "ich bin alt nicht"
|
-- we want to say "ich liebe sie nicht" but not "ich bin alt nicht"
|
||||||
@@ -55,7 +73,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer in {
|
|||||||
AdvVP vp adv = insertAdv adv.s vp ;
|
AdvVP vp adv = insertAdv adv.s vp ;
|
||||||
AdVVP adv vp = insertAdV adv.s vp ;
|
AdVVP adv vp = insertAdV adv.s vp ;
|
||||||
|
|
||||||
---b ReflV2 v = insertObj (\\a => appPrep v.c2 (reflPron ! a)) (predV v) ;
|
ReflVP vp = insertObj (\\a => appPrep vp.c2 (reflPron ! a)) vp ;
|
||||||
|
|
||||||
PassV2 v = insertInf (v.s ! VPastPart APred) (predV werdenPass) ;
|
PassV2 v = insertInf (v.s ! VPastPart APred) (predV werdenPass) ;
|
||||||
|
|
||||||
|
|||||||
@@ -164,14 +164,14 @@ incomplete concrete NounScand of Noun =
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
Use2N3 f = {
|
Use2N3 f = {
|
||||||
s = \\n,d,c => f.s ! n ! d ! Nom ;
|
s = f.s ;
|
||||||
g = f.g ;
|
g = f.g ;
|
||||||
c2 = f.c2 ;
|
c2 = f.c2 ;
|
||||||
isMod = False
|
isMod = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Use3N3 f = {
|
Use3N3 f = {
|
||||||
s = \\n,d,c => f.s ! n ! d ! Nom ;
|
s = f.s ;
|
||||||
g = f.g ;
|
g = f.g ;
|
||||||
c2 = f.c3 ;
|
c2 = f.c3 ;
|
||||||
isMod = False
|
isMod = False
|
||||||
|
|||||||
Reference in New Issue
Block a user