1
0
forked from GitHub/gf-rgl

The files for GrammarGer and AllGer (but not Construction, Documentation, Markup)

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?
This commit is contained in:
Hans Leiss
2022-08-11 21:07:03 +02:00
parent ec41af609d
commit 787f9d10e8
33 changed files with 261 additions and 406 deletions

View File

@@ -8,26 +8,24 @@ concrete IdiomGer of Idiom' = CatGer **
ImpersCl vp = mkClause "es" (agrP3 Sg) vp ;
GenericCl vp = mkClause "man" (agrP3 Sg) vp ;
CleftNP np rs = mkClause "es" (agrP3 Sg)
CleftNP np rs = mkClause "es" (agrP3 Sg)
(insertExtrapos (rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a))) ----
-- (insertObj (\\_ => np.s ! NPC rs.c ++ bigNP np) (predV MorphoGer.sein_V))) ;
(insertObj (\\_ => (np.s ! rs.c).p1 ++ (np.s ! rs.c).p2 ++ bigNP' np) (predV MorphoGer.sein_V))) ; --HL
(insertObj (\\_ => (np.s ! False ! rs.c ++ bigNP' np)) (predV MorphoGer.sein_V))) ; --HL
CleftAdv ad s = mkClause "es" (agrP3 Sg)
CleftAdv ad s = mkClause "es" (agrP3 Sg)
(insertExtrapos (conjThat ++ s.s ! Sub)
(insertObj (\\_ => ad.s) (predV MorphoGer.sein_V))) ;
ExistNP np =
mkClause "es" (agrP3 Sg)
(insertObj (\\_ => appPrep2' geben.c2 np.s ++ bigNP' np)
mkClause "es" (agrP3 Sg)
(insertObj (\\_ => appPrep' geben.c2 (np.s ! False) ++ bigNP' np)
(predV geben)) ;
ExistIP ip = {
s = \\m,t,a,p =>
let
cls =
(mkClause "es" (agrP3 Sg) (predV geben)).s ! m ! t ! a ! p ;
s = \\m,t,a,p =>
let
cls = (mkClause "es" (agrP3 Sg) (predV geben)).s ! m ! t ! a ! p ;
who = ip.s ! Acc
in table {
QDir => who ++ cls ! Inv ;
@@ -38,7 +36,7 @@ concrete IdiomGer of Idiom' = CatGer **
ExistNPAdv np adv=
mkClause "es" (agrP3 Sg)
-- (insertAdv adv.s (insertObj (\\_ => appPrep geben.c2 np.s ++ bigNP np)
(insertAdv adv.s (insertObj (\\_ => appPrep2' geben.c2 np.s ++ bigNP' np)
(insertAdv adv.s (insertObj (\\_ => appPrep' geben.c2 (np.s ! False) ++ bigNP' np)
(predV geben))) ;
ExistIPAdv ip adv = {
@@ -68,7 +66,7 @@ concrete IdiomGer of Idiom' = CatGer **
SelfAdvVP vp = insertAdv "selbst" vp ;
SelfAdVVP vp = insertAdv "selbst" vp ;
SelfNP np = np ** {
s = \\c => <(np.s ! c).p1, (np.s ! c).p2 ++ "selbst" ++ bigNP' np> ;
s = \\_,c => np.s ! False ! c ++ "selbst" ++ bigNP' np ;
isPron = False ;
} ;