(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 ;
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} ;
PN = {s : Str ; animacy : Animacy} ;

View File

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

View File

@@ -3,13 +3,14 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
flags optimize=all_subs ;
lin
DetCN det cn = cn ** {s = \\mod =>
case <det.isNum,det.mod> of {
<False,Bare> => det.s ++ cn.s ! det.n ! mod ; -- det is not from Pron, retain NPForm.
<False,X> => cn.s ! det.n ! X ++ det.s ; -- det is from Pron, cn is in Ezafe.
<True,Bare> => det.s ++ cn.s ! Sg ! mod ; -- noun modified by a number is invariably singular
<True,X> => cn.s ! Sg ! X ++ det.s
} ;
DetCN det cn = cn ** {
s = \\m =>
let num : Number = case det.isNum of {
True => Sg ; -- noun modified by a number is invariably singular
False => det.n } ;
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 ;
} ;
@@ -29,7 +30,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
} ;
AdvNP np adv = np ** {
s = \\ez => np.s ! Ezafe ++ adv.s
s = \\ez => np.s ! Ezafe ++ adv.s
} ;
DetQuantOrd quant num ord = {
@@ -71,39 +72,40 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
OrdSuperl a = {s = a.s ! Bare ++ taryn; n = Sg ; isNum=False} ; -- check the form of adjective
DefArt = {s = \\_ => [] ; a = defaultAgr ; mod = Bare} ;
IndefArt = {s = table { Sg => IndefArticle ; Pl => []} ; a =defaultAgr ; mod = Bare} ;
IndefArt = {s = table {Sg => IndefArticle ; Pl => []} ; a = defaultAgr ; mod = Bare} ;
MassNP cn = cn ** {
s = cn.s ! Sg ;
a = agrP3 Sg
} ;
UseN n = n ** {hasAdj=False};
UseN2 n = n ** {hasAdj=False};
UseN n = n ** {hasAdj=False; compl=[]};
UseN2 n = n ** {hasAdj=False; compl=[]};
Use2N3 f = f ** {
c = f.c2;
definitness = True
compl = []
} ;
Use3N3 f = f ** {
c = f.c3;
definitness = True
compl = []
} ;
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
};
ComplN3 f x = f ** {
s = \\n,ez => f.s ! n ! Ezafe ++ f.c2 ++ x.s ! ez ;
c = f.c3;
definitness = True;
ComplN3 n3 np = n3 ** {
s = \\n,m => n3.s ! n ! Ezafe ;
compl = n3.c2 ++ np.s ! Bare ;
c = n3.c3;
} ;
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
} ;
@@ -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} ;
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 : 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
= \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 {

View File

@@ -24,7 +24,10 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
oper
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} ;
VPHSlash : Type = VPH ** {c2 : Compl} ;