mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-29 18:48:37 -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:
@@ -1,11 +1,10 @@
|
||||
--# -path=.:../abstract:../common
|
||||
|
||||
concrete MarkupGer of Markup' = CatGer, MarkHTMLX ** {
|
||||
concrete MarkupGer of Markup = CatGer, MarkHTMLX ** {
|
||||
|
||||
lin
|
||||
MarkupCN m cn = cn ** {s = \\a,n,c => appMark m (cn.s ! a ! n ! c)} ; --- other fields e.g ext intact
|
||||
MarkupNP m np = np ** {s = \\c => appMark m (np.s ! c)} ;
|
||||
MarkupNP' m np = np ** {s = \\c => appMark2 m (np.s ! c)} ;
|
||||
MarkupAP m ap = ap ** {s = \\a => appMark m (ap.s ! a)} ;
|
||||
MarkupAdv m adv = {s = appMark m adv.s} ;
|
||||
MarkupS m s = {s = \\o => appMark m (s.s ! o)} ;
|
||||
@@ -13,8 +12,5 @@ lin
|
||||
MarkupPhr m phr = {s = appMark m phr.s} ;
|
||||
MarkupText m txt = {s = appMark m txt.s} ;
|
||||
|
||||
oper
|
||||
appMark2 : {begin,end : Str} -> Str * Str -> Str * Str
|
||||
= \m,s -> <m.begin ++ s.p1, s.p2 ++ m.end> ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user