mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-30 11:08:35 -06:00
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:
+3
-19
@@ -18,35 +18,19 @@ oper
|
||||
-- For $StructuralGer$.
|
||||
|
||||
mkPrep : Str -> Case -> Preposition' = \s,c ->
|
||||
{s = s ; s2 = [] ; c = c ; sg = \\_ => [] ; isPrep = isPrep} ;
|
||||
{s = \\_ => s ; s2 = [] ; c = c ; isPrep = isPrep} ;
|
||||
|
||||
nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr ;
|
||||
-- isLight, isPron : Bool ;
|
||||
w : Weight ;
|
||||
ext,rc : Str} = \name -> heavyNP {
|
||||
s = \\c => usePrepC c (\k -> name.s ! k) ;
|
||||
a = agrP3 Sg
|
||||
} ;
|
||||
nameNounPhrase' : Gender -> {s : Case => Str} -> {s : Case => Str * Str;
|
||||
nameNounPhrase' : Gender -> {s : Case => Str} -> {s : Bool => Case => Str ;
|
||||
a : Agr ;
|
||||
w : Weight' ;
|
||||
ext,rc : Str} =
|
||||
\g,name -> {
|
||||
s = \\c => <[],name.s ! c> ;
|
||||
s = \\_,c => name.s ! c ;
|
||||
a = agrgP3 g Sg ;
|
||||
ext,rc = [] ;
|
||||
w = WHeavy' -- ok?
|
||||
} ;
|
||||
|
||||
detLikeAdj : Bool -> Number -> Str ->
|
||||
{s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} = \isDef,n,dies ->
|
||||
{s,sp = appAdj (regA dies) ! n ; n = n ; a = Weak ; isDef = isDef} ;
|
||||
|
||||
detUnlikeAdj : Bool -> Number -> Str ->
|
||||
{s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} = \isDef,n,dies ->
|
||||
{s,sp = appAdj (regDetA dies) ! n ; n = n ; a = Weak ; isDef = isDef} ;
|
||||
|
||||
-- HL: to reduce PCase to Case:
|
||||
detLikeAdj' : Bool -> Number -> Str ->
|
||||
{s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef : Bool} = \isDef,n,dies ->
|
||||
{s,sp = appAdj' (regA dies) ! n ; n = n ; a = Weak ; isDef = isDef} ;
|
||||
|
||||
Reference in New Issue
Block a user