mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-17 23:30:14 -06:00
are edited to allow for glued Prep+DefArt, using new categories NP',Det',Quant',
Predet',DAP'.
The previous NP.s : Case => Str*Str allows parsing
"in dem Meer" = in_Prep ++ (np.s ! Case).p1
"im Meer" = in_Prep ++ (np.s ! Case).p2,
but since only one of the strings of (np.s!Case) is used, the tree
contains a metavariable like ?2 (the grammar is "erasing"). (Similarly, if we used
NP.s : Case => Str and NP.s2 : Case => Str.)
To get rid of the metavariables, we have to choose BY A PARAMETER, say
NP.s : droppedDefArt? => Case => Str
Using np.a = Ag g n p, the preposition can select between preposition
alone or preposition with definite article (glued or not), via
Prep = {s : GenNum => Str ; s2 :Str ; c : Case ; isPrep : PrepType }
The combination is done in appPrepNP' and appPrep'. This is
independent of the number of glued Prep+DefArt. But LangGer compiles
now in 200s using 30% memory (without SlashV2VNP). Can AppPrepNP' (and
insertObjNP') be simplified?
32 lines
1.0 KiB
Plaintext
32 lines
1.0 KiB
Plaintext
--# -path=.:../abstract:../common:prelude -- HL
|
|
concrete PhraseGer of Phrase' = CatGer ** open Prelude, ResGer in {
|
|
|
|
flags optimize=all_subs ;
|
|
|
|
lin
|
|
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
|
|
|
UttS s = {s = s.s ! Main} ;
|
|
UttQS qs = {s = qs.s ! QDir} ;
|
|
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False} ;
|
|
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ;
|
|
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ;
|
|
|
|
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
|
UttIAdv iadv = iadv ;
|
|
UttNP np = {s = np.s ! False ! Nom ++ bigNP' np} ;
|
|
UttVP vp = {s = useInfVP True vp} ; -- without zu
|
|
UttAdv adv = adv ;
|
|
UttCN n = {s = n.s ! Strong ! Sg ! Nom ++ n.adv ++ n.ext ++ n.rc ! Sg} ;
|
|
UttCard n = {s = n.s ! Neutr ! Nom} ;
|
|
UttAP ap = {s = ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.ext} ;
|
|
UttInterj i = i ;
|
|
|
|
NoPConj = {s = []} ;
|
|
PConjConj conj = ss (conj.s2) ;
|
|
|
|
NoVoc = {s = []} ;
|
|
VocNP np = {s = "," ++ np.s ! False ! Nom ++ bigNP' np} ;
|
|
|
|
}
|