German imperatives and other phrases

This commit is contained in:
aarne
2006-01-05 17:24:48 +00:00
parent 9b7ce588b2
commit cdecf37355
8 changed files with 113 additions and 113 deletions

View File

@@ -1,5 +1,7 @@
concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
flags optimize=all_subs ;
lin lin
PositA a = { PositA a = {
@@ -8,35 +10,35 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
} ; } ;
ComparA a np = { ComparA a np = {
s = \\af => a.s ! Compar ! af ++ "als" ++ np.s ! Nom ; s = \\af => a.s ! Compar ! af ++ "als" ++ np.s ! Nom ;
isPre = False isPre = True
} ;
-- $SuperlA$ belongs to determiner syntax in $Noun$.
ComplA2 a np = {
s = \\af => a.s ! Posit ! af ++ appPrep a.c2 np.s ;
isPre = True
} ; } ;
---- $SuperlA$ belongs to determiner syntax in $Noun$.
--
-- ComplA2 a np = {
-- s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ;
-- isPre = False
-- } ;
--
-- ReflA2 a = { -- ReflA2 a = {
-- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ; -- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ;
-- isPre = False -- isPre = False
-- } ; -- } ;
--
-- SentAP ap s = { SentAP ap s = {
-- s = \\a => ap.s ! a ++ conjThat ++ s.s ; s = \\a => ap.s ! a ++ conjThat ++ s.s ! Sub ;
-- isPre = False isPre = False
-- } ; } ;
-- QuestAP ap qs = { QuestAP ap qs = {
-- s = \\a => ap.s ! a ++ qs.s ! QIndir ; s = \\a => ap.s ! a ++ qs.s ! QIndir ;
-- isPre = False isPre = False
-- } ; } ;
AdAP ada ap = { AdAP ada ap = {
s = \\a => ada.s ++ ap.s ! a ; s = \\a => ada.s ++ ap.s ! a ;
isPre = ap.isPre isPre = ap.isPre
} ; } ;
--
-- UseA2 a = a ; UseA2 a = a ;
--
} }

View File

@@ -1,21 +1,22 @@
concrete AdverbGer of Adverb = CatGer ** open ResGer, Prelude in { concrete AdverbGer of Adverb = CatGer ** open ResGer, Prelude in {
--
-- lin lin
-- PositAdvAdj a = {s = a.s ! AAdv} ; PositAdvAdj a = {s = a.s ! Posit ! APred} ;
-- ComparAdvAdj cadv a np = {
-- s = cadv.s ++ a.s ! AAdv ++ "than" ++ np.s ! Nom ComparAdvAdj cadv a np = {
-- } ; s = cadv.s ++ a.s ! Posit ! APred ++ conjThan ++ np.s ! Nom
-- ComparAdvAdjS cadv a s = { } ;
-- s = cadv.s ++ a.s ! AAdv ++ "than" ++ s.s ComparAdvAdjS cadv a s = {
-- } ; s = cadv.s ++ a.s ! Posit ! APred ++ conjThan ++ s.s ! Sub
-- } ;
-- PrepNP prep np = {s = prep.s ++ np.s ! Acc} ;
-- PrepNP prep np = {s = appPrep prep np.s} ;
-- AdAdv = cc2 ;
-- AdAdv = cc2 ;
-- SubjS = cc2 ;
SubjS subj s = {s = subj.s ++ s.s ! Sub} ;
-- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing -- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing
--
-- AdnCAdv cadv = {s = cadv.s ++ "than"} ; AdnCAdv cadv = {s = cadv.s ++ conjThan} ;
--
} }

View File

@@ -3,19 +3,19 @@ concrete CatGer of Cat = open ResGer, Prelude in {
flags optimize=all_subs ; 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 : Order => Str} ; S = {s : Order => Str} ;
-- QS = {s : QForm => Str} ; QS = {s : QForm => Str} ;
-- RS = {s : Agr => Str} ; -- RS = {s : Agr => Str} ;
Cl = {s : Tense => Anteriority => Polarity => Order => Str} ; Cl = {s : Tense => Anteriority => Polarity => Order => Str} ;
-- Slash = {s : Tense => Anteriority => Polarity => Order => Str} ** {c2 : Str} ; -- Slash = {s : Tense => Anteriority => Polarity => Order => Str} ** {c2 : Str} ;
-- --
-- QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ; QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
-- RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ; RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ;
VP = ResGer.VP ; VP = ResGer.VP ;
V, VS, VQ, VA = ResGer.Verb ; -- = {s : VForm => Str} ; V, VS, VQ, VA = ResGer.Verb ; -- = {s : VForm => Str} ;
@@ -25,9 +25,9 @@ concrete CatGer of Cat = open ResGer, Prelude in {
AP = {s : AForm => Str ; isPre : Bool} ; AP = {s : AForm => Str ; isPre : Bool} ;
Comp = {s : Agr => Str} ; Comp = {s : Agr => Str} ;
--
-- SC = {s : Str} ; SC = {s : Str} ;
--
A = {s : Degree => AForm => Str} ; A = {s : Degree => AForm => Str} ;
A2 = {s : Degree => AForm => Str ; c2 : Preposition} ; A2 = {s : Degree => AForm => Str ; c2 : Preposition} ;
@@ -47,16 +47,16 @@ concrete CatGer of Cat = open ResGer, Prelude in {
N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Preposition} ; N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Preposition} ;
N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Preposition} ; N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Preposition} ;
-- IP = {s : Case => Str ; n : Number} ; IP = {s : Case => Str ; n : Number} ;
-- IDet = {s : Str ; n : Number} ; IDet = {s : Gender => Case => Str ; n : Number} ;
-- IAdv = {s : Str} ; IAdv = {s : Str} ;
--
-- RP = {s : Case => Str ; a : RAgr} ; -- RP = {s : 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} ;
-- --

View File

@@ -1,23 +1,25 @@
concrete PhraseGer of Phrase = CatGer, TenseX ** open ResGer in { concrete PhraseGer of Phrase = CatGer, TenseX ** open ResGer in {
--
-- lin flags optimize=all_subs ;
-- PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
-- lin
-- UttS s = s ; PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
-- UttQS qs = {s = qs.s ! QDir} ;
-- UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ; UttS s = {s = s.s ! Main} ;
-- UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; UttQS qs = {s = qs.s ! QDir} ;
-- UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ;
-- UttIP ip = {s = ip.s ! Nom} ; --- Acc also UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
-- UttIAdv iadv = iadv ;
-- UttNP np = {s = np.s ! Acc} ; UttIP ip = {s = ip.s ! Nom} ; --- Acc also
-- UttVP vp = {s = "to" ++ infVP vp (agrP3 Sg)} ; UttIAdv iadv = iadv ;
-- UttAdv adv = adv ; UttNP np = {s = np.s ! Acc} ;
-- ---- UttVP vp = {s = infMark ++ infVP vp (agrP3 Sg)} ;
-- NoPConj = {s = []} ; UttAdv adv = adv ;
-- PConjConj conj = conj ;
-- NoPConj = {s = []} ;
-- NoVoc = {s = []} ; PConjConj conj = conj ;
-- VocNP np = {s = "," ++ np.s ! Nom} ;
-- NoVoc = {s = []} ;
VocNP np = {s = "," ++ np.s ! Nom} ;
} }

View File

@@ -173,6 +173,11 @@ resource ResGer = ParamGer ** open Prelude in {
appPrep : Preposition -> (Case => Str) -> Str = \prep,arg -> appPrep : Preposition -> (Case => Str) -> Str = \prep,arg ->
prep.s ++ arg ! prep.c ; prep.s ++ arg ! prep.c ;
-- To build a preposition from just a case.
noPreposition : Case -> Preposition = \c ->
{s = [] ; c = 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
@@ -410,23 +415,6 @@ resource ResGer = ParamGer ** open Prelude in {
ext = vp.ext ++ ext ext = vp.ext ++ ext
} ; } ;
s = \\a => table {
VPFinite t Anter => case t of {
Pres | Past => vf (hat t a) vpart ;
Fut => vf (wird a) (vpart ++ haben) ;
Cond => vf (wuerde a) (vpart ++ haben)
} ;
VPImperat => vf (verb.s ! VImper a.n) [] ;
VPInfinit Simul => vf [] vinf ;
VPInfinit Anter => vf [] (vpart ++ haben)
} ;
a1 : Polarity => Str = negation ;
n2 : Agr => Str = \\_ => [] ;
a2 : Str = [] ;
ext : Str = []
} ;
-- For $Sentence$. -- For $Sentence$.
@@ -452,6 +440,8 @@ resource ResGer = ParamGer ** open Prelude in {
conjThat : Str = "daß" ; conjThat : Str = "daß" ;
conjThan : Str = "als" ;
reflPron : Agr => Str = table { reflPron : Agr => Str = table {
{n = Sg ; p = P1} => "mich" ; {n = Sg ; p = P1} => "mich" ;
{n = Sg ; p = P2} => "dich" ; {n = Sg ; p = P2} => "dich" ;

View File

@@ -6,21 +6,17 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer in {
PredVP np vp = mkClause (np.s ! Nom) np.a vp ; PredVP np vp = mkClause (np.s ! Nom) np.a vp ;
-- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
--
-- ImpVP vp = { ImpVP vp = {
-- s = \\pol,n => s = \\pol,n =>
-- let let
-- agr = {n = n ; p = P2} ; agr = {n = n ; p = P2} ;
-- verb = infVP vp agr ; verb = vp.s ! agr ! VPImperat ;
-- dont = case pol of { in
-- Neg => "don't" ; verb.fin ++ vp.a1 ! pol ++ verb.inf ++ vp.n2 ! agr ++ vp.a2 ++ vp.ext
-- _ => [] } ;
-- }
-- in
-- dont ++ verb
-- } ;
--
-- SlashV2 np v2 = -- SlashV2 np v2 =
-- mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ; -- mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ;
-- --

View File

@@ -27,14 +27,14 @@ concrete VerbGer of Verb = CatGer ** open ResGer in {
CompNP np = {s = \\_ => np.s ! Nom} ; CompNP np = {s = \\_ => np.s ! Nom} ;
CompAdv a = {s = \\_ => a.s} ; CompAdv a = {s = \\_ => a.s} ;
-- AdvVP vp adv = insertObj (\\_ => adv.s) vp ; AdvVP vp adv = insertAdv adv.s vp ;
------ AdVVP adv vp = insertAdV adv.s vp ; -- AdVVP adv vp = insertAdV adv.s vp ;
-- --
-- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ; -- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
-- --
-- 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 = \v -> v ** {c2 = noPreposition Acc} ;
-- EmbedS s = {s = conjThat ++ s.s} ; -- EmbedS s = {s = conjThat ++ s.s} ;
-- EmbedQS qs = {s = qs.s ! QIndir} ; -- EmbedQS qs = {s = qs.s ! QIndir} ;

View File

@@ -27,7 +27,7 @@ LexGer: Pron, Det
AdjectiveGer: PositA, ComparA, AdAP AdjectiveGer: PositA, ComparA, AdAP
> p -cat=NP "ein warmer Hund" | l -table > p -cat=NP "ein warmer Hund" | l -table
> p -cat=NP -lexer=literals "alle meine 3 sehr warmen Hünde" > p -cat=NP -lexer=literals "alle meine 3 sehr warmen Hünde"
ResGer: predV, mkClause, aux verbs ResGer: predV, mkClause, aux verbs
VerbGer: UseV VerbGer: UseV
@@ -65,7 +65,7 @@ VerbGer: UseComp, Comp*
ResGer: wollen_V, auxVV, insertExtrapos ResGer: wollen_V, auxVV, insertExtrapos
VerbGer: ComplVS VerbGer: ComplVS
> p -cat=Cl -mcfg "ich behaupte daß wir gehen" | l -table > p -cat=Cl -mcfg "ich behaupte daß wir gehen" | l -table
(gets OK with proper extrapos) (gets OK with proper extrapos)
VerbGer: ComplVV VerbGer: ComplVV
= insertObj (\\a => v.part ++ (vp.s ! a ! VPInfinit Simul).inf) (predV v) ; = insertObj (\\a => v.part ++ (vp.s ! a ! VPInfinit Simul).inf) (predV v) ;
@@ -74,3 +74,12 @@ VerbGer: ComplVV
Pres Anter Pos Inv : habe ich gehen gewollen Pres Anter Pos Inv : habe ich gehen gewollen
Pres Anter Pos Sub : ich gehen gewollen habe Pres Anter Pos Sub : ich gehen gewollen habe
(Thus "double infinitives" don't get right.) (Thus "double infinitives" don't get right.)
Added routine stuff to AdverbGer and AdjectiveGer. Noticed failure with
comparison ("schneller als ein Zug" pro "mehr schnell als ein Zug")
SentenceGer: ImpVP
PhraseGer: almost all (actually copied from PhraseScand)
> p -cat=Imp -mcfg "geh hier"
ImpVP (AdvVP (UseV walk_V) here_Adv)