mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Som) Implement GenModNP + restructure ComplN2 to better reuse code
This commit is contained in:
@@ -6,6 +6,10 @@ concrete ExtendSom of Extend = CatSom
|
|||||||
** open Prelude, ResSom in {
|
** open Prelude, ResSom in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
|
-- : Num -> NP -> CN -> NP ; -- this man's car(s)
|
||||||
|
GenModNP num np cn = DetCN (DetQuant IndefArt num) (genModCN cn np) ;
|
||||||
|
|
||||||
-- : NP -> SSlash -> Utt ; -- her I love -- Saeed p. 189-
|
-- : NP -> SSlash -> Utt ; -- her I love -- Saeed p. 189-
|
||||||
FocusObj np sslash = -- FIXME: preposition disappears in negative sentences
|
FocusObj np sslash = -- FIXME: preposition disappears in negative sentences
|
||||||
let ss = sslash.s ! False ;
|
let ss = sslash.s ! False ;
|
||||||
|
|||||||
@@ -226,21 +226,7 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
|||||||
UseN,UseN2 = ResSom.useN ;
|
UseN,UseN2 = ResSom.useN ;
|
||||||
|
|
||||||
-- : N2 -> NP -> CN ; -- Sahra hooyadeed
|
-- : N2 -> NP -> CN ; -- Sahra hooyadeed
|
||||||
ComplN2 n2 np = let cn = useN n2 in cn ** {s = \\nf =>
|
ComplN2 n2 np = genModCN (useN n2) np ;
|
||||||
let num = case nf of {
|
|
||||||
Def n => n ;
|
|
||||||
Indef n => n ;
|
|
||||||
_ => Sg } ;
|
|
||||||
art = gda2da cn.gda ! num ;
|
|
||||||
qnt = PossPron (pronTable ! np.a) ;
|
|
||||||
det = case cn.shortPoss of {
|
|
||||||
True => qnt.shortPoss ! art ;
|
|
||||||
_ => qnt.s ! sg n2.gda ! Abs } ;
|
|
||||||
noun = case np.isPron of {
|
|
||||||
True => (pronTable ! np.a).sp ! Abs ; -- long subject pronoun
|
|
||||||
False => np.s ! Abs }
|
|
||||||
in noun ++ cn.s ! Def num ++ BIND ++ det ;
|
|
||||||
isPoss = True} ;
|
|
||||||
|
|
||||||
{-
|
{-
|
||||||
-- : N3 -> NP -> N2 ; -- distance from this city (to Paris)
|
-- : N3 -> NP -> N2 ; -- distance from this city (to Paris)
|
||||||
@@ -346,4 +332,22 @@ oper
|
|||||||
<Definite,AMod|OtherMod> => "ee" ;
|
<Definite,AMod|OtherMod> => "ee" ;
|
||||||
_ => []
|
_ => []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
genModCN : CN -> NP -> CN = \cn,np -> cn ** {
|
||||||
|
s = \\nf =>
|
||||||
|
let num = case nf of {
|
||||||
|
Def n => n ;
|
||||||
|
Indef n => n ;
|
||||||
|
_ => Sg } ;
|
||||||
|
art = gda2da cn.gda ! num ;
|
||||||
|
qnt = PossPron (pronTable ! np.a) ;
|
||||||
|
det = case cn.shortPoss of {
|
||||||
|
True => qnt.shortPoss ! art ;
|
||||||
|
_ => qnt.s ! sg cn.gda ! Abs } ;
|
||||||
|
noun = case np.isPron of {
|
||||||
|
True => (pronTable ! np.a).sp ! Abs ; -- long subject pronoun
|
||||||
|
False => np.s ! Abs }
|
||||||
|
in noun ++ cn.s ! Def num ++ BIND ++ det ;
|
||||||
|
isPoss = True} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user