1
0
forked from GitHub/gf-rgl

(Pes) WIP right form for complements of N2 and N3

Co-Authored-By: Nasrin M <Nasrin63@users.noreply.github.com>
This commit is contained in:
Inari Listenmaa
2019-04-25 11:23:20 +02:00
parent 5b8303aa57
commit bd79656668
4 changed files with 18 additions and 14 deletions

View File

@@ -86,8 +86,8 @@ concrete CatPes of Cat = CommonX ** open ResPes, Prelude in {
N = ResPes.Noun ; N = ResPes.Noun ;
N2 = ResPes.Noun ** {c2 : Str ; compl : Str}; -- when N3 is made to N2, need to retain compl N2 = ResPes.Noun ** {c2 : Compl ; compl : Str}; -- when N3 is made to N2, need to retain compl
N3 = ResPes.Noun ** {c2 : Str ; c3 : Str} ; N3 = ResPes.Noun ** {c2 : Compl ; c3 : Compl} ;
PN = {s : Str ; animacy : Animacy} ; PN = {s : Str ; animacy : Animacy} ;
} }

View File

@@ -65,7 +65,7 @@ concrete LexiconPes of Lexicon = CatPes **
cow_N = mkN01 "گاو" animate; cow_N = mkN01 "گاو" animate;
die_V = mkV "مردن" "میر" ; die_V = mkV "مردن" "میر" ;
dirty_A = mkA "کثیف" ; 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 doctor_N = mkN01 "دکتر" animate; -- has variant "پزشک", but only a doctor in medicine
dog_N = mkN01 "سگ" animate; dog_N = mkN01 "سگ" animate;
door_N = mkN01 "در" inanimate; door_N = mkN01 "در" inanimate;

View File

@@ -119,14 +119,14 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
} ; } ;
ComplN2 n2 np = n2 ** { ComplN2 n2 np = n2 ** {
s = \\n,m => n2.s ! n ! Ezafe ; s = \\n,m => n2.s ! n ! n2.c2.mod ;
compl = \\_ => n2.compl ++ n2.c2 ++ np2str np ; compl = \\_ => n2.compl ++ n2.c2.s ++ np2str np ;
hasAdj = False hasAdj = False
}; };
ComplN3 n3 np = n3 ** { ComplN3 n3 np = n3 ** {
s = \\n,m => n3.s ! n ! Ezafe ; s = \\n,m => n3.s ! n ! n3.c2.mod ;
compl = n3.c2 ++ np2str np ; compl = n3.c2.s ++ np2str np ;
c = n3.c3; c = n3.c3;
} ; } ;

View File

@@ -42,11 +42,13 @@ oper
} ; } ;
mkN2 : overload { 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 : 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 -- Compound Nouns
@@ -366,20 +368,22 @@ oper
mkN2 = overload { mkN2 = overload {
mkN2 : Str -> N2 -- Predictable N2 without complement 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 mkN2 : N -> N2 -- N2 from without complement
= \n -> lin N2 (n ** {c2,compl = []}) ; = \n -> lin N2 (n ** {c2 = noPrep ; compl = []}) ;
mkN2 : N -> Str -> N2 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 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 = overload {
mkN3 : N -> Str -> Str -> N3 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}) ; = \n,p,q -> lin N3 (n ** {c2 = p ; c3 = q}) ;
mkN3 : N -> Prep -> Str -> Str -> N3 -- hidden from public API 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
} ; } ;