1
0
forked from GitHub/gf-rgl

(Pes) Make poss.suff. attach to the head for N2,N3

This commit is contained in:
Inari Listenmaa
2019-02-22 11:16:49 +01:00
parent d175b1eedf
commit c25a236585
5 changed files with 34 additions and 27 deletions

View File

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

View File

@@ -35,7 +35,7 @@ concrete LexiconPes of Lexicon = CatPes **
bread_N = mkN01 "نان" inanimate; bread_N = mkN01 "نان" inanimate;
break_V2 = mkV2 (mkV "شکستن" "شکن") "را"; break_V2 = mkV2 (mkV "شکستن" "شکن") "را";
broad_A = mkA "وسیع" ; broad_A = mkA "وسیع" ;
brother_N2 = (mkN01 "برادر" animate) ** {c=""}; brother_N2 = mkN2 (mkN01 "برادر" animate) [];
brown_A = mkA ["قهوه ای"] ; brown_A = mkA ["قهوه ای"] ;
butter_N = mkN01 "کره" inanimate; butter_N = mkN01 "کره" inanimate;
buy_V2 = mkV2 (mkV_1 "خریدن") "را"; buy_V2 = mkV2 (mkV_1 "خریدن") "را";
@@ -75,7 +75,7 @@ concrete LexiconPes of Lexicon = CatPes **
empty_A = mkA "خالی" ; empty_A = mkA "خالی" ;
enemy_N = mkN02 "دشمن" animate; enemy_N = mkN02 "دشمن" animate;
factory_N = mkN01 "کارخانه" inanimate; factory_N = mkN01 "کارخانه" inanimate;
father_N2 = (mkN02 "پدر" animate) ** {c=""}; father_N2 = mkN2 (mkN02 "پدر" animate) [];
fear_VS = mkV_1 "ترسیدن"; fear_VS = mkV_1 "ترسیدن";
find_V2 = mkV2 (compoundV "پیدا" doVerb) "را"; find_V2 = mkV2 (compoundV "پیدا" doVerb) "را";
fish_N = mkN01 "ماهی" animate; fish_N = mkN01 "ماهی" animate;
@@ -125,7 +125,7 @@ concrete LexiconPes of Lexicon = CatPes **
meat_N = mkN01 "گوشت" inanimate; meat_N = mkN01 "گوشت" inanimate;
milk_N = mkN01 "شیر" inanimate; milk_N = mkN01 "شیر" inanimate;
moon_N = mkN01 "ماه" inanimate; -- is this not a proper noun? moon_N = mkN01 "ماه" inanimate; -- is this not a proper noun?
mother_N2 = (mkN02 "مادر" animate) ** {c=""}; mother_N2 = mkN2 (mkN02 "مادر" animate) [] ;
mountain_N = mkN01 "کوه" inanimate; mountain_N = mkN01 "کوه" inanimate;
music_N = mkN "موسیقی" "موسیقی" animate; music_N = mkN "موسیقی" "موسیقی" animate;
narrow_A = mkA "باریک" ; narrow_A = mkA "باریک" ;

View File

@@ -3,13 +3,14 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
flags optimize=all_subs ; flags optimize=all_subs ;
lin lin
DetCN det cn = cn ** {s = \\mod => DetCN det cn = cn ** {
case <det.isNum,det.mod> of { s = \\m =>
<False,Bare> => det.s ++ cn.s ! det.n ! mod ; -- det is not from Pron, retain NPForm. let num : Number = case det.isNum of {
<False,X> => cn.s ! det.n ! X ++ det.s ; -- det is from Pron, cn is in Ezafe. True => Sg ; -- noun modified by a number is invariably singular
<True,Bare> => det.s ++ cn.s ! Sg ! mod ; -- noun modified by a number is invariably singular False => det.n } ;
<True,X> => cn.s ! Sg ! X ++ det.s in case det.mod of {
} ; Bare => det.s ++ cn.s ! num ! m ++ cn.compl ; -- det doesn't require a special form, keep the Mod=>Str table
x => cn.s ! num ! x ++ det.s ++ cn.compl } ; -- det requires a special form
a = agrP3 det.n ; a = agrP3 det.n ;
} ; } ;
@@ -78,32 +79,33 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
a = agrP3 Sg a = agrP3 Sg
} ; } ;
UseN n = n ** {hasAdj=False}; UseN n = n ** {hasAdj=False; compl=[]};
UseN2 n = n ** {hasAdj=False}; UseN2 n = n ** {hasAdj=False; compl=[]};
Use2N3 f = f ** { Use2N3 f = f ** {
c = f.c2; c = f.c2;
definitness = True compl = []
} ; } ;
Use3N3 f = f ** { Use3N3 f = f ** {
c = f.c3; c = f.c3;
definitness = True compl = []
} ; } ;
ComplN2 n2 np = n2 ** { ComplN2 n2 np = n2 ** {
s = \\n,m => n2.s ! n ! Ezafe ++ n2.c ++ np.s ! m ; s = \\n,m => n2.s ! n ! Ezafe ;
compl = n2.compl ++ n2.c ++ np.s ! Bare ;
hasAdj = False hasAdj = False
}; };
ComplN3 f x = f ** { ComplN3 n3 np = n3 ** {
s = \\n,ez => f.s ! n ! Ezafe ++ f.c2 ++ x.s ! ez ; s = \\n,m => n3.s ! n ! Ezafe ;
c = f.c3; compl = n3.c2 ++ np.s ! Bare ;
definitness = True; c = n3.c3;
} ; } ;
AdjCN ap cn = cn ** { AdjCN ap cn = cn ** {
s = \\n,ez => cn.s ! n ! Ezafe ++ ap.s ! ez ; -- check the form of adjective and also cn.s!ez!n changed from cn.s!Ezafe!n to have correct enclicitic form other wise it creats wrong enclictic form of old man s = \\n,ez => cn.s ! n ! Ezafe ++ ap.s ! ez ;
hasAdj = True hasAdj = True
} ; } ;
@@ -115,6 +117,8 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
SentCN cn sc = cn ** {s = \\n,m => cn.s ! n ! m ++ sc.s} ; SentCN cn sc = cn ** {s = \\n,m => cn.s ! n ! m ++ sc.s} ;
ApposCN cn np = cn ** {s = \\n,m => cn.s ! n ! Ezafe ++ np.s ! m ; definitness = True} ; -- correct for /city Paris/, incorrect for /king John/
-- ApposNP in ExtendPes works for /king John/ (no ezafe).
ApposCN cn np = cn ** {s = \\n,m => cn.s ! n ! Ezafe ++ np.s ! m} ;
} }

View File

@@ -265,9 +265,9 @@ oper
mkN2 = overload { mkN2 = overload {
mkN2 : N -> Str -> N2 mkN2 : N -> Str -> N2
= \n,c -> lin N2 (n ** {c = c}) ; = \n,c -> lin N2 (n ** {c = 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 ** {c = p.s ; c2 = c}) -- there is no c2 = \n,p,c -> lin N2 (n ** {c = p.s ; c2 = c; compl=[]}) -- there is no c2
} ; } ;
mkN3 = overload { mkN3 = overload {

View File

@@ -24,7 +24,10 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
oper oper
Compl : Type = {s : Str ; ra : Str ; c : VType} ; Compl : Type = {s : Str ; ra : Str ; c : VType} ;
CN : Type = Noun ** {hasAdj : Bool} ; -- for getting the right form when NP/CN is a predicate CN : Type = Noun ** {
hasAdj : Bool ; -- to get the right form when CN is a predicate
compl : Str -- to make possessive suffix attach to the right word
} ;
NP : Type = {s : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool} ; NP : Type = {s : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool} ;
VPHSlash : Type = VPH ** {c2 : Compl} ; VPHSlash : Type = VPH ** {c2 : Compl} ;