mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
(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:
@@ -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} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -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
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user