From bd79656668a174d33b6f8ce9735f4c755d5dd2e9 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 25 Apr 2019 11:23:20 +0200 Subject: [PATCH] (Pes) WIP right form for complements of N2 and N3 Co-Authored-By: Nasrin M --- src/persian/CatPes.gf | 4 ++-- src/persian/LexiconPes.gf | 2 +- src/persian/NounPes.gf | 8 ++++---- src/persian/ParadigmsPes.gf | 18 +++++++++++------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/persian/CatPes.gf b/src/persian/CatPes.gf index 5d2a6bcf..3a2da997 100644 --- a/src/persian/CatPes.gf +++ b/src/persian/CatPes.gf @@ -86,8 +86,8 @@ concrete CatPes of Cat = CommonX ** open ResPes, Prelude in { N = ResPes.Noun ; - N2 = ResPes.Noun ** {c2 : Str ; compl : Str}; -- when N3 is made to N2, need to retain compl - N3 = ResPes.Noun ** {c2 : Str ; c3 : Str} ; + N2 = ResPes.Noun ** {c2 : Compl ; compl : Str}; -- when N3 is made to N2, need to retain compl + N3 = ResPes.Noun ** {c2 : Compl ; c3 : Compl} ; PN = {s : Str ; animacy : Animacy} ; } diff --git a/src/persian/LexiconPes.gf b/src/persian/LexiconPes.gf index 28ca642e..c9e6cff1 100644 --- a/src/persian/LexiconPes.gf +++ b/src/persian/LexiconPes.gf @@ -65,7 +65,7 @@ concrete LexiconPes of Lexicon = CatPes ** cow_N = mkN01 "گاو" animate; die_V = mkV "مردن" "میر" ; dirty_A = mkA "کثیف" ; - distance_N3 = (mkN "فاصله" "فواصل" inanimate ) ** {c2="از" ; c3 = "تا"}; + distance_N3 = mkN3 (mkN "فاصله" "فواصل" inanimate ) "از" "تا" ; doctor_N = mkN01 "دکتر" animate; -- has variant "پزشک", but only a doctor in medicine dog_N = mkN01 "سگ" animate; door_N = mkN01 "در" inanimate; diff --git a/src/persian/NounPes.gf b/src/persian/NounPes.gf index 428ab04c..9a222dcf 100644 --- a/src/persian/NounPes.gf +++ b/src/persian/NounPes.gf @@ -119,14 +119,14 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { } ; ComplN2 n2 np = n2 ** { - s = \\n,m => n2.s ! n ! Ezafe ; - compl = \\_ => n2.compl ++ n2.c2 ++ np2str np ; + s = \\n,m => n2.s ! n ! n2.c2.mod ; + compl = \\_ => n2.compl ++ n2.c2.s ++ np2str np ; hasAdj = False }; ComplN3 n3 np = n3 ** { - s = \\n,m => n3.s ! n ! Ezafe ; - compl = n3.c2 ++ np2str np ; + s = \\n,m => n3.s ! n ! n3.c2.mod ; + compl = n3.c2.s ++ np2str np ; c = n3.c3; } ; diff --git a/src/persian/ParadigmsPes.gf b/src/persian/ParadigmsPes.gf index dbf13599..a1744fbd 100644 --- a/src/persian/ParadigmsPes.gf +++ b/src/persian/ParadigmsPes.gf @@ -42,11 +42,13 @@ oper } ; mkN2 : overload { - mkN2 : (key : N) -> (to : Str) -> N2 -- Takes a noun and a complementiser, returns a N2. + mkN2 : (key : N) -> (to : Str) -> N2 ; -- Takes a noun and a complementiser as a string, returns a N2. + mkN2 : (key : N) -> (to : Prep) -> N2 -- Takes a noun and a complementiser as a Prep, returns a N2. } ; mkN3 : overload { - mkN3 : (distance : N) -> (from,to : Str) -> N3 -- Takes a noun and two complementisers, returns a N3. + mkN3 : (distance : N) -> (from,to : Str) -> N3 ; -- Takes a noun and two complementisers as strings, returns a N3. + mkN3 : (distance : N) -> (from,to : Prep) -> N3 -- Takes a noun and two complementisers as Preps, returns a N3. } ; -- Compound Nouns @@ -366,20 +368,22 @@ oper mkN2 = overload { mkN2 : Str -> N2 -- Predictable N2 without complement - = \s -> lin N2 (mkN01 s inanimate ** {c2,compl = []}) ; + = \s -> lin N2 (mkN01 s inanimate ** {c2 = noPrep ; compl = []}) ; mkN2 : N -> N2 -- N2 from without complement - = \n -> lin N2 (n ** {c2,compl = []}) ; + = \n -> lin N2 (n ** {c2 = noPrep ; compl = []}) ; mkN2 : N -> Str -> N2 - = \n,c -> lin N2 (n ** {c2 = c ; compl = []}) ; + = \n,c -> lin N2 (n ** {c2 = prepOrRa c ; compl = []}) ; mkN2 : N -> Prep -> Str -> N2 -- hidden from puclic API - = \n,p,c -> lin N2 (n ** {c2 = p.s; compl = []}) + = \n,p,c -> lin N2 (n ** {c2 = p; compl = []}) } ; mkN3 = overload { mkN3 : N -> Str -> Str -> N3 + = \n,p,q -> lin N3 (n ** {c2 = prepOrRa p ; c3 = prepOrRa q}) ; + mkN3 : N -> Prep -> Prep -> N3 = \n,p,q -> lin N3 (n ** {c2 = p ; c3 = q}) ; mkN3 : N -> Prep -> Str -> Str -> N3 -- hidden from public API - = \n,p,q,r -> lin N3 (n ** {c2 = p.s ; c3 = q ; c4 = r}) -- there is no c4 + = \n,p,q,r -> lin N3 (n ** {c2 = p ; c3 = prepOrRa q ; c4 = r}) -- there is no c4 } ;