mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
German sentence formation; development log
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
concrete CatEng of Cat = open ResEng, Prelude, (R = ParamX) in {
|
concrete CatEng of Cat = open ResEng, Prelude in {
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Text, Phr, Utt = {s : Str} ;
|
Text, Phr, Utt = {s : Str} ;
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
concrete CatGer of Cat = open ResGer, Prelude, (R = ParamX) in {
|
concrete CatGer of Cat = open ResGer, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
-- Text, Phr, Utt = {s : Str} ;
|
-- Text, Phr, Utt = {s : Str} ;
|
||||||
--
|
--
|
||||||
-- Imp = {s : Polarity => Number => Str} ;
|
-- Imp = {s : Polarity => Number => Str} ;
|
||||||
--
|
|
||||||
-- S = {s : Str} ;
|
S = {s : Order => Str} ;
|
||||||
-- QS = {s : QForm => Str} ;
|
-- QS = {s : QForm => Str} ;
|
||||||
-- RS = {s : Agr => Str} ;
|
-- RS = {s : Agr => Str} ;
|
||||||
|
|
||||||
@@ -16,12 +18,12 @@ concrete CatGer of Cat = open ResGer, Prelude, (R = ParamX) in {
|
|||||||
-- RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ;
|
-- RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ;
|
||||||
|
|
||||||
VP = ResGer.VP ;
|
VP = ResGer.VP ;
|
||||||
V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ;
|
V, VS, VQ, VA = ResGer.Verb ; -- = {s : VForm => Str} ;
|
||||||
V2, VV, V2A = Verb ** {c2 : Preposition} ;
|
V2, VV, V2A = Verb ** {c2 : Preposition} ;
|
||||||
V3 = Verb ** {c2, c3 : Preposition} ;
|
V3 = Verb ** {c2, c3 : Preposition} ;
|
||||||
|
|
||||||
AP = {s : AForm => Str ; isPre : Bool} ;
|
AP = {s : AForm => Str ; isPre : Bool} ;
|
||||||
Comp = {s : Str} ;
|
Comp = {s : Agr => Str} ;
|
||||||
--
|
--
|
||||||
-- SC = {s : Str} ;
|
-- SC = {s : Str} ;
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
concrete LexGer of Lex = CatGer ** open ResGer, Prelude in {
|
concrete LexGer of Lex = CatGer ** open ResGer, Prelude in {
|
||||||
|
|
||||||
|
flags optimize = values ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
walk_V = mkV "gehen" "geht" "geh" "ging" "ginge" "gegangen" VSein ;
|
walk_V = mkV "gehen" "geht" "geh" "ging" "ginge" "gegangen" VSein ;
|
||||||
help_V2 = mkV "helfen" "hilft" "hilf" "half" "hälfe" "geholfen" VHaben **
|
help_V2 = mkV "helfen" "hilft" "hilf" "half" "hälfe" "geholfen" VHaben **
|
||||||
|
|||||||
@@ -97,10 +97,7 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
let
|
let
|
||||||
ifSibilant : Str -> Str -> Str -> Str = \u,b1,b2 ->
|
ifSibilant : Str -> Str -> Str -> Str = \u,b1,b2 ->
|
||||||
case u of {
|
case u of {
|
||||||
"s" => b1 ;
|
"s" | "x" | "z" | "ß" => b1 ;
|
||||||
"x" => b1 ;
|
|
||||||
"z" => b1 ;
|
|
||||||
"Ã" => b1 ;
|
|
||||||
_ => b2
|
_ => b2
|
||||||
} ;
|
} ;
|
||||||
en = Predef.dp 2 geben ;
|
en = Predef.dp 2 geben ;
|
||||||
@@ -171,6 +168,11 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
|
|
||||||
Preposition : Type = {s : Str ; c : Case} ;
|
Preposition : Type = {s : Str ; c : Case} ;
|
||||||
|
|
||||||
|
-- To apply a preposition to a complement.
|
||||||
|
|
||||||
|
appPrep : Preposition -> (Case => Str) -> Str = \prep,arg ->
|
||||||
|
prep.s ++ arg ! prep.c ;
|
||||||
|
|
||||||
-- Pronouns and articles
|
-- Pronouns and articles
|
||||||
-- Here we define personal and relative pronouns.
|
-- Here we define personal and relative pronouns.
|
||||||
-- All personal pronouns, except "ihr", conform to the simple
|
-- All personal pronouns, except "ihr", conform to the simple
|
||||||
@@ -368,6 +370,23 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
Neg => "nicht"
|
Neg => "nicht"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- Extending a verb phrase with new constituents.
|
||||||
|
|
||||||
|
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||||
|
s = vp.s ;
|
||||||
|
a1 = vp.a1 ;
|
||||||
|
n2 = \\a => vp.n2 ! a ++ obj ! a ;
|
||||||
|
a2 = vp.a2 ;
|
||||||
|
ext = vp.ext
|
||||||
|
} ;
|
||||||
|
|
||||||
|
insertAdv : Str -> VP -> VP = \adv,vp -> {
|
||||||
|
s = vp.s ;
|
||||||
|
a1 = vp.a1 ;
|
||||||
|
n2 = vp.n2 ;
|
||||||
|
a2 = vp.a2 ++ adv ;
|
||||||
|
ext = vp.ext
|
||||||
|
} ;
|
||||||
|
|
||||||
-- For $Sentence$.
|
-- For $Sentence$.
|
||||||
|
|
||||||
@@ -380,12 +399,13 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
let
|
let
|
||||||
verb = vp.s ! agr ! VPFinite t a ;
|
verb = vp.s ! agr ! VPFinite t a ;
|
||||||
neg = vp.a1 ! b ;
|
neg = vp.a1 ! b ;
|
||||||
compl = vp.n2 ! agr ++ vp.a2 ++ vp.ext
|
obj = vp.n2 ! agr ++ vp.a2 ++ vp.ext ;
|
||||||
|
compl = neg ++ obj ++ verb.inf ;
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
Main => subj ++ verb.fin ++ neg ++ verb.inf ++ compl ;
|
Main => subj ++ verb.fin ++ compl ;
|
||||||
Inv => verb.fin ++ subj ++ neg ++ verb.inf ++ compl ;
|
Inv => verb.fin ++ subj ++ compl ;
|
||||||
Sub => subj ++ neg ++ compl ++ verb.inf ++ verb.fin
|
Sub => subj ++ compl ++ verb.fin
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
concrete UntensedGer of Untensed = CatGer ** open ResGer in {
|
concrete UntensedGer of Untensed = CatGer ** open ResGer in {
|
||||||
--
|
|
||||||
-- flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
--
|
|
||||||
-- lin
|
lin
|
||||||
-- PosCl cl = {s = cl.s ! Pres ! Simul ! Pos ! ODir} ;
|
PosCl cl = {s = cl.s ! Pres ! Simul ! Pos} ;
|
||||||
-- NegCl cl = {s = cl.s ! Pres ! Simul ! Neg ! ODir} ;
|
NegCl cl = {s = cl.s ! Pres ! Simul ! Neg} ;
|
||||||
--
|
|
||||||
-- PosQCl cl = {s = cl.s ! Pres ! Simul ! Pos} ;
|
-- PosQCl cl = {s = cl.s ! Pres ! Simul ! Pos} ;
|
||||||
-- NegQCl cl = {s = cl.s ! Pres ! Simul ! Neg} ;
|
-- NegQCl cl = {s = cl.s ! Pres ! Simul ! Neg} ;
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ concrete VerbGer of Verb = CatGer ** open ResGer in {
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
UseV = predV ;
|
UseV = predV ;
|
||||||
|
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) ;
|
||||||
|
|
||||||
-- ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ;
|
|
||||||
-- ComplV3 v np np2 =
|
|
||||||
-- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ;
|
|
||||||
--
|
|
||||||
-- ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ;
|
-- ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ;
|
||||||
-- ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
|
-- ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
|
||||||
-- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
|
-- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
|
||||||
@@ -17,8 +17,13 @@ concrete VerbGer of Verb = CatGer ** open ResGer in {
|
|||||||
-- ComplV2A v np ap =
|
-- ComplV2A v np ap =
|
||||||
-- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
|
-- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
|
||||||
--
|
--
|
||||||
-- UseComp comp = insertObj comp.s (predAux auxBe) ;
|
|
||||||
--
|
UseComp comp = insertObj comp.s (predV sein_V) ;
|
||||||
|
|
||||||
|
CompAP ap = {s = \\_ => ap.s ! APred} ;
|
||||||
|
CompNP np = {s = \\_ => np.s ! Nom} ;
|
||||||
|
CompAdv a = {s = \\_ => a.s} ;
|
||||||
|
|
||||||
-- AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
-- AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||||
------ AdVVP adv vp = insertAdV adv.s vp ;
|
------ AdVVP adv vp = insertAdV adv.s vp ;
|
||||||
--
|
--
|
||||||
@@ -27,11 +32,7 @@ concrete VerbGer of Verb = CatGer ** open ResGer in {
|
|||||||
-- PassV2 v = {s = \\_ => v.s ! VPPart} ;
|
-- PassV2 v = {s = \\_ => v.s ! VPPart} ;
|
||||||
--
|
--
|
||||||
-- UseVV, UseVS, UseVQ = \vv -> {s = vv.s ; c2 = []} ; -- no "to"
|
-- UseVV, UseVS, UseVQ = \vv -> {s = vv.s ; c2 = []} ; -- no "to"
|
||||||
--
|
|
||||||
-- CompAP ap = ap ;
|
|
||||||
-- CompNP np = {s = \\_ => np.s ! Acc} ;
|
|
||||||
-- CompAdv a = {s = \\_ => a.s} ;
|
|
||||||
--
|
|
||||||
-- EmbedS s = {s = conjThat ++ s.s} ;
|
-- EmbedS s = {s = conjThat ++ s.s} ;
|
||||||
-- EmbedQS qs = {s = qs.s ! QIndir} ;
|
-- EmbedQS qs = {s = qs.s ! QIndir} ;
|
||||||
-- EmbedVP vp = {s = infVP vp (agrP3 Sg)} ; --- agr
|
-- EmbedVP vp = {s = infVP vp (agrP3 Sg)} ; --- agr
|
||||||
|
|||||||
66
lib/resource-1.0/german/log.txt
Normal file
66
lib/resource-1.0/german/log.txt
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
Steps of building the German implementation.
|
||||||
|
|
||||||
|
4/1/2006
|
||||||
|
|
||||||
|
ParamGer: Case, Gender, Adjf
|
||||||
|
CatGer: N, CN
|
||||||
|
ResGer: mkNoun, mkN2, mkN4
|
||||||
|
> cc mkN2 "Stube" "Stuben" Fem
|
||||||
|
|
||||||
|
ResGer: mkA, mkV, regA, regV
|
||||||
|
> cc regV "machen"
|
||||||
|
|
||||||
|
CatGer: V*, A*
|
||||||
|
LexGer: N*, A*, V*
|
||||||
|
> l -table walk_V
|
||||||
|
|
||||||
|
NounGer: determiner rules, UseN
|
||||||
|
ParamGer: gennum, adjAgr
|
||||||
|
ResGer: pronForms
|
||||||
|
> p -cat=NP "der Hund" | l -table
|
||||||
|
|
||||||
|
|
||||||
|
5/1
|
||||||
|
|
||||||
|
LexGer: Pron, Det
|
||||||
|
> p "mein Hund"
|
||||||
|
|
||||||
|
AdjectiveGer: PositA, ComparA, AdAP
|
||||||
|
> p -cat=NP "ein warmer Hund" | l -table
|
||||||
|
> p -cat=NP -lexer=literals "alle meine 3 sehr warmen Hünde"
|
||||||
|
|
||||||
|
ResGer: predV, mkClause, aux verbs
|
||||||
|
VerbGer: UseV
|
||||||
|
SentenceGer: PredVP
|
||||||
|
> l -table PredVP (UsePron i_Pron) (UseV walk_V)
|
||||||
|
("ich nicht gegangen hatte" etc)
|
||||||
|
|
||||||
|
ParamGer: VAux
|
||||||
|
ResGer: added aux : VAux to Verb and mkV
|
||||||
|
LexGer: mkV updates
|
||||||
|
> l -table PredVP (UsePron i_Pron) (UseV walk_V)
|
||||||
|
("ich nicht gegangen war" etc, now correct)
|
||||||
|
|
||||||
|
|
||||||
|
ResGer: appPrep, insertObj, insertAdv
|
||||||
|
VerbGer: ComplV2, ComplV3
|
||||||
|
SentenceGer: PosCl, NegCl
|
||||||
|
> p -cat=S -mcfg "ich zeige ihn meinem warmen Hund"
|
||||||
|
|
||||||
|
wc *.gfc
|
||||||
|
122385 total
|
||||||
|
70667 CatGer.gfc (largest)
|
||||||
|
add flags optimize=all_subs to this module:
|
||||||
|
5781 CatGer.gfc
|
||||||
|
57499 total
|
||||||
|
|
||||||
|
VerbGer: UseComp, Comp*
|
||||||
|
> p -cat=Cl -mcfg "ich bin ein Hund" | l -table
|
||||||
|
|
||||||
|
|
||||||
|
vg
|
||||||
|
(see complex figure)
|
||||||
|
i english/TestEng.gf
|
||||||
|
vg
|
||||||
|
(see complex symmetric figure)
|
||||||
|
|
||||||
Reference in New Issue
Block a user