completed German in 1.4

This commit is contained in:
aarne
2008-06-04 12:09:14 +00:00
parent 0797d5940a
commit 869e0563d1
7 changed files with 158 additions and 69 deletions

View File

@@ -28,6 +28,7 @@ concrete CatGer of Cat =
IP = {s : Case => Str ; n : Number} ;
IComp = {s : Agr => Str} ;
IDet = {s : Gender => Case => Str ; n : Number} ;
IQuant = {s : Number => Gender => Case => Str} ;
-- Relative
@@ -37,6 +38,7 @@ concrete CatGer of Cat =
-- Verb
VP = ResGer.VP ;
VPSlash = ResGer.VP ** {c2 : Preposition} ;
Comp = {s : Agr => Str} ;
-- Adjective
@@ -53,7 +55,8 @@ concrete CatGer of Cat =
Quant = {s : Number => Gender => Case => Str ; a : Adjf} ;
Art = {s : Bool => Number => Gender => Case => Str ; a : Adjf} ;
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} ;
-- Numeral

View File

@@ -9,6 +9,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
isPron = False
} ;
DetNP det = {
s = \\c => det.s ! Neutr ! c ; ---- genders
a = agrP3 det.n ;
isPron = False
} ;
UsePN pn = pn ** {a = agrP3 Sg} ;
UsePron pron = {
@@ -31,18 +37,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
a = np.a
} ;
{- ---b
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 =
DetQuantOrd quant num ord =
let
n = num.n ;
a = quant.a
@@ -52,24 +47,60 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
n = n ;
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 = {
s = \\n,g,c => p.s ! NPPoss (gennum g n) c ;
a = Strong --- need separately weak for Pl ?
} ;
---b NoNum = {s = []; n = Pl } ;
---b NoOrd = {s = \\_ => []} ;
NumCard n = n ** {isNum = True} ;
{- ---b
NumInt n = {s = n.s; n = table (Predef.Ints 1 * Predef.Ints 9) {
<0,1> => Sg ;
_ => Pl
} ! <1,2> ---- parser bug (AR 2/6/2007) <n.size,n.last>
} ;
OrdInt n = {s = \\_ => n.s ++ "."} ;
-}
NumPl = {s = []; n = Pl ; isNum = False} ;
NumSg = {s = []; n = Sg ; isNum = False} ;
NumDigits numeral = {s = numeral.s ! NCard; n = numeral.n } ;
OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ;
@@ -87,18 +118,22 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
} ;
IndefArt = {
s = \\_ => table {
Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ;
Pl => \\_,_ => []
s = table {
True => \\_,_,_ => [] ;
False => table {
Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ;
Pl => \\_,_ => []
}
} ;
a = Strong
} ;
{- ---b
MassDet = {
s = \\_,g,c => [] ;
a = Strong
MassNP cn = {
s = \\c => cn.s ! adjfCase Strong c ! Sg ! c ;
a = agrP3 Sg ;
isPron = False
} ;
-}
UseN, UseN2 = \n -> {
s = \\_ => n.s ;
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 ;
g = f.g
} ;
ComplN3 f x = {
s = \\n,c => f.s ! n ! c ++ appPrep f.c2 x.s ;
g = f.g ;
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 =
let
g = cn.g
@@ -130,6 +178,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
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 = {
s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
g = cn.g

View File

@@ -66,20 +66,36 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
s = \\c => ip.s ! c ++ adv.s ;
n = ip.n
} ;
{- ---b
IDetCN idet num ord cn =
IdetCN idet cn =
let
g = cn.g ;
n = idet.n
in {
s = \\c =>
idet.s ! g ! c ++ num.s ++ ord.s ! agrAdj g Weak n c ++
cn.s ! Weak ! n ! c ;
s = \\c => idet.s ! g ! c ++ cn.s ! Weak ! n ! c ;
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} ;
CompIP ip = {s = \\_ => ip.s ! Nom} ;
}

View File

@@ -507,7 +507,7 @@ resource ResGer = ParamX ** open Prelude in {
insertAdV : Str -> VP -> VP = \adv,vp -> {
s = vp.s ;
a1 = \\a => vp.a1 ! a ++ adv ;
a1 = \\a => adv ++ vp.a1 ! a ; -- immer nicht
n2 = vp.n2 ;
a2 = vp.a2 ;
isAux = vp.isAux ;

View File

@@ -22,16 +22,12 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
verb.fin ++ ps.p2 ++
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 =
mkClause (np.s ! Nom) np.a
(insertInf (v2.prefix ++ v2.s ! VInf (notB vv.isAux))
(predVGen vv.isAux vv)) **
{c2 = v2.c2} ;
-}
SlashVP np vp =
mkClause
(np.s ! Nom) np.a
vp **
{c2 = vp.c2} ;
AdvSlash slash adv = {
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} ;
RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! gennum Neutr Sg} ; --- "welches"
}

View File

@@ -20,30 +20,48 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer in {
insertExtrapos (q.s ! QIndir) (predV v) ;
ComplVA v ap = insertObj (\\ _ => ap.s ! APred) (predV v) ;
{- ---b
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) ;
SlashV2a v = predV v ** {c2 = v.c2} ;
Slash2V3 v np =
insertObj (\\_ => appPrep v.c2 np.s) (predV v) ** {c2 = v.c3} ;
Slash3V3 v np =
insertObj (\\_ => appPrep v.c3 np.s) (predV v) ** {c2 = v.c2} ;
ComplV2S v np s =
insertExtrapos (conjThat ++ s.s ! Sub)
(insertObj (\\_ => appPrep v.c2 np.s) (predV v)) ;
ComplV2Q v np q =
insertExtrapos (q.s ! QIndir)
(insertObj (\\_ => appPrep v.c2 np.s) (predV v)) ;
ComplV2V v np vp =
SlashV2S v s =
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
vpi = infVP False vp
in
insertExtrapos vpi.p3 (
insertInf vpi.p2 (
insertObj vpi.p1 (
(insertObj (\\_ => appPrep v.c2 np.s) (predV v))))) ;
ComplV2A v np ap =
insertObj (\\_ => appPrep v.c2 np.s ++ ap.s ! APred) (predV v) ;
-}
insertObj (\\_ => appPrep v.c2 np.s) (
predV v)))) ** {c2 = v.c2} ;
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"
@@ -55,7 +73,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer in {
AdvVP vp adv = 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) ;

View File

@@ -164,14 +164,14 @@ incomplete concrete NounScand of Noun =
} ;
Use2N3 f = {
s = \\n,d,c => f.s ! n ! d ! Nom ;
s = f.s ;
g = f.g ;
c2 = f.c2 ;
isMod = False
} ;
Use3N3 f = {
s = \\n,d,c => f.s ! n ! d ! Nom ;
s = f.s ;
g = f.g ;
c2 = f.c3 ;
isMod = False