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

@@ -5,33 +5,33 @@ resource MakeStructuralGer = open CatGer, (P = ParadigmsGer), MorphoGer, Prelude
oper
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
mkSubj : Str -> Subj = \x ->
mkSubj : Str -> Subj = \x ->
{s = x ; lock_Subj = <>} ;
mkIQuant : Str -> IQuant = \s ->
{s = \\_,_,_ => s ; lock_IQuant = <>} ;
mkPredet = overload {
mkPredet : A -> Predet = \a ->
lin Predet {
s = appAdj a ;
c = noCase ;
mkPredet : A -> Predet' = \a ->
lin Predet' {
s = appAdj' a ;
c = noCase' ;
a = PAgNone
} ;
mkPredet : A -> Str -> PCase -> Bool -> Number -> Predet = \a,p,c,b,n ->
lin Predet {
s = appAdj a ;
c = {p = p ; k = PredCase c} ;
} ;
mkPredet : A -> Str -> Case -> Bool -> Number -> Predet' = \a,p,c,b,n ->
lin Predet' {
s = appAdj' a ;
c = {p = p ; k = PredCase' c} ;
a = case b of {True => PAg n ; _ => PAgNone}
}
}
} ;
-- e.g. das selbe
mmkQuant : Quant -> A -> Quant = \q,a -> q ** {
s,sp = \\x,n,g,c => q.s ! x ! n ! g ! c ++ a.s ! Posit ! agrAdj g q.a n ((prepC c).c)
mmkQuant : Quant' -> A -> Quant' = \q,a -> q ** {
s,sp = \\b,x,n,g,c => q.s ! b ! x ! n ! g ! c ++ a.s ! Posit ! agrAdj g q.a n c
} ;
-- e.g. derjenige
mmbQuant : Quant -> A -> Quant = \q,a -> q ** {
s,sp = \\x,n,g,c => q.s ! x ! n ! g ! c + a.s ! Posit ! agrAdj g q.a n ((prepC c).c)
mmbQuant : Quant' -> A -> Quant' = \q,a -> q ** {
s,sp = \\b,x,n,g,c => q.s ! b ! x ! n ! g ! c + a.s ! Posit ! agrAdj g q.a n c
} ;
}