forked from GitHub/gf-rgl
1cad178ec8
NP.s : Bool => Case => Str and NP.w = WDefArt
np.s ! False : Case => Str is the ordinary paradigm; if the np has a
definite article, np.w = WDefArt, and np.s ! True : Case => Str is the
paradigm with definite article omitted, if np.a = Ag g Sg p.
Prepositions now have type
Prep = {s : GenNum => Str ; s2 :Str ; c : Case ; isPrep : PrepType},
and |Prep| = |Case|*|isPrep| = 4 * 3 = 12, independent of |PCase| >= 18.
A preposition p with p.isPrep = isPrepDefArt has in p.s ! (GSg g) : Str
the preposition glued with definite article of a following np in singular.
The modified linearization categories for Prep, NP, Det, DAP, Quant,
Predet are no longer Prep', NP' etc., but Prep, NP etc. in CatGer.
They are now also used in gf-rgl/tests/german/TestLangGer.gf.
The previous auxiliary files abstract/Adjective'.gf etc. are removed.
BUT: for complexitiy reasons,
- the glueing is omitted in SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash,
- SlashVP : NP -> SlashVP -> ClSlash (in SentenceGer and TestLanGer)
are commented out.
SlashVP causes grammar compilation to crash due to memory limits, probably
because mkClause and its modification mkClSlash are too detailed.
145 lines
4.6 KiB
Plaintext
145 lines
4.6 KiB
Plaintext
--# -path=.:../abstract:../common:../prelude
|
|
concrete CatGer of Cat =
|
|
CommonX - [Tense,Temp] **
|
|
open ResGer, Prelude in {
|
|
|
|
flags optimize=all_subs ;
|
|
|
|
lincat
|
|
|
|
-- Tensed/Untensed
|
|
|
|
S = {s : Order => Str} ;
|
|
QS = {s : QForm => Str} ;
|
|
RS = {s : RelGenNum => Str ; c : Case} ;
|
|
SSlash = {s : Order => Str} ** {c2 : Preposition} ;
|
|
|
|
-- Sentence
|
|
|
|
Cl = {s : Mood => ResGer.Tense => Anteriority => Polarity => Order => Str} ;
|
|
ClSlash = {
|
|
s : Mood => ResGer.Tense => Anteriority => Polarity => Order => Str ;
|
|
c2 : Preposition
|
|
} ;
|
|
Imp = {s : Polarity => ImpForm => Str} ;
|
|
|
|
-- Question
|
|
|
|
QCl = {s : Mood => ResGer.Tense => Anteriority => Polarity => QForm => Str} ;
|
|
IP = {s : Case => Str ; n : Number} ;
|
|
IComp = {s : Agr => Str ; ext : Str} ;
|
|
IDet = {s : Gender => Case => Str ; n : Number} ;
|
|
IQuant = {s : Number => Gender => Case => Str} ;
|
|
|
|
-- Relative
|
|
|
|
RCl = {s : Mood => ResGer.Tense => Anteriority => Polarity => RelGenNum => Str ; c : Case} ;
|
|
RP = {s : RelGenNum => Case => Str ; a : RAgr} ;
|
|
|
|
-- Verb
|
|
|
|
VP = ResGer.VP ;
|
|
VPSlash = ResGer.VPSlash ;
|
|
Comp = {s : Agr => Str ; ext : Str} ;
|
|
|
|
-- Adjective
|
|
|
|
AP = {s : AForm => Str ; isPre : Bool ; c: Str * Str ; ext : Str} ;
|
|
-- ich bin [c1 ihm] treu
|
|
-- du bist so klug gewesen [ext ihn zu lesen]
|
|
-- ich bin stolz [c2 auf dich]
|
|
|
|
-- Noun
|
|
|
|
CN = {
|
|
s : Adjf => Number => Case => Str ;
|
|
rc : Number => Str ; -- Frage , [rc die ich gestellt habe]
|
|
ext : Str ; -- Frage , [sc wo sie schläft]
|
|
adv : Str ; -- Haus [adv auf dem Hügel]
|
|
g : Gender
|
|
} ;
|
|
Pron = {s : NPForm => Str ; a : Agr} ;
|
|
|
|
-- simplified PCase to Case in NP, Det, DAP, Quant, Predet HL 8/22
|
|
NP = ResGer.NP ;
|
|
Det = {s,sp : Bool => Gender => Case => Str ; -- True if DefArt is dropped HL 8/22
|
|
n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ;
|
|
DAP = {s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ;
|
|
|
|
-- HL 7/2022: first Bool = True if used to glue in Sg with preposition
|
|
-- second Bool is True if a cardinal number is present
|
|
Quant = {
|
|
s, sp : Bool => Bool => Number => Gender => Case => Str ;
|
|
a : Adjf ;
|
|
aPl : Adjf ; --- to distinguish "meine guten Freunde" / "gute Freunde"
|
|
hasDefArt : Bool
|
|
} ;
|
|
Predet = {
|
|
s : Number => Gender => Case => Str ;
|
|
c : {p : Str ; k : PredetCase'} ;
|
|
a : PredetAgr -- if an agr is forced, e.g. jeder von uns ist ...
|
|
} ;
|
|
|
|
Num = {s : Gender => Case => Str ; n : Number ; isNum : Bool} ;
|
|
Card = {s : Gender => Case => Str ; n : Number} ;
|
|
Ord = {s : AForm => Str} ;
|
|
|
|
-- Numeral
|
|
|
|
Numeral = {s : CardOrd => Str ; n : Number } ;
|
|
Digits = {s : CardOrd => Str ; n : Number } ;
|
|
|
|
-- Structural
|
|
|
|
Conj = {s1,s2 : Str ; n : Number} ;
|
|
Subj = {s : Str} ;
|
|
Prep = Preposition ;
|
|
|
|
-- Open lexical classes, e.g. Lexicon
|
|
|
|
V, VA, VS, VQ = ResGer.Verb ; -- = {s : VForm => Str} ;
|
|
VV = Verb ** {isAux : Bool} ;
|
|
V2, V2A, V2S, V2Q = Verb ** {c2 : Preposition} ;
|
|
V2V = Verb ** {c2 : Preposition ; isAux : Bool ; objCtrl : Bool} ;
|
|
V3 = Verb ** {c2, c3 : Preposition} ;
|
|
|
|
A = {s : Degree => AForm => Str} ;
|
|
A2 = {s : Degree => AForm => Str ; c2 : Preposition} ;
|
|
|
|
N = ResGer.Noun ;
|
|
N2 = ResGer.Noun ** {c2 : Preposition} ;
|
|
N3 = ResGer.Noun ** {c2,c3 : Preposition} ;
|
|
PN = {s : Case => Str; g : Gender} ;
|
|
|
|
-- tense with possibility to choose conjunctive forms
|
|
|
|
Temp = {s : Str ; t : ResGer.Tense ; a : Anteriority ; m : Mood} ;
|
|
Tense = {s : Str ; t : ResGer.Tense ; m : Mood} ;
|
|
|
|
linref
|
|
NP = \np -> np.s ! False ! Nom ++ np.ext ++ np.rc ; -- HL 7/2022 Bool added
|
|
CN = \cn -> cn.s ! Strong ! Pl ! Nom ++ cn.adv ++ cn.ext ++ cn.rc ! Pl ;
|
|
|
|
SSlash = \ss -> ss.s ! Main ++ ss.c2.s ! GPl ;
|
|
ClSlash = \cls -> cls.s ! MIndic ! Pres ! Simul ! Pos ! Main ++ cls.c2.s ! GPl ;
|
|
|
|
VP = \vp -> useInfVP False vp ;
|
|
VPSlash = \vps -> useInfVP False vps ++ vps.c2.s ! GPl ++ vps.ext;
|
|
|
|
AP = \ap -> ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.ext ;
|
|
A2 = \a2 -> a2.s ! Posit ! APred ++ a2.c2.s ! GPl ;
|
|
|
|
V, VS, VQ, VA = \v -> useInfVP False (predV v) ;
|
|
V2, V2A, V2Q, V2S = \v -> useInfVP False (predV v) ++ v.c2.s ! GPl ;
|
|
V3 = \v -> useInfVP False (predV v) ++ v.c2.s ! GPl ++ v.c3.s ! GPl;
|
|
|
|
VV = \v -> useInfVP v.isAux (predVGen v.isAux v) ;
|
|
V2V = \v -> useInfVP v.isAux (predVGen v.isAux v) ++ v.c2.s ! GPl ;
|
|
|
|
Conj = \c -> c.s1 ++ c.s2 ;
|
|
|
|
Det = \det -> det.s ! False ! Masc ! Nom ;
|
|
Prep = \prep -> case prep.isPrep of {isPrepDefArt => prep.s ! GSg Masc ;
|
|
_ => prep.s ! GPl } ;
|
|
}
|