From 5871f9c1651e1eda6aec3cd22221e9f9a7dc236b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 3 Oct 2019 17:56:44 +0200 Subject: [PATCH] (Som) Implement GenModNP + restructure ComplN2 to better reuse code --- src/somali/ExtendSom.gf | 4 ++++ src/somali/NounSom.gf | 34 +++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/somali/ExtendSom.gf b/src/somali/ExtendSom.gf index 5d62124b..fdef3793 100644 --- a/src/somali/ExtendSom.gf +++ b/src/somali/ExtendSom.gf @@ -6,6 +6,10 @@ concrete ExtendSom of Extend = CatSom ** open Prelude, ResSom in { 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- FocusObj np sslash = -- FIXME: preposition disappears in negative sentences let ss = sslash.s ! False ; diff --git a/src/somali/NounSom.gf b/src/somali/NounSom.gf index e41754d1..5432a8b4 100644 --- a/src/somali/NounSom.gf +++ b/src/somali/NounSom.gf @@ -226,21 +226,7 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in { UseN,UseN2 = ResSom.useN ; -- : N2 -> NP -> CN ; -- Sahra hooyadeed - ComplN2 n2 np = let cn = useN n2 in 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 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} ; + ComplN2 n2 np = genModCN (useN n2) np ; {- -- : N3 -> NP -> N2 ; -- distance from this city (to Paris) @@ -346,4 +332,22 @@ oper => "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} ; + }