forked from GitHub/gf-core
finishing TestGerman
This commit is contained in:
@@ -20,10 +20,10 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
|
||||
isPre = True
|
||||
} ;
|
||||
|
||||
-- ReflA2 a = {
|
||||
-- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
ReflA2 a = {
|
||||
s = \\af => a.s ! Posit ! APred ++ appPrep a.c2 (reflPron ! agrP3 Sg) ; --- agr
|
||||
isPre = True
|
||||
} ;
|
||||
|
||||
SentAP ap sc = {
|
||||
s = \\a => ap.s ! a ++ sc.s ;
|
||||
|
||||
@@ -15,7 +15,7 @@ concrete AdverbGer of Adverb = CatGer ** open ResGer, Prelude in {
|
||||
AdAdv = cc2 ;
|
||||
|
||||
SubjS subj s = {s = subj.s ++ s.s ! Sub} ;
|
||||
-- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing
|
||||
AdvSC s = s ;
|
||||
|
||||
AdnCAdv cadv = {s = cadv.s ++ conjThan} ;
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ concrete CatGer of Cat = open ResGer, Prelude in {
|
||||
-- Open lexical classes, e.g. Basic
|
||||
|
||||
V, VS, VQ, VA = ResGer.Verb ; -- = {s : VForm => Str} ;
|
||||
VV = Verb ** {part : Str} ;
|
||||
VV = Verb ** {isAux : Bool} ;
|
||||
V2, V2A = Verb ** {c2 : Preposition} ;
|
||||
V3 = Verb ** {c2, c3 : Preposition} ;
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ concrete LexGer of Lex = CatGer ** open ResGer, Prelude in {
|
||||
mkV
|
||||
"gehen" "gehe" "gehst" "geht" "geht" "geh"
|
||||
"ging" "gingst" "gingt" "gingen"
|
||||
"ginge" "gegangen" VSein ;
|
||||
"ginge" "gegangen" "aus" VSein ;
|
||||
help_V2 =
|
||||
mkV
|
||||
"helfen" "helfe" "hilfst" "hilft" "helft" "hilf"
|
||||
"half" "halfst" "halft" "halfen"
|
||||
"hälfe" "geholfen" VHaben **
|
||||
"hälfe" "geholfen" [] VHaben **
|
||||
{c2 = {s = [] ; c = Dat}} ;
|
||||
show_V3 =
|
||||
regV "zeigen" **
|
||||
@@ -21,13 +21,13 @@ concrete LexGer of Lex = CatGer ** open ResGer, Prelude in {
|
||||
(mkV
|
||||
"wollen" "will" "willst" "will" "wollt" "woll"
|
||||
"wollte" "wolltest" "wollten" "wolltet"
|
||||
"wollte" "gewollen"
|
||||
"wollte" "gewollen" []
|
||||
VHaben) ;
|
||||
claim_VS =
|
||||
mkV
|
||||
"behaupten" "behaupte" "bahauptest" "behauptet" "behauptet" "behaupte"
|
||||
"behauptete" "behauptetest" "behauptetet" "behaupteten"
|
||||
"behauptete" "behauptet" VHaben ;
|
||||
"behauptete" "behauptet" [] VHaben ;
|
||||
ask_VQ =
|
||||
regV "fragen" ;
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
||||
NoOrd = {s = \\_ => []} ;
|
||||
|
||||
NumInt n = {s = \\_,_ => n.s} ;
|
||||
OrdInt n = {s = \\_ => n.s ++ "."} ;
|
||||
|
||||
NumNumeral numeral = {s = \\_,_ => numeral.s ! NCard} ;
|
||||
OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
concrete PhraseGer of Phrase = CatGer, TenseX ** open ResGer in {
|
||||
concrete PhraseGer of Phrase = CatGer, TenseX ** open Prelude, ResGer in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
@@ -13,7 +13,11 @@ concrete PhraseGer of Phrase = CatGer, TenseX ** open ResGer in {
|
||||
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np = {s = np.s ! Acc} ;
|
||||
---- UttVP vp = {s = infMark ++ infVP vp (agrP3 Sg)} ;
|
||||
UttVP vp =
|
||||
let
|
||||
vpi = vp.s ! agrP3 Sg ! VPInfinit Simul --- agr
|
||||
in
|
||||
ss (vp.n2 ! agrP3 Sg ++ vp.a2 ++ vpi.fin ++ infPart False ++ vpi.inf) ;
|
||||
UttAdv adv = adv ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
|
||||
@@ -62,10 +62,10 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
-- suffixes "t" and "st". Auxiliaries like "sein" will have to
|
||||
-- make extra cases even for this.
|
||||
|
||||
Verb : Type = {s : VForm => Str ; aux : VAux} ;
|
||||
Verb : Type = {s : VForm => Str ; prefix : Str ; aux : VAux} ;
|
||||
|
||||
mkV : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> VAux -> Verb =
|
||||
\geben,gebe,gibst,gibt,gebt,gib,gab,gabst,gaben,gabt,gaebe,gegeben,aux ->
|
||||
mkV : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> Str -> VAux -> Verb =
|
||||
\geben,gebe,gibst,gibt,gebt,gib,gab,gabst,gaben,gabt,gaebe,gegeben,ein,aux ->
|
||||
{s = table {
|
||||
VInf => geben ;
|
||||
VPresInd Sg P1 => gebe ;
|
||||
@@ -90,6 +90,7 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
VImpfSubj Pl _ => gaebe + "n" ;
|
||||
VPastPart a => (regA gegeben).s ! Posit ! a
|
||||
} ;
|
||||
prefix = ein ;
|
||||
aux = aux
|
||||
} ;
|
||||
|
||||
@@ -113,7 +114,7 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
legen lege (leg+"st") legt legt leg
|
||||
legte (legte + "st") (legte + "n") (legte + "t")
|
||||
legte ("ge" + legt)
|
||||
VHaben ;
|
||||
[] VHaben ;
|
||||
|
||||
-- Prepositions for complements indicate the complement case.
|
||||
|
||||
@@ -204,11 +205,13 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
ext : Str -- S-Ext dass sie kommt
|
||||
} ;
|
||||
|
||||
predV : Verb -> VP = \verb ->
|
||||
predV : Verb -> VP = predVGen False ;
|
||||
|
||||
predVGen : Bool -> Verb -> VP = \isAux, verb ->
|
||||
let
|
||||
vfin : Tense -> Agr -> Str = \t,a -> verb.s ! vFin t a ;
|
||||
vpart = verb.s ! VPastPart APred ;
|
||||
vinf = verb.s ! VInf ;
|
||||
vpart = if_then_Str isAux vinf (verb.s ! VPastPart APred) ;
|
||||
|
||||
vHaben = auxPerfect verb ;
|
||||
hat : Tense -> Agr -> Str = \t,a -> vHaben ! vFin t a ;
|
||||
@@ -217,8 +220,10 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
wird : Agr -> Str = \a -> werden_V.s ! VPresInd a.n a.p ;
|
||||
wuerde : Agr -> Str = \a -> werden_V.s ! VImpfSubj a.n a.p ;
|
||||
|
||||
auf = verb.prefix ;
|
||||
|
||||
vf : Str -> Str -> {fin,inf : Str} = \fin,inf -> {
|
||||
fin = fin ; inf = inf
|
||||
fin = fin ; inf = auf ++ inf
|
||||
} ;
|
||||
|
||||
in {
|
||||
@@ -254,14 +259,21 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
"haben" "habe" "hast" "hat" "habt" "hab"
|
||||
"hatte" "hattest" "hatten" "hattet"
|
||||
"hätte" "gehabt"
|
||||
VHaben ;
|
||||
[] VHaben ;
|
||||
|
||||
werden_V : Verb =
|
||||
mkV
|
||||
"werden" "werde" "wirst" "wird" "werdet" "werd"
|
||||
"wurde" "wurdest" "wurden" "wurdet"
|
||||
"würde" "geworden"
|
||||
VSein ;
|
||||
[] VSein ;
|
||||
|
||||
werdenPass : Verb =
|
||||
mkV
|
||||
"werden" "werde" "wirst" "wird" "werdet" "werd"
|
||||
"wurde" "wurdest" "wurden" "wurdet"
|
||||
"würde" "worden"
|
||||
[] VSein ;
|
||||
|
||||
sein_V : Verb =
|
||||
let
|
||||
@@ -269,7 +281,7 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
"sein" "bin" "bist" "ist" "seid" "sei"
|
||||
"war" "warst" "waren" "wart"
|
||||
"wäre" "gewesen"
|
||||
VSein
|
||||
[] VSein
|
||||
in
|
||||
{s = table {
|
||||
VPresInd Pl (P1 | P3) => "sind" ;
|
||||
@@ -280,10 +292,11 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
VPresPart a => (regA "seiend").s ! Posit ! a ;
|
||||
v => sein.s ! v
|
||||
} ;
|
||||
prefix = [] ;
|
||||
aux = VSein
|
||||
} ;
|
||||
|
||||
auxVV : Verb -> Verb ** {part : Str} = \v -> v ** {part = []} ;
|
||||
auxVV : Verb -> Verb ** {isAux : Bool} = \v -> v ** {isAux = True} ;
|
||||
|
||||
negation : Polarity => Str = table {
|
||||
Pos => [] ;
|
||||
@@ -300,6 +313,14 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
ext = vp.ext
|
||||
} ;
|
||||
|
||||
insertAdV : Str -> VP -> VP = \adv,vp -> {
|
||||
s = vp.s ;
|
||||
a1 = \\a => vp.a1 ! a ++ adv ;
|
||||
n2 = vp.n2 ;
|
||||
a2 = vp.a2 ;
|
||||
ext = vp.ext
|
||||
} ;
|
||||
|
||||
insertAdv : Str -> VP -> VP = \adv,vp -> {
|
||||
s = vp.s ;
|
||||
a1 = vp.a1 ;
|
||||
@@ -338,19 +359,27 @@ resource ResGer = ParamGer ** open Prelude in {
|
||||
}
|
||||
} ;
|
||||
|
||||
reflPron : Agr => Str = table {
|
||||
{n = Sg ; p = P1} => "mich" ;
|
||||
{n = Sg ; p = P2} => "dich" ;
|
||||
{n = Sg ; p = P3} => "sich" ; --
|
||||
{n = Pl ; p = P1} => "uns" ;
|
||||
{n = Pl ; p = P2} => "euch" ;
|
||||
{n = Pl ; p = P3} => "sich"
|
||||
-- The nominative case is not used as reflexive, but defined here
|
||||
-- so that we can reuse this in personal pronouns.
|
||||
-- The missing Sg "ihrer" shows that a dependence on gender would
|
||||
-- be needed.
|
||||
|
||||
reflPron : Agr => Case => Str = table {
|
||||
{n = Sg ; p = P1} => caselist "ich" "mich" "mir" "meiner" ;
|
||||
{n = Sg ; p = P2} => caselist "du" "dich" "dir" "deiner" ;
|
||||
{n = Sg ; p = P3} => caselist "er" "sich" "sich" "seiner" ; --- ihrer
|
||||
{n = Pl ; p = P1} => caselist "wir" "uns" "uns" "unser" ;
|
||||
{n = Pl ; p = P2} => caselist "ihr" "euch" "euch" "euer" ;
|
||||
{n = Pl ; p = P3} => caselist "sie" "sich" "sich" "ihrer"
|
||||
} ;
|
||||
|
||||
conjThat : Str = "daß" ;
|
||||
|
||||
conjThan : Str = "als" ;
|
||||
|
||||
-- The infinitive particle "zu" is used if and only if $vv.isAux = False$.
|
||||
|
||||
infPart : Bool -> Str = \b -> if_then_Str b [] "zu" ;
|
||||
|
||||
-- For $Numeral$.
|
||||
--
|
||||
|
||||
@@ -22,7 +22,8 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer in {
|
||||
|
||||
SlashVVV2 np vv v2 =
|
||||
mkClause (np.s ! Nom) np.a
|
||||
(insertObj (\\a => vv.part ++ v2.s ! VInf) (predV vv)) **
|
||||
(insertObj (\\a => v2.prefix ++ infPart vv.isAux ++ v2.s ! VInf)
|
||||
(predVGen vv.isAux vv)) **
|
||||
{c2 = v2.c2} ;
|
||||
|
||||
AdvSlash slash adv = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
concrete VerbGer of Verb = CatGer ** open ResGer in {
|
||||
concrete VerbGer of Verb = CatGer ** open Prelude, ResGer in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
@@ -10,16 +10,23 @@ concrete VerbGer of Verb = CatGer ** open ResGer in {
|
||||
insertObj (\\_ => appPrep v.c2 np.s ++ appPrep v.c3 np2.s) (predV v) ;
|
||||
|
||||
ComplVV v vp =
|
||||
insertObj (\\a => v.part ++ (vp.s ! a ! VPInfinit Simul).inf) (predV v) ;
|
||||
let
|
||||
compl : Agr => Str = \\a =>
|
||||
let
|
||||
vpi = vp.s ! a ! VPInfinit Simul
|
||||
in
|
||||
vp.n2 ! a ++ vp.a2 ++ vpi.fin ++ infPart v.isAux ++ vpi.inf
|
||||
in
|
||||
insertObj compl (predVGen v.isAux v) ;
|
||||
|
||||
ComplVS v s =
|
||||
insertExtrapos (conjThat ++ s.s ! Sub) (predV v) ;
|
||||
ComplVQ v q =
|
||||
insertExtrapos (q.s ! QIndir) (predV v) ;
|
||||
|
||||
-- ComplVA v ap = insertObj (ap.s) (predV v) ;
|
||||
-- ComplV2A v np ap =
|
||||
-- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
|
||||
--
|
||||
ComplVA v ap = insertObj (\\ _ => ap.s ! APred) (predV v) ;
|
||||
ComplV2A v np ap =
|
||||
insertObj (\\_ => appPrep v.c2 np.s ++ ap.s ! APred) (predV v) ;
|
||||
|
||||
UseComp comp = insertObj comp.s (predV sein_V) ;
|
||||
|
||||
@@ -28,11 +35,11 @@ concrete VerbGer of Verb = CatGer ** open ResGer in {
|
||||
CompAdv a = {s = \\_ => a.s} ;
|
||||
|
||||
AdvVP vp adv = insertAdv adv.s vp ;
|
||||
-- AdVVP adv vp = insertAdV adv.s vp ;
|
||||
--
|
||||
-- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
|
||||
--
|
||||
-- PassV2 v = {s = \\_ => v.s ! VPPart} ;
|
||||
AdVVP adv vp = insertAdV adv.s vp ;
|
||||
|
||||
ReflV2 v = insertObj (\\a => appPrep v.c2 (reflPron ! a)) (predV v) ;
|
||||
|
||||
PassV2 v = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ;
|
||||
|
||||
UseVS, UseVQ = \v -> v ** {c2 = noPreposition Acc} ;
|
||||
|
||||
|
||||
@@ -139,4 +139,52 @@ wc german/*.gfc
|
||||
1231 4116 98878 total
|
||||
|
||||
Now we have finished most of TestGer in two days, 4 + 8 hours. But we had the
|
||||
old morphology and other files, and the Scandinavian v 1.0 as help.
|
||||
old morphology and other files, and the Scandinavian v 1.0 as help.
|
||||
|
||||
--------------------
|
||||
|
||||
13/1
|
||||
|
||||
CatGer: add prefix to V*, isAux to VV - the latter mostly to deal with double infinitives
|
||||
ResGer: generalize predV to predVGen
|
||||
LexGer: experiment with gehen --> ausgehen
|
||||
> l -table PredVP (UsePron he_Pron) (ComplVV want_VV (UseV walk_V))
|
||||
--- the auxiliary is still in wrong place in subordinate double infinitives
|
||||
|
||||
ResGer: reflPron
|
||||
VerbGer: ReflV2
|
||||
AdjectiveGer: ReflA2 --- with missing person agreement
|
||||
> p -cat=Cl -mcfg "ich helfe mir"
|
||||
PredVP (UsePron i_Pron) (ComplV2 help_V2 (UsePron i_Pron))
|
||||
PredVP (UsePron i_Pron) (ReflV2 help_V2)
|
||||
> p -cat=Cl -mcfg "er hilft sich"
|
||||
PredVP (UsePron he_Pron) (ReflV2 help_V2)
|
||||
|
||||
> pm -printer=missing
|
||||
AdVVP AdvSC OrdInt UttVP
|
||||
A round of filling these completes the implementation of TestGer.
|
||||
ResGer: insertAdV
|
||||
> p -cat=Cl -mcfg "er hilft immer seinem Hund"
|
||||
PredVP (UsePron he_Pron) (AdVVP always_AdV (ComplV2 help_V2
|
||||
(DetCN (DetSg (PossSg he_Pron) NoOrd) (UseN dog_N))))
|
||||
wc german/*.gfc
|
||||
63 203 4768 german/AdjectiveGer.gfc
|
||||
63 198 1649 german/AdverbGer.gfc
|
||||
55 184 7490 german/CatGer.gfc
|
||||
76 260 4489 german/ConjunctionGer.gfc
|
||||
94 315 13968 german/LexGer.gfc
|
||||
121 445 2736 german/MorphoGer.gfc
|
||||
86 306 6637 german/NounGer.gfc
|
||||
41 160 1419 german/ParamGer.gfc
|
||||
81 245 2256 german/PhraseGer.gfc
|
||||
63 219 3333 german/QuestionGer.gfc
|
||||
63 219 3800 german/RelativeGer.gfc
|
||||
87 343 2081 german/ResGer.gfc
|
||||
112 393 20890 german/SentenceGer.gfc
|
||||
230 696 4752 german/TestGer.gfc
|
||||
61 185 1483 german/UntensedGer.gfc
|
||||
110 366 41629 german/VerbGer.gfc
|
||||
1406 4737 123380 total
|
||||
|
||||
Ca. 4h more work was needed, so we have spent 16h now.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user