mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
(Fin) Add postmodifier also to N2, needed due to ComplN3
This commit is contained in:
@@ -93,7 +93,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
|
|||||||
A2 = {s : Degree => SAForm => Str ; h : Harmony ; c2 : Compl} ;
|
A2 = {s : Degree => SAForm => Str ; h : Harmony ; c2 : Compl} ;
|
||||||
|
|
||||||
N = SNoun ;
|
N = SNoun ;
|
||||||
N2 = SNoun ** {c2 : Compl ; isPre : Bool} ;
|
N2 = SNoun ** {c2 : Compl ; isPre : Bool ; postmod : Number => Str} ;
|
||||||
N3 = SNoun ** {c2,c3 : Compl ; isPre,isPre2 : Bool} ;
|
N3 = SNoun ** {c2,c3 : Compl ; isPre,isPre2 : Bool} ;
|
||||||
PN = SPN ;
|
PN = SPN ;
|
||||||
|
|
||||||
|
|||||||
@@ -191,41 +191,47 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
|
|||||||
postmod = \\_ => []
|
postmod = \\_ => []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UseN2 = UseN ;
|
UseN2 n = snoun2nounSep n ** {
|
||||||
|
postmod = n.postmod
|
||||||
|
} ;
|
||||||
|
|
||||||
Use2N3 f = {
|
Use2N3 f = {
|
||||||
s = f.s ;
|
s = f.s ;
|
||||||
c2 = f.c2 ;
|
c2 = f.c2 ;
|
||||||
h = f.h ;
|
h = f.h ;
|
||||||
isPre = f.isPre
|
isPre = f.isPre ;
|
||||||
|
postmod = \\_ => [] ;
|
||||||
} ;
|
} ;
|
||||||
Use3N3 f = {
|
Use3N3 f = {
|
||||||
s = f.s ;
|
s = f.s ;
|
||||||
c2 = f.c3 ;
|
c2 = f.c3 ;
|
||||||
h = f.h ;
|
h = f.h ;
|
||||||
isPre = f.isPre2
|
isPre = f.isPre2 ;
|
||||||
|
postmod = \\_ => [] ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplN2 f x = {
|
ComplN2 f x = {
|
||||||
s = \\nf =>
|
s = \\nf =>
|
||||||
case f.isPre of {
|
case f.isPre of {
|
||||||
True => (snoun2nounSep f).s ! nf ;
|
True => cn.s ! nf ;
|
||||||
False => compl ++ (snoun2nounSep f).s ! nf } ;
|
False => compl ++ cn.s ! nf } ;
|
||||||
postmod = case f.isPre of {
|
postmod = \\num =>
|
||||||
True => \\_ => compl ;
|
case f.isPre of { -- If N2 comes from ComplN3, postmod may be filled
|
||||||
False => \\_ => []
|
True => cn.postmod ! num ++ compl ;
|
||||||
} ;
|
False => cn.postmod ! num } ;
|
||||||
h = f.h }
|
h = f.h }
|
||||||
where {compl : Str = appCompl True Pos f.c2 x} ;
|
where {
|
||||||
|
compl : Str = appCompl True Pos f.c2 x ;
|
||||||
|
cn : CN = UseN2 f ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- reuse the pre/post logic from ComplN2.
|
||||||
--- If a possessive suffix is added here it goes after the complements...
|
-- we just need to make the N3 into the lincat of N2
|
||||||
|
ComplN3 f x = ComplN2 (toN2 f) x ** {
|
||||||
ComplN3 f x = {
|
|
||||||
s = \\nf => preOrPost f.isPre (f.s ! nf) (appCompl True Pos f.c2 x) ;
|
|
||||||
c2 = f.c3 ;
|
c2 = f.c3 ;
|
||||||
h = f.h ;
|
isPre = f.isPre2 }
|
||||||
isPre = f.isPre2
|
where {
|
||||||
|
toN2 : N3 -> N2 = \n3 -> lin N2 (n3 ** {postmod = \\_ => []})
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdjCN ap cn = cn ** {
|
AdjCN ap cn = cn ** {
|
||||||
|
|||||||
@@ -631,7 +631,7 @@ mkVS = overload {
|
|||||||
mkN2 : N -> Prep -> N2 = mmkN2
|
mkN2 : N -> Prep -> N2 = mmkN2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mmkN2 : N -> Prep -> N2 = \n,c -> n ** {c2 = c ; isPre = mkIsPre c ; lock_N2 = <>} ;
|
mmkN2 : N -> Prep -> N2 = \n,c -> n ** {c2 = c ; isPre = mkIsPre c ; lock_N2 = <> ; postmod = \\_ => []} ;
|
||||||
mkN3 = \n,c,e -> n ** {c2 = c ; c3 = e ;
|
mkN3 = \n,c,e -> n ** {c2 = c ; c3 = e ;
|
||||||
isPre = mkIsPre c ; -- matka Lontoosta Pariisiin
|
isPre = mkIsPre c ; -- matka Lontoosta Pariisiin
|
||||||
isPre2 = mkIsPre e ; -- Suomen voitto Ruotsista
|
isPre2 = mkIsPre e ; -- Suomen voitto Ruotsista
|
||||||
|
|||||||
Reference in New Issue
Block a user