diff --git a/src/persian/CatPes.gf b/src/persian/CatPes.gf index 04a2f0e0..453f891c 100644 --- a/src/persian/CatPes.gf +++ b/src/persian/CatPes.gf @@ -7,7 +7,7 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in { S = {s : Str} ; QS = {s : QForm => Str} ; - RS = {s : AgrPes => Str } ; -- c for it clefts + RS = {s : Agr => Str } ; -- c for it clefts SSlash = {s : Str ; c2 : ResPes.Compl} ; ---- Sentence @@ -32,7 +32,7 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in { ---- Relative RCl = { - s : ResPes.VPHTense => Polarity => Order => AgrPes => Str ; + s : ResPes.VPHTense => Polarity => Order => Agr => Str ; -- c : Case } ; RP = {s: Str ; a:RAgr}; @@ -42,7 +42,7 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in { VP = ResPes.VPH ; VPSlash = ResPes.VPHSlash ; - Comp = {s : AgrPes => Str} ; + Comp = {s : Agr => Str} ; ---- Adv Adv = {s : Str} ; @@ -56,13 +56,13 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in { CN = ResPes.Noun ; NP = ResPes.NP ; - Pron = {s : Str ; ps : Str ; a : AgrPes}; + Pron = {s : Str ; ps : Str ; a : Agr}; Det = ResPes.Determiner ; Predet = {s : Str} ; Num = {s : Str ; n : Number ; isNum : Bool} ; Card = {s : Str; n : Number} ; Ord = {s : Str; n : Number ; isNum : Bool} ; - Quant = {s: Number => Str ; a:AgrPes ; fromPron : Bool}; + Quant = {s: Number => Str ; a:Agr ; fromPron : Bool}; Art = {s : Str} ; ---- Numeral diff --git a/src/persian/ConjunctionPes.gf b/src/persian/ConjunctionPes.gf index 09e36e32..ffe4f556 100644 --- a/src/persian/ConjunctionPes.gf +++ b/src/persian/ConjunctionPes.gf @@ -1,5 +1,5 @@ -concrete ConjunctionPes of Conjunction = +concrete ConjunctionPes of Conjunction = CatPes ** open ResPes, Coordination, Prelude in { @@ -13,12 +13,12 @@ concrete ConjunctionPes of Conjunction = -- ConjAdv conj advs = conjunctDistrTable Gender conj advs ; ConjNP conj ss = conjunctDistrTable NPCase conj ss ** { - a = conjAgrPes (agrPesP3 conj.n) ss.a ; + a = conjAgr (agrP3 conj.n) ss.a ; animacy = ss.animacy ; } ; - ConjAP conj ss = conjunctDistrTable Ezafa conj ss ** {adv = ss.adv}; - ConjRS conj rs = conjunctDistrTable AgrPes conj rs ** { c = rs.c}; + ConjAP conj ss = conjunctDistrTable Ezafa conj ss ** {adv = ss.adv}; + ConjRS conj rs = conjunctDistrTable Agr conj rs ** { c = rs.c}; ---- These fun's are generated from the list cat's. @@ -28,10 +28,10 @@ concrete ConjunctionPes of Conjunction = -- BaseAdv x y = twoTable Gender x y ; ConsAdv = consrSS comma ; -- ConsAdv xs x = consrTable Gender comma xs x ; - BaseNP x y = twoTable NPCase x y ** {a = conjAgrPes x.a y.a ; animacy = y.animacy } ; -- check animacy - BaseRS x y = twoTable AgrPes x y ** {c = x.c}; - ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgrPes xs.a x.a ; animacy = xs.animacy } ; -- InaandB xs.animacy x.animacy} ; - ConsRS xs x = consrTable AgrPes comma xs x ** { c = xs.c}; + BaseNP x y = twoTable NPCase x y ** {a = conjAgr x.a y.a ; animacy = y.animacy } ; -- check animacy + BaseRS x y = twoTable Agr x y ** {c = x.c}; + ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a ; animacy = xs.animacy } ; -- InaandB xs.animacy x.animacy} ; + ConsRS xs x = consrTable Agr comma xs x ** { c = xs.c}; -- BaseAP x y = twoTable3 Number Gender Case x y ; -- ** {isPre = andB x.isPre y.isPre} ; BaseAP x y = twoTable Ezafa x y ** {adv = x.adv}; ConsAP xs x = consrTable Ezafa comma xs x ** {adv = x.adv}; -- Table3 Number Gender Case comma xs x ;-- ** {isPre = andB xs.isPre x.isPre} ; @@ -39,8 +39,8 @@ concrete ConjunctionPes of Conjunction = lincat [S] = {s1,s2 : Str} ; [Adv] = {s1,s2 : Str} ; - [NP] = {s1,s2 : NPCase => Str ; a : AgrPes ; animacy : Animacy } ; + [NP] = {s1,s2 : NPCase => Str ; a : Agr ; animacy : Animacy } ; [AP] = {s1,s2 : Ezafa => Str ; adv : Str} ; - [RS] = {s1,s2 : AgrPes => Str }; + [RS] = {s1,s2 : Agr => Str }; } diff --git a/src/persian/IdiomPes.gf b/src/persian/IdiomPes.gf index 0a05e2a4..c2efb6bf 100644 --- a/src/persian/IdiomPes.gf +++ b/src/persian/IdiomPes.gf @@ -3,38 +3,36 @@ concrete IdiomPes of Idiom = CatPes ** open Prelude,Predef, ResPes in { flags optimize=all_subs ; flags coding = utf8; - lin - - ImpersCl vp = mkSClause " " (agrPesP3 Sg) vp ; - GenericCl vp = mkSClause "آدم" (agrPesP3 Sg) vp ; +lin - CleftNP np rs = + ImpersCl vp = mkSClause " " (agrP3 Sg) vp ; + GenericCl vp = mkSClause "آدم" (agrP3 Sg) vp ; + + CleftNP np rs = let cl = mkSClause (np.s ! NPC bEzafa) (np.a) (predAux auxBe); - in + in {s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a }; - - CleftAdv ad ss = { s = \\t,b,o => ad.s ++ ss.s}; - - ExistNP np = - mkSClause " " (agrPesP3 (fromAgr np.a).n) + + CleftAdv ad ss = { s = \\t,b,o => ad.s ++ ss.s}; + + ExistNP np = + mkSClause " " (agrP3 (fromAgr np.a).n) (insertObj (\\_ => np.s ! NPC bEzafa) (predAux auxBe)) ; - ExistIP ip = - let cl = mkSClause ( ip.s ) (agrPesP3 ip.n) (predAux auxBe); - in { - s = \\t,p,qf => case qf of { + ExistIP ip = + let cl = mkSClause ( ip.s ) (agrP3 ip.n) (predAux auxBe); + in { + s = \\t,p,qf => case qf of { QDir => cl.s ! t ! p ! ODir; QIndir => cl.s ! t! p ! ODir } }; --- ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; - ProgrVP vp = (predProg vp) ; + ProgrVP vp = predProg vp ; - ImpPl1 vp = {s = "بیایید" ++ (vp.s ! VVForm (agrPesP1 Pl)).inf} ; - ImpP3 np vp = {s = "بگذارید" ++ np.s!NPC bEzafa ++ (vp.s ! VVForm (AgPes (fromAgr np.a).n (fromAgr np.a).p)).inf}; + ImpPl1 vp = {s = "بیایید" ++ vp.s ! VVForm (agrP1 Pl)} ; + ImpP3 np vp = {s = "بگذارید" ++ np.s!NPC bEzafa ++ vp.s ! VVForm np.a}; } - diff --git a/src/persian/LexiconPes.gf b/src/persian/LexiconPes.gf index 045df031..38bcf873 100644 --- a/src/persian/LexiconPes.gf +++ b/src/persian/LexiconPes.gf @@ -1,17 +1,17 @@ --# -path=.:prelude:alltenses -concrete LexiconPes of Lexicon = CatPes ** +concrete LexiconPes of Lexicon = CatPes ** --open ResPnb, Prelude in { - open ParadigmsPes,MorphoPes, Prelude in { + open ParadigmsPes, MorphoPes, Prelude in { - flags + flags optimize=values ; coding = utf8; lin airplane_N = mkN01 "هواپیما" inanimate ; - answer_V2S = mkV2 (compoundV "جواب" (mkV "دادن" "ده")) "به" False; + answer_V2S = mkV2 (compoundV "جواب" giveVerb) "به" False; apartment_N = mkN01 "آپارتمان" inanimate; apple_N = mkN01 "سیب" inanimate; art_N = mkN01 "هنر" inanimate; @@ -22,7 +22,7 @@ concrete LexiconPes of Lexicon = CatPes ** beautiful_A = mkA "زیبا" ; become_VA = mkV "شدن" "شو"; beer_N = mkN01 "آبجو" inanimate; - beg_V2V = mkV2V (compoundV "خواهش" (mkV "کردن" "کن")) "از" "" False; + beg_V2V = mkV2V (compoundV "خواهش" doVerb) "از" "" False; big_A = mkA "بزرگ" ; bike_N = mkN01 "دوچرخه" inanimate; bird_N = mkN02 "پرنده" animate; @@ -36,12 +36,12 @@ concrete LexiconPes of Lexicon = CatPes ** bread_N = mkN01 "نان" inanimate; break_V2 = mkV2 (mkV "شکستن" "شکن") "را"; broad_A = mkA "وسیع" ; - brother_N2 = (mkN01 "برادر" animate) ** {c=""}; - brown_A = mkA ["قهوه ای"] ; + brother_N2 = (mkN01 "برادر" animate) ** {c=""}; + brown_A = mkA ["قهوه ای"] ; butter_N = mkN01 "کره" inanimate; buy_V2 = mkV2 (mkV_1 "خریدن") "را"; camera_N = mkN01 "دوربین" inanimate; - cap_N = mkCmpdNoun1 "کلاه" (mkN01 "کپ" animate); + cap_N = mkCmpdNoun1 "کلاه" (mkN01 "کپ" animate); car_N = mkN01 "ماشین" inanimate; -- has variant "اتومبیل" carpet_N = mkN01 "فرش" inanimate; cat_N = mkN01 "گربه" animate; @@ -52,22 +52,22 @@ concrete LexiconPes of Lexicon = CatPes ** church_N = mkN01 "کلیسا" inanimate; city_N = mkN01 "شهر" inanimate; clean_A = mkA "تمیز" ; - clever_A = mkA "باهوش" ["با هوشمندی"]; - close_V2 = mkV2 (mkV "بستن" "بند") "را"; + clever_A = mkA "باهوش" ["با هوشمندی"]; + close_V2 = mkV2 (mkV "بستن" "بند") "را"; coat_N = mkN01 "کت" inanimate; cold_A = mkA "سرد" ; come_V = mkV "آمدن" "آی" ; computer_N = mkN01 "کامپیوتر" inanimate; -- also vaiant "رایانه" country_N = mkN01 "کشور" inanimate; - + -- Note: cousin inflects for gender and for being a mother's or a father's relatives in persian -- The following is an example which is the daughter of your mom's brother - cousin_N = mkCmpdNoun1 "دختر" (mkN01 "دایی" animate); + cousin_N = mkCmpdNoun1 "دختر" (mkN01 "دایی" animate); cow_N = mkN01 "گاو" animate; die_V = mkV "مردن" "میر" ; dirty_A = mkA "کثیف" ; distance_N3 = (mkN "فاصله" "فواصل" inanimate ) ** {c2="از" ; c3 = "تا"}; - 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; door_N = mkN01 "در" inanimate; drink_V2 = mkV2 (mkV_1 "نوشیدن") "را"; @@ -77,11 +77,11 @@ concrete LexiconPes of Lexicon = CatPes ** enemy_N = mkN02 "دشمن" animate; factory_N = mkN01 "کارخانه" inanimate; father_N2 = (mkN02 "پدر" animate) ** {c=""}; - fear_VS = mkV_1 "ترسیدن"; - find_V2 = mkV2 (compoundV "پیدا" (mkV "کردن" "کن") ) "را"; + fear_VS = mkV_1 "ترسیدن"; + find_V2 = mkV2 (compoundV "پیدا" doVerb) "را"; fish_N = mkN01 "ماهی" animate; floor_N = mkN01 "زمین" inanimate; -- Note: floor in persian can have 3 different translations - forget_V2 = mkV2 (compoundV "فراموش" (mkV "کردن" "کن")) "را" ; + forget_V2 = mkV2 (compoundV "فراموش" doVerb) "را" ; fridge_N = mkN01 "یخچال" inanimate; friend_N = mkN02 "دوست" animate; fruit_N = mkN01 "میوه" inanimate; @@ -96,7 +96,6 @@ concrete LexiconPes of Lexicon = CatPes ** harbour_N = mkN "بندر" "بنادر" inanimate; -- hate_V2 = mkV2 (compoundV "متنفر" (mkToBe "بودن" "باش" "هست")) "از" False; -- needs from/ verb to be hat_N = mkN01 "کلاه" inanimate; - have_V2 = mkV2 haveVerb "را" ; hear_V2 = mkV2 (mkV "شنیدن" "شنو") "را" ; hill_N = mkN01 "تپه" inanimate; -- hope_VS = compoundV "امیدوار" (mkToBe "بودن" "باش" "هست"); @@ -108,43 +107,43 @@ concrete LexiconPes of Lexicon = CatPes ** iron_N = mkN01 "آهن" inanimate; king_N = mkN "پادشاه" "پادشاهان" animate; know_V2 = mkV2 (mkV "شناختن" "شناس") "را"; - know_VS = (mkV_1 "دانستن"); + know_VS = (mkV_1 "دانستن") ; -- danestan -> dan ; needs explicit mkV_1 know_VQ = (mkV_1 "دانستن") ; lake_N = mkN01 "دریاچه" inanimate; lamp_N = mkN01 "چراغ" inanimate; -- also "لامپ", but they have different usage - learn_V2 = mkV2 (compoundV "یاد"(mkV "گرفتن" "گیر")) "را"; - leather_N = mkN01 "چرم" inanimate; -- is uncountable - leave_V2 = mkV2 (compoundV "ترک"(mkV "کردن" "کن")) "را"; - like_V2 = mkV2 (compoundV "دوست" haveVerb) "را"; - listen_V2 = mkV2 (compoundV "گوش" (mkV "دادن" "ده")) "به" False; -- has a diferent preposition :"به" - live_V = compoundV "زندگی" (mkV "کردن" "کن"); + learn_V2 = mkV2 (compoundV "یاد" takeVerb) "را"; + leather_N = mkN01 "چرم" inanimate; -- is uncountable + leave_V2 = mkV2 (compoundV "ترک" doVerb) "را"; + like_V2 = mkV2 (compoundV "دوست" haveVerb) "را"; + listen_V2 = mkV2 (compoundV "گوش" giveVerb) "به" False; -- has a diferent preposition :"به" + live_V = compoundV "زندگی" doVerb; long_A = mkA "بلند" ; - lose_V2 = mkV2 (compoundV "گم" (mkV "کردن" "کن")) "را" ; - love_N = mkN01 "عشق" inanimate; + lose_V2 = mkV2 (compoundV "گم" doVerb) "را" ; + love_N = mkN01 "عشق" inanimate; love_V2 = mkV2 (compoundV "دوست" haveVerb) "را"; -- also possible: love_V2 = mkV2 (compoundV "عاشق" (mkToBe "بودن" "باش" "هست")); - man_N = mkN02 "مرد" animate; + man_N = mkN02 "مرد" animate; married_A2 = mkA "متأهل" ""; 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 = (mkN02 "مادر" animate) ** {c=""}; mountain_N = mkN01 "کوه" inanimate; - music_N = mkN "موسیقی" "موسیقی" animate; + music_N = mkN "موسیقی" "موسیقی" animate; narrow_A = mkA "باریک" ; new_A = mkA "نو" "تازه"; newspaper_N = mkN01 "روزنامه" inanimate; oil_N = mkN "نفت" "نفت" inanimate; -- also "روغن" old_A = mkA "پیر" "پیرانه"; - open_V2 = mkV2 (compoundV "باز" (mkV "کردن" "کن")) "را"; - paint_V2A = mkV2 (compoundV "رنگ" (mkV "کردن" "کن")) "را" ; + open_V2 = mkV2 (compoundV "باز" doVerb) "را"; + paint_V2A = mkV2 (compoundV "رنگ" doVerb) "را" ; paper_N = mkN01 "کاغذ" inanimate; - paris_PN = mkPN "پاریس" inanimate; - peace_N = mkN01 "صلح" inanimate; -- also "آرامش" + paris_PN = mkPN "پاریس" inanimate; + peace_N = mkN01 "صلح" inanimate; -- also "آرامش" pen_N = mkN01 "قلم" inanimate; -- has variant "خودکار" planet_N = mkN01 "سیّاره" inanimate; - plastic_N = mkN01 "پلاستیک" inanimate; -- is uncountable - play_V2 = mkV2 (mkV "نواختن" "نواز") "را" ; - policeman_N = mkCmpdNoun2 (mkN02 "مأمور" animate) "پلیس"; + plastic_N = mkN01 "پلاستیک" inanimate; -- is uncountable + play_V2 = mkV2 (mkV "نواختن" "نواز") "را" ; + policeman_N = mkCmpdNoun2 (mkN02 "مأمور" animate) "پلیس"; priest_N = mkN01 "کشیش" animate; -- probable_AS = mkAS (regA "محتمل") ; queen_N = mkN01 "ملکه" animate; @@ -157,16 +156,16 @@ concrete LexiconPes of Lexicon = CatPes ** river_N = mkN01 "رودخانه" inanimate; rock_N = mkN01 "صخره" inanimate; roof_N = mkN01 "بام" inanimate; -- has variant "سقف" - rubber_N = mkN01 "پاککن" inanimate; -- also "لاستیک" + rubber_N = mkN01 "پاککن" inanimate; -- also "لاستیک" run_V = mkV_1 "دویدن" ; say_VS = mkV "گفتن" "گوی" ; school_N = mkN "مدرسه" "مدارس" inanimate; science_N = mkN "علم" "علوم" inanimate; -- also "دانش" sea_N = mkN01 "دریا" inanimate; - seek_V2 = mkV2 (compoundV "جستجو" (mkV "کردن" "کن")) "را"; + seek_V2 = mkV2 (compoundV "جستجو" doVerb) "را"; see_V2 = mkV2 (mkV "دیدن" "بین") "را" ; - sell_V3 = mkV3 (mkV "فروختن" "فروش") "را" "به"; - send_V3 = mkV3 (mkV_1 "فرستادن") "را" "برای"; + sell_V3 = mkV3 (mkV "فروختن" "فروش") "را" "به"; + send_V3 = mkV3 (mkV_1 "فرستادن") "را" "برای"; sheep_N = mkN01 "گوسفند" animate; ship_N = mkN01 "کشتی" inanimate; shirt_N = mkN01 "پیراهن" inanimate; @@ -179,7 +178,7 @@ concrete LexiconPes of Lexicon = CatPes ** small_A = mkA "کوچک" ; snake_N = mkN01 "مار" animate; sock_N = mkN01 "جوراب" inanimate; - speak_V2 = mkV2 (compoundV "صحبت" (mkV "کردن" "کن")) "" False; + speak_V2 = mkV2 (compoundV "صحبت" doVerb) "" False; star_N = mkN01 "ستاره" animate; steel_N = mkN01 "فولاد" inanimate; -- also "استیل" stone_N = mkN01 "سنگ" inanimate; @@ -187,24 +186,24 @@ concrete LexiconPes of Lexicon = CatPes ** student_N = mkCmpdNoun1 "دانش" (mkN02 "آموز" animate); -- also "دانشجو" stupid_A = mkA "ابله" "ابلهانه" ; sun_N = mkN01 "خورشید" inanimate; -- is this not a proper noun?!!! - switch8off_V2 = mkV2 (compoundV "خاموش" (mkV "کردن" "کن")) "را"; - switch8on_V2 = mkV2 (compoundV "روشن" (mkV "کردن" "کن")) "را"; + switch8off_V2 = mkV2 (compoundV "خاموش" doVerb) "را"; + switch8on_V2 = mkV2 (compoundV "روشن" doVerb) "را"; table_N = mkN01 "میز" inanimate; - talk_V3 = mkV3 (compoundV "حرف" (mkV "زدن" "زن")) "با" [" درباره ی"]; + talk_V3 = mkV3 (compoundV "حرف" hitVerb) "با" [" درباره ی"]; teacher_N = mkN02 "معلم" animate; - teach_V2 = mkV2 (compoundV "آموزش" (mkV "دادن" "ده")) "را"; + teach_V2 = mkV2 (compoundV "آموزش" giveVerb) "را"; television_N = mkN01 "تلوزیون" inanimate; thick_A = mkA "کلفت" ; thin_A = mkA "نازک" ; train_N = mkN01 "قطار" inanimate; - travel_V = compoundV "سفر" (mkV "کردن" "کن"); + travel_V = compoundV "سفر" doVerb; tree_N = mkN02 "درخت" animate; - trousers_N = mkN01 "شلوار" inanimate; +-- trousers_N = mkN01 "شلوار" inanimate; ugly_A = mkA "زشت" ; understand_V2 = mkV2 (mkV_1 "فهمیدن") "را"; university_N = mkN01 "دانشگاه" inanimate; village_N = mkN01 "روستا" inanimate; --- wait_V2 = mkV2 (compoundV "منتظر" (mkVToBe "بودن" "باش")); +-- wait_V2 = mkV2 (compoundV "منتظر" (mkVToBe "بودن" "باش")); walk_V = compoundV "راه" (mkV "رفتن" "رو"); warm_A = mkA "گرم" ; war_N = mkN01 "جنگ" inanimate; @@ -213,30 +212,30 @@ concrete LexiconPes of Lexicon = CatPes ** white_A = mkA "سفید" ; window_N = mkN01 "پنجره" inanimate; wine_N = mkN01 "شراب" inanimate; - win_V2 = mkV2 (compoundV "برنده" (mkV "شدن" "شو")) "را"; -- also possible with simple verb: mkV_2 "بردن" + win_V2 = mkV2 (compoundV "برنده" (mkV "شدن" "شو")) "را"; -- also possible with simple verb: mkV_2 "بردن" woman_N = mkN02 "زن" animate; --- wonder_VQ = compoundV "متعجب" (mkVToBe "بودن" "باش") ; +-- wonder_VQ = compoundV "متعجب" (mkVToBe "بودن" "باش") ; wood_N = mkN01 "چوب" inanimate; write_V2 = mkV2 (mkV "نوشتن" "نویس") "را" ; yellow_A = mkA "زرد" ; young_A = mkA "جوان""جوانانه" ; - do_V2 = mkV2 (compoundV "انجام" (mkV "دادن" "ده")) "را"; + do_V2 = mkV2 (compoundV "انجام" giveVerb) "را"; now_Adv = ss "حالا" ; already_Adv = ss "قبلاً" ; song_N = mkN01 "آواز" inanimate; - add_V3 = mkV3 (compoundV "اضافه" (mkV "کردن" "کن")) "را" "به" ; + add_V3 = mkV3 (compoundV "اضافه" doVerb) "را" "به" ; number_N = mkN01 "عدد" inanimate; -- also "تعداد" put_V2 = mkV2 (mkV "گذاشتن" "گذار") "را"; - stop_V = compoundV "توقف" (mkV "کردن" "کن"); + stop_V = compoundV "توقف" doVerb; jump_V = mkV_1 "پریدن"; {- left_Ord = {s = "چپ" ; n = singular}; right_Ord = {s= "راست" ; n = singular}; --} +-} far_Adv = ss "دور" ; correct_A = mkA "درست" ; dry_A = mkA "خشک" ["به خشکی"] ; - dull_A = mkA ["ملال آور"] ["به طرزی ملال آور"] ; + dull_A = mkA ["ملال آور"] ["به طرزی ملال آور"] ; full_A = mkA "پر" ; heavy_A = mkA "سنگین" ; near_A = mkA "نزدیک" ; @@ -245,11 +244,11 @@ concrete LexiconPes of Lexicon = CatPes ** sharp_A = mkA "تیز" ; smooth_A = mkA "نرم" ; straight_A = mkA "مستقیم" "مستقیماً"; - wet_A = mkA "خیس" ; + wet_A = mkA "خیس" ; wide_A = mkA "پهن" ; animal_N = mkN "حیوان" "حیوانات" animate; - ashes_N = mkN01 "خاکستر" inanimate; - back_N = mkN01 "کمر" inanimate; + ashes_N = mkN01 "خاکستر" inanimate; + back_N = mkN01 "کمر" inanimate; bark_N = mkN01 "عوعو" inanimate; belly_N = mkN01 "شکم" inanimate; blood_N = mkN01 "خون" inanimate; @@ -259,8 +258,8 @@ concrete LexiconPes of Lexicon = CatPes ** day_N = mkN01 "روز" inanimate; dust_N = mkN01 "غبار" inanimate; ear_N = mkN01 "گوش" inanimate; - earth_N = mkN01 "زمین" inanimate; -- also "خاک" - egg_N = mkCmpdNoun1 "تخم" (mkN01 "مرغ" inanimate); + earth_N = mkN01 "زمین" inanimate; -- also "خاک" + egg_N = mkCmpdNoun1 "تخم" (mkN01 "مرغ" inanimate); eye_N = mkN01 "چشم" inanimate ; fat_N = mkN01 "چربی" inanimate; feather_N = mkN01 "پر" inanimate; @@ -290,7 +289,7 @@ concrete LexiconPes of Lexicon = CatPes ** night_N = mkN01 "شب" inanimate; nose_N = mkN01 "بینی" inanimate; person_N = mkN "شخص" "اشخاص" animate; - rain_N = mkN01 "باران" inanimate; + rain_N = mkN01 "باران" inanimate; road_N = mkN01 "جاده" inanimate; root_N = mkN01 "ریشه" inanimate; rope_N = mkN01 "طناب" inanimate; @@ -315,60 +314,64 @@ concrete LexiconPes of Lexicon = CatPes ** burn_V = mkV "سوختن" "سوز" ; dig_V = mkV_2 "کندن" ; fall_V = mkV_1 "افتادن" ; --- float_V = compoundV "شناور" (mkToBe "بودن" "باش" "هست") ; + --float_V = compoundV "شناور" (mkToBe "بودن" "باش" "هست") ; flow_V = compoundV "جاری" (mkV "شدن" "شو") ; - fly_V = compoundV "پرواز" (mkV "کردن" "کن") ; - freeze_V = compoundV "یخ" (mkV "زدن" "زن") ; - give_V3 = mkV3 (mkV "دادن" "ده") "را" "به"; + fly_V = compoundV "پرواز" doVerb ; + freeze_V = compoundV "یخ" hitVerb ; + give_V3 = mkV3 giveVerb "را" "به"; laugh_V = mkV_1 "خندیدن" ; - lie_N = mkN01 "دروغ" inanimate; lie_V = compoundV "دروغ" (mkV "گفتن" "گو" ); - play_V = compoundV "بازی" (mkV "کردن" "کن"); + play_V = compoundV "بازی" doVerb; sew_V = mkV "دوختن" "دوز" ; sing_V = compoundV "آواز" (mkV_2 "خواندن"); sit_V = mkV "نشستن" "نشین" ; - smell_V = compoundV "بو" (mkV "دادن" "ده"); - spit_V = compoundV "تف" (mkV "کردن" "کن"); + smell_V = compoundV "بو" giveVerb; + spit_V = compoundV "تف" doVerb; stand_V = mkV_1 "ایستادن"; - swell_V = compoundV "ورم" (mkV "کردن" "کن"); - swim_V = compoundV "شنا" (mkV "کردن" "کن"); - think_V = compoundV "فکر" (mkV "کردن" "کن"); + swell_V = compoundV "ورم" doVerb; + swim_V = compoundV "شنا" doVerb; + think_V = compoundV "فکر" doVerb; turn_V = mkV_1 "چرخیدن" ; - vomit_V = compoundV "استفراغ" (mkV "کردن" "کن"); - bite_V2 = mkV2 (compoundV "گاز" (mkV "گرفتن" "گیر")) "را"; + vomit_V = compoundV "استفراغ" doVerb; + bite_V2 = mkV2 (compoundV "گاز" takeVerb) "را"; count_V2 = mkV2 (mkV_2 "شماردن") "را"; cut_V2 = mkV2 (mkV_1 "بریدن") ; fear_V2 = mkV2 (mkV_1 "ترسیدن") "از"; fight_V2 = mkV2 (mkV_1 "جنگیدن") "با" False; - hit_V2 = mkV2 (compoundV "ضربه" (mkV "زدن" "زن")) "به" False; + hit_V2 = mkV2 (compoundV "ضربه" hitVerb) "به" False; hold_V2 = mkV2 (compoundV "نگه" haveVerb) "را"; - hunt_V2 = mkV2 (compoundV "شکار" (mkV "کردن" "کن")) "را"; + hunt_V2 = mkV2 (compoundV "شکار" doVerb) "را"; kill_V2 = mkV2 ( mkV_2 "کشتن") "را"; pull_V2 = mkV2 (mkV_1 "کشیدن") "را"; - push_V2 = mkV2 (compoundV "هل" (mkV "دادن" "ده")) "را" ; + push_V2 = mkV2 (compoundV "هل" giveVerb) "را" ; rub_V2 = mkV2 (mkV_1 "مالیدن") "را"; scratch_V2 = mkV2 (mkV_1 "خراشیدن") "را" ; - split_V2 = mkV2 (compoundV "تقسیم" (mkV "کردن" "کن")) "را"; - squeeze_V2 = mkV2 (compoundV "له" (mkV "کردن" "کن")) "را"; - stab_V2 = mkV2 (compoundV "چاقو" (mkV "زدن" "زن")) "به" False; + split_V2 = mkV2 (compoundV "تقسیم" doVerb) "را"; + squeeze_V2 = mkV2 (compoundV "له" doVerb) "را"; + stab_V2 = mkV2 (compoundV "چاقو" hitVerb) "به" False; suck_V2 = mkV2 (mkV_1 "مکیدن") "را" ; - throw_V2 = mkV2 (compoundV "پرتاب" (mkV "کردن" "کن")) "را"; - tie_V2 = mkV2 (compoundV "گره" (mkV "زدن" "زن")) "را"; + throw_V2 = mkV2 (compoundV "پرتاب" doVerb) "را"; + tie_V2 = mkV2 (compoundV "گره" hitVerb) "را"; wash_V2 = mkV2 (mkV "شستن" "شور") "را" ; -- also "شوی" which is the very formal form of the present root - wipe_V2 = mkV2 (compoundV "پاک" (mkV "کردن" "کن")) "را"; + wipe_V2 = mkV2 (compoundV "پاک" doVerb) "را"; ---- other_A = regA "دیگر" ; - grammar_N = mkCmpdNoun1 "دستور" (mkN01 "زبان" inanimate); + grammar_N = mkCmpdNoun1 "دستور" (mkN01 "زبان" inanimate); language_N = mkN01 "زبان" inanimate; rule_N = mkN "قانون" "قوانین" inanimate; ---- added 4/6/2007 - john_PN = mkPN "جان" inanimate; + john_PN = mkPN "جان" inanimate; question_N = mkN01 "سؤال" inanimate; -- has variant "پرسش" ready_A = mkA "آماده" ["با آمادگی"] ; reason_N = mkN "دلیل" "دلایل" inanimate; today_Adv = ss "امروز" ; uncertain_A = mkA "نامعلوم" ["با تردید"]; - + +oper + doVerb = mkV "کردن" "کن" ; + takeVerb = mkV "گرفتن" "گیر" ; + hitVerb = mkV "زدن" "زن" ; + giveVerb = mkV "دادن" "ده" ; } diff --git a/src/persian/MorphoPes.gf b/src/persian/MorphoPes.gf index b865569a..b21e3042 100644 --- a/src/persian/MorphoPes.gf +++ b/src/persian/MorphoPes.gf @@ -1,25 +1,82 @@ --# -path=.:../../prelude -- -----1 A Simple Punjabi Resource Morphology +----1 A Simple Persian Resource Morphology ---- ---- Shafqat Virk, Aarne Ranta,2010 ---- ---- This resource morphology contains definitions needed in the resource ----- syntax. To build a lexicon, it is better to use $ParadigmsPnb$, which +---- syntax. To build a lexicon, it is better to use $ParadigmsPes$, which ---- gives a higher-level access to this module. -- -resource MorphoPes = ResPes ** open Prelude,Predef in { +resource MorphoPes = ParamX ** open Prelude,Predef in { flags optimize=all ; coding = utf8; -----2 Nouns +---- Orthography oper - - mkN : (x1,x2 : Str) -> Animacy -> Noun = - \sg,pl,ani -> { - s = table { + -- Zero-width non-joiner, used for certain morphemes + -- See https://en.wikipedia.org/wiki/Persian_alphabet#Word_boundaries + ZWNJ : Str = "‌" ; + zwnj : Str -> Str -> Str = \s1,s2 -> s1 + ZWNJ + s2 ; + +---- Nouns +param + Animacy = Animate | Inanimate ; + Ezafa = bEzafa | aEzafa | enClic ; + Agr = Ag Number Person ; + +------------------------------------------ +-- Agreement transformations +----------------------------------------- +oper + toAgr : Number -> Person -> Agr = \n,p -> Ag n p ; + + fromAgr : Agr -> {n : Number ; p : Person } = \agr -> case agr of { + Ag n p => {n = n ; p = p} + } ; + + conjAgr : Agr -> Agr -> Agr = \a0,b0 -> + let a = fromAgr a0 ; b = fromAgr b0 + in toAgr (conjNumber a.n b.n) b.p ; + + giveNumber : Agr -> Number = \a -> case a of { + Ag n _ => n + } ; + + defaultAgr : Agr = agrP3 Sg ; + agrP3 : Number -> Agr = \n -> Ag n P3 ; + agrP1 : Number -> Agr = \n -> Ag n P1 ; + +------------------------- +-- Ezafa construction +------------------------ +oper + + mkEzafa : Str -> Str ; + mkEzafa str = case str of { + st + "اه" => str ; + st + "وه" => str ; + st + "ه" => st + "ۀ" ; -- str ++ "ی" ; + st + "او" => str ; + st + "وو" => str ; + st + "و" => str + "ی" ; + st + "ا" => str + "ی" ; + _ => str + }; + mkEnclic : Str -> Str ; + mkEnclic str = case str of { + st + "ا" => str ++ "یی" ; + st + "و" => str ++ "یی" ; + st + "ی" => str ++ "یی" ; -- TODO + st + "ه" => str ++ "یی" ; + _ => str + "ی" + } ; + + Noun = {s : Ezafa => Number => Str ; animacy : Animacy ; definitness : Bool } ; + mkN : (x1,x2 : Str) -> Animacy -> Noun = \sg,pl,ani -> { + s = table { bEzafa => table { Sg => sg ; Pl => pl } ; @@ -28,480 +85,235 @@ oper } ; enClic => table { Sg => mkEnclic sg ; Pl => mkEnclic pl - } + } }; animacy = ani ; definitness = True - } ; - - - + } ; + -- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e) -- Arabic nouns ends with h. also taken as Masc - ------------------------------------------------------------------ -----Verbs ------------------------------------------------------------------- -{- - mkVerb : (x1,x2 : Str) -> Verb = \inf,root2 -> - let root1 = (tk 1 inf) ; - in { - s = table { - Root1 => root1 ; - Root2 => root2 ; - Inf => inf ; +--------------------- +--Determiners +-------------------- +Determiner : Type = {s : Str ; n :Number ; isNum : Bool ; fromPron : Bool} ; - VF tense aspect person number => (mkCmnVF root1 root2 tense aspect person number).s --- Caus1 tense person number gender => (mkCmnVF root1 tense person number gender).s ; --- Caus2 tense person number gender => (mkCmnVF root2 tense person number gender).s - } - } ; + makeDet : Str -> Number -> Bool -> Determiner = \str,n,b -> { + s = str; + isNum = b; + fromPron = False ; + n = n + }; ---1. Basic stem form, direct & indirect causatives exists --- v1 nechna nechaana nechwana - - mkVerb1 : (_: Str) -> Verb = \inf -> - let root1 = (tk 1 inf) ; - root2 = (tk 3 inf) ; - in { - s = table { - - Root1 => root1 ; - Root2 => root2 ; - Inf => inf ; - - VF tense aspect person number => (mkCmnVF root1 root2 tense aspect person number).s --- Caus1 tense person number gender => (mkCmnVF root1 tense person number gender).s ; --- Caus2 tense person number gender => (mkCmnVF root2 tense person number gender).s - } - } ; - - -mkVerb2 : (_: Str) -> Verb = \inf -> - let root1 = (tk 1 inf) ; - root2 = (tk 2 inf) ; - in { - s = table { - - Root1 => root1 ; - Root2 => root2 ; - Inf => inf ; - - VF tense aspect person number => (mkCmnVF root1 root2 tense aspect person number).s --- Caus1 tense person number gender => (mkCmnVF root1 tense person number gender).s ; --- Caus2 tense person number gender => (mkCmnVF root2 tense person number gender).s - } - } ; - - - -mkCmnVF : Str -> Str -> VTense -> PAspect -> PPerson -> Number -> {s:Str}= \root1,root2,t,a,p,n -> - {s = (mkCmnVF1 root1 root2 t a p n).s ; - }; - - - mkCmnVF1 : Str -> Str -> VTense -> PAspect -> PPerson -> Number -> {s:Str}= \root1,root2,t,a,p,n -> - {s = let khordh = root1 + "ه"; - mekhor = "می" ++ root2 ; - mekhord = "می" ++ root1 ; - mekhordh = "می" ++ khordh ; - khah = "خواه" ; - mekhah = "می" ++ khah ; - bvdh = "بوده" - in - case of { - => khordh ++ "ام" ; - => khordh ++ "ایم" ; - => khordh ++ "ای" ; - => khordh ++ "اید" ; - => khordh ++ "است" ; - => khordh ++ "اند" ; - - => mekhor + "م" ; -- toHave need to have khor instead of mekhor - => mekhor + "یم" ; - => mekhor + "ی" ; - => mekhor + "ید" ; - => mekhor + "د" ; - => mekhor + "ند" ; - - => "" ; - => "" ; - => "" ; - => "" ; - => "" ; - => "" ; - - => khordh ++ "بودم" ; - => khordh ++ "بودیم" ; - => khordh ++ "بودی" ; - => khordh ++ "بودید" ; - => khordh ++ "بود" ; - => khordh ++ "بودند" ; - - => mekhord + "م" ; -- toHave need to have khor instead of mekhor - => mekhord + "یم" ; - => mekhord + "ی"; - => mekhord + "ید" ; - => mekhord ; - => mekhord + "ند" ; - - => root1 + "م" ; - => root1 + "یم" ; - => root1 + "ی"; - => root1 + "ید" ; - => root1 ; - => root1 + "ند" ; - - -- check this one - => "" ; - => "" ; - => "" ; - => "" ; - => "" ; - => "" ; - - => mekhah + "م" ++ addBh root2 + "م" ; - => mekhah + "یم" ++ addBh root2 + "یم" ; - => mekhah + "ی" ++ addBh root2 + "ی" ; - => mekhah + "ید" ++ addBh root2 + "ید" ; - => mekhah + "د" ++ addBh root2 + "د" ; - => mekhah + "ند" ++ addBh root2 + "ند" ; - - => khah + "م" ++ root1 ; - => khah + "یم" ++ root1 ; - => khah + "ی" ++ root1 ; - => khah + "ید" ++ root1 ; - => khah + "د" ++ root1 ; - => khah + "ند" ++ root1 ; - - - => khordh ++ bvdh ++ "ام" ; - => khordh ++ bvdh ++ "ایم" ; - => khordh ++ bvdh ++ "ای" ; - => khordh ++ bvdh ++ "اید" ; - => khordh ++ bvdh ++ "است" ; - => khordh ++ bvdh ++ "اند" ; - - => mekhordh ++ "ام" ; -- toHave need to have khordh instead of mekhor - => mekhordh ++ "ایم" ; - => mekhordh ++ "ای" ; - => mekhordh ++ "اید" ; - => mekhordh ++ "است" ; - => mekhordh ++ "اند" ; - - - -- check this one - => "" ; - => "" ; - => "" ; - => "" ; - => "" ; - => "" - - - } - } ; - -} - mkVerb : (x1,x2 : Str) -> Verb = \inf,root2 -> - let root1 = (tk 1 inf) ; - impRoot = mkimpRoot root2; - in { - s = table { - - Root1 => root1 ; - Root2 => root2 ; - Inf => inf ; - Imp Pos Sg => addBh impRoot ; - Imp Pos Pl => (addBh impRoot) + "ید" ; - Imp Neg Sg => "ن" + impRoot ; - Imp Neg Pl => "ن" + impRoot + "ید" ; - - VF pol tense person number => (mkCmnVF root1 root2 pol tense person number).s ; --- VF Neg tense person number => addN (mkCmnVF root1 root2 tense person number).s ; - Vvform (AgPes number person) => (mkvVform root2 number person).s - } - } ; - - mkVerb1 : (_: Str) -> Verb = \inf -> - let root1 = (tk 1 inf) ; - root2 = (tk 3 inf) ; - impRoot = mkimpRoot root2 ; - in { - s = table { - - Root1 => root1 ; - Root2 => root2 ; - Inf => inf ; - Imp Pos Sg => addBh impRoot ; - Imp Pos Pl => (addBh impRoot) + "ید" ; - Imp Neg Sg => "ن" + impRoot ; - Imp Neg Pl => "ن" + impRoot + "ید" ; - - VF pol tense person number => (mkCmnVF root1 root2 pol tense person number).s ; --- VF Neg tense person number => addN (mkCmnVF root1 root2 tense person number).s ; - Vvform (AgPes number person) => (mkvVform root2 number person).s - } - }; - - -mkVerb2 : (_: Str) -> Verb = \inf -> - let root1 = (tk 1 inf) ; - root2 = (tk 2 inf) ; - impRoot = mkimpRoot root2 ; - in { - s = table { - - Root1 => root1 ; - Root2 => root2 ; - Inf => inf ; - Imp Pos Sg => addBh impRoot ; - Imp Pos Pl => (addBh impRoot) + "ید" ; - Imp Neg Sg => "ن" + impRoot ; - Imp Neg Pl => "ن" + impRoot + "ید" ; - - VF pol tense person number => (mkCmnVF root1 root2 pol tense person number).s ; --- VF Neg tense person number => addN (mkCmnVF root1 root2 tense person number).s ; - Vvform (AgPes number person) => (mkvVform root2 number person).s - } - } ; - - mkHave : Verb = - - { - s = table { - - Root1 => "داشت" ; - Root2 => "دار" ; - Inf => "داشتن" ; - Imp Pos Sg => ["داشته باش"] ; - Imp Pos Pl => ["داشته باشید"]; - Imp Neg Sg => ["نداشته باش"] ; - Imp Neg Pl => ["نداشته باشید"] ; - - VF pol tense person number => (toHave pol tense number person).s ; --- VF Neg tense person number => addN (mkCmnVF root1 root2 tense person number).s ; - Vvform (AgPes Sg PPers1) => ["داشته باشم"] ; - Vvform (AgPes Sg PPers2) => ["داشته باشی"] ; - Vvform (AgPes Sg PPers3) => ["داشته باشد"] ; - Vvform (AgPes Pl PPers1) => ["داشته باشیم"] ; - Vvform (AgPes Pl PPers2) => ["داشته باشید"] ; - Vvform (AgPes Pl PPers3) => ["داشته باشند"] - } - } ; - - -mkCmnVF : Str -> Str -> Polarity -> VTense2 -> PPerson -> Number -> {s:Str}= \root1,root2,pol,t,p,n -> - {s = (mkCmnVF1 root1 root2 pol t p n).s ; - }; - - - mkCmnVF1 : Str -> Str -> Polarity -> VTense2 -> PPerson -> Number -> {s:Str}= \root1,root2,pol,t,p,n -> - {s = let khordh = root1 + "ه"; - nkhordh = (addN root1) + "ه" ; - mekhor = "می" ++ root2 ; - nmekhor = "نمی" ++ root2 ; - mekhord = "می" ++ root1 ; - nmekhord = "نمی" ++ root1 ; - mekhordh = "می" ++ khordh ; - nmekhordh = "نمی" ++ khordh ; - khah = "خواه" ; - nkhah = "نخواه" ; - mekhah = "می" ++ khah ; - nmekhah = "نمی" ++ khah ; - bvdh = "بوده" - in - case of { - => khordh ++ "ام" ; - => khordh ++ "ایم" ; - => khordh ++ "ای" ; - => khordh ++ "اید" ; - => khordh ++ "است" ; - => khordh ++ "اند" ; - - => mekhor + "م" ; - => mekhor + "یم" ; - => mekhor + "ی" ; - => mekhor + "ید" ; - => mekhor + "د" ; - => mekhor + "ند" ; - - - => khordh ++ "بودم" ; - => khordh ++ "بودیم" ; - => khordh ++ "بودی" ; - => khordh ++ "بودید" ; - => khordh ++ "بود" ; - => khordh ++ "بودند" ; - - => mekhord + "م" ; - => mekhord + "یم" ; - => mekhord + "ی"; - => mekhord + "ید" ; - => mekhord ; - => mekhord + "ند" ; - - => root1 + "م" ; - => root1 + "یم" ; - => root1 + "ی"; - => root1 + "ید" ; - => root1 ; - => root1 + "ند" ; - - {- - => mekhah + "م" ++ addBh root2 + "م" ; - => mekhah + "یم" ++ addBh root2 + "یم" ; - => mekhah + "ی" ++ addBh root2 + "ی" ; - => mekhah + "ید" ++ addBh root2 + "ید" ; - => mekhah + "د" ++ addBh root2 + "د" ; - => mekhah + "ند" ++ addBh root2 + "ند" ; - -} - => khah + "م" ++ root1 ; - => khah + "یم" ++ root1 ; - => khah + "ی" ++ root1 ; - => khah + "ید" ++ root1 ; - => khah + "د" ++ root1 ; - => khah + "ند" ++ root1 ; - - - => khordh ++ bvdh ++ "ام" ; - => khordh ++ bvdh ++ "ایم" ; - => khordh ++ bvdh ++ "ای" ; - => khordh ++ bvdh ++ "اید" ; - => khordh ++ bvdh ++ "است" ; - => khordh ++ bvdh ++ "اند" ; - - => mekhordh ++ "ام" ; - => mekhordh ++ "ایم" ; - => mekhordh ++ "ای" ; - => mekhordh ++ "اید" ; - => mekhordh ++ "است" ; - => mekhordh ++ "اند" ; - - -- negatives - - => addN khordh ++ "ام" ; - => addN khordh ++ "ایم" ; - => addN khordh ++ "ای" ; - => addN khordh ++ "اید" ; - => addN khordh ++ "است" ; - => addN khordh ++ "اند" ; - - - => nmekhor + "م" ; - => nmekhor + "یم" ; - => nmekhor + "ی" ; - => nmekhor + "ید" ; - => nmekhor + "د" ; - => nmekhor + "ند" ; - - => nkhordh ++ "بودم" ; - => nkhordh ++ "بودیم" ; - => nkhordh ++ "بودی" ; - => nkhordh ++ "بودید" ; - => nkhordh ++ "بود" ; - => nkhordh ++ "بودند" ; - - => nmekhord + "م" ; - => nmekhord + "یم" ; - => nmekhord + "ی"; - => nmekhord + "ید" ; - => nmekhord ; - => nmekhord + "ند" ; - - - => addN root1 + "م" ; - => addN root1 + "یم" ; - => addN root1 + "ی"; - => addN root1 + "ید" ; - => addN root1 ; - => addN root1 + "ند" ; - - {- - => nmekhah + "م" ++ addBh root2 + "م" ; - => nmekhah + "یم" ++ addBh root2 + "یم" ; - => nmekhah + "ی" ++ addBh root2 + "ی" ; - => nmekhah + "ید" ++ addBh root2 + "ید" ; - => nmekhah + "د" ++ addBh root2 + "د" ; - => nmekhah + "ند" ++ addBh root2 + "ند" ; - -} - => nkhah + "م" ++ root1 ; - => nkhah + "یم" ++ root1 ; - => nkhah + "ی" ++ root1 ; - => nkhah + "ید" ++ root1 ; - => nkhah + "د" ++ root1 ; - => nkhah + "ند" ++ root1 ; - - - => nkhordh ++ bvdh ++ "ام" ; - => nkhordh ++ bvdh ++ "ایم" ; - => nkhordh ++ bvdh ++ "ای" ; - => nkhordh ++ bvdh ++ "اید" ; - => nkhordh ++ bvdh ++ "است" ; - => nkhordh ++ bvdh ++ "اند" ; - - => nmekhordh ++ "ام" ; - => nmekhordh ++ "ایم" ; - => nmekhordh ++ "ای" ; - => nmekhordh ++ "اید" ; - => nmekhordh ++ "است" ; - => nmekhordh ++ "اند" - - - } - - } ; - - mkvVform : Str -> Number -> PPerson -> {s: Str} = \root2,n,p -> - {s = - case of { - => addBh root2 + "م" ; - => addBh root2 + "ی" ; - => addBh root2 + "د" ; - => addBh root2 + "یم" ; - => addBh root2 + "ید" ; - => addBh root2 + "ند" - } - }; - - mkimpRoot : Str -> Str ; - mkimpRoot root = - case root of { - st + "ی" => st ; - _ => root - }; - - -addBh : Str -> Str ; -addBh str = - case (take 1 str) of { - "ا" => "بی" + str ; - "آ" => "بیا" + (drop 1 str) ; - _ => "ب" + str - }; - - --------------------- - --Determiners - -------------------- - - makeDet : Str -> Number -> Bool -> {s: Str ; n : Number ; isNum : Bool ; fromPron : Bool} =\str,n,b -> { - s = str; - isNum = b; - fromPron = False ; - n = n - }; - makeQuant : Str -> Str -> {s : Number => Str ; a : AgrPes ; fromPron : Bool } = \sg,pl -> { - s = table {Sg => sg ; Pl => pl} ; - fromPron = False ; - a = agrPesP3 Sg - }; + makeQuant : Str -> Str -> {s : Number => Str ; a : Agr; fromPron : Bool } = \sg,pl -> { + s = table {Sg => sg ; Pl => pl} ; + fromPron = False ; + a = agrP3 Sg + }; --------------------------- -- Adjectives -------------------------- -mkAdj : Str -> Str -> Adjective = \adj,adv -> { - s = table { bEzafa => adj; - aEzafa => mkEzafa adj ; - enClic => mkEnclic adj - } ; - adv = adv - }; -} \ No newline at end of file + Adjective : Type = {s : Ezafa => Str ; adv : Str} ; + + mkAdj : Str -> Str -> Adjective = \adj,adv -> { + s = table { bEzafa => adj; + aEzafa => mkEzafa adj ; + enClic => mkEnclic adj + } ; + adv = adv + }; + +------------------------------------------------------------------ +-- Verbs +------------------------------------------------------------------ +param + VerbForm1 = VF Polarity VTense2 Agr + | Vvform Agr + | Imp Polarity Number + | Inf | Root1 | Root2 ; + VTense2 = PPresent2 PrAspect + | PPast2 PstAspect + | PFut2 FtAspect + | Infr_Past2 InfrAspect; + PrAspect = PrPerf | PrImperf ; + PstAspect = PstPerf | PstImperf | PstAorist ; + FtAspect = FtAorist ; -- just keep FtAorist + InfrAspect = InfrPerf | InfrImperf ; + +oper + Verb = {s : VerbForm1 => Str} ; + + mkVerb : (x1,x2 : Str) -> Verb = \inf,root2 -> + let root1 = tk 1 inf ; + impRoot = impRoot root2 + in { s = table { + Root1 => root1 ; + Root2 => root2 ; + Inf => inf ; + Imp Pos Sg => addBh impRoot ; + Imp Pos Pl => addBh impRoot + "ید" ; + Imp Neg Sg => "ن" + impRoot ; + Imp Neg Pl => "ن" + impRoot + "ید" ; + Vvform ag => mkvVform root2 ag ; + VF p t ag => mkCmnVF root1 root2 p t ag } + } ; + + -- Verbs that end in یدن, ادن or ودن + -- Also some verbs that don't: دانستن with stem دان + mkVerb1 : (_: Str) -> Verb = \inf -> mkVerb inf (tk 3 inf) ; + + -- Most verbs that end in C+تن or C+دن + mkVerb2 : (_: Str) -> Verb = \inf -> mkVerb inf (tk 2 inf) ; + + mkCmnVF : Str -> Str -> Polarity -> VTense2 -> Agr -> Str = \root1,root2,pol,t,ag -> + let khordh = root1 + "ه"; + nkhordh = addN khordh ; + mekhor = zwnj "می" root2 ; + nmekhor = zwnj "نمی" root2 ; + mekhord = zwnj "می" root1 ; + nmekhord = zwnj "نمی" root1 ; + mekhordh = zwnj "می" khordh ; + nmekhordh = zwnj "نمی" khordh ; + khah = "خواه" ; + nkhah = "نخواه" ; + -- mekhah = zwnj "می" khah ; + -- nmekhah = zwnj "نمی" khah ; + bvdh = "بوده" ; + impfSuff : Str -> Str = imperfectSuffix ag ; + impfSuffD : Str -> Str = imperfectSuffixD ag ; + perfSuff : Str -> Str = perfectSuffix ag ; + pluperfSuff : Str -> Str = pluperfectSuffix ag + in case of { + => impfSuffD mekhor ; + => perfSuff khordh ; + + => pluperfSuff khordh ; + => impfSuff mekhord ; + => impfSuff root1 ; + + => impfSuffD khah ++ root1; + + => khordh ++ perfSuff bvdh ; + => perfSuff khordh ; + + -- negatives + => impfSuffD nmekhor ; + => perfSuff nkhordh ; + + => pluperfSuff nkhordh ; + => impfSuff nmekhord ; + => impfSuff (addN root1) ; + + => impfSuffD nkhah ++ root1 ; + + => nkhordh ++ perfSuff bvdh ; + => perfSuff nmekhordh + + -- => perfSuffD mekhah ++ addBh (perfSuffD root2) ; + -- => perfSuffD nmekhah ++ addBh (perfSuffD root2) ; + } ; + + mkvVform : Str -> Agr -> Str = \root2,ag -> + addBh (imperfectSuffixD ag root2) ; + + impRoot : Str -> Str = \root -> case root of { + st + "ی" => st ; + _ => root + }; + +------------------- +-- making negatives +------------------- + addN : Str -> Str ; + addN str = + case str of { + "ا" + st => "نی" + str ; + "آ" + st => "نیا" + st ; + _ => "ن" + str } ; + + addBh : Str -> Str ; + addBh str = + case str of { + "ا" + st => "بی" + str ; + "آ" + st => "بیا" + st ; + _ => "ب" + str + }; + + -- TODO: is this needed anywhere? what does it do? /IL + addBh2 : Str -> Str ; -- should use drop instead but it gives linking error + addBh2 str1 = + case str1 of { + "می" + str => + case str of { + "ا" + st => Prelude.glue "بی" str ; + "آ" + st => Prelude.glue "بیا" st ; + _ => Prelude.glue "ب" str + }; + _ => "" -- ???? + }; + +------------------- +-- Common suffixes +------------------- + imperfectSuffix : Agr -> Str -> Str = \ag,s -> s + + case ag of { + Ag Sg P1 => "م" ; + Ag Sg P2 => "ی" ; + Ag Sg P3 => [] ; + Ag Pl P1 => "یم" ; + Ag Pl P2 => "ید" ; + Ag Pl P3 => "ند" } ; + + imperfectSuffixD : Agr -> Str -> Str = \ag,s -> + case ag of { + Ag Sg P3 => s + "د" ; + _ => imperfectSuffix ag s } ; + + perfectSuffix : Agr -> Str -> Str = \ag,s -> + case ag of { + Ag Sg P1 => zwnj s "ام" ; + Ag Sg P2 => zwnj s "ای" ; + Ag Sg P3 => s ++ "است" ; -- no ZWNJ + Ag Pl P1 => zwnj s "ایم" ; + Ag Pl P2 => zwnj s "اید" ; + Ag Pl P3 => zwnj s "اند" } ; + + pluperfectSuffix : Agr -> Str -> Str = \ag,s -> s ++ + case ag of { -- not suffix, just using consistent naming scheme :-P /IL + Ag Sg P1 => "بودم" ; + Ag Sg P2 => "بودی" ; + Ag Sg P3 => "بود" ; + Ag Pl P1 => "بودیم" ; + Ag Pl P2 => "بودید" ; + Ag Pl P3 => "بودند" } ; + +---------------------------------- +-- Irregular verbs +---------------------------------- + + haveVerb : Verb = {s = table { + Root1 => "داشت" ; + Root2 => "دار" ; + Inf => "داشتن" ; + Imp Pos Sg => "بدار" ; + Imp Pos Pl => "بدارید" ; + Imp Neg Sg => "ندار" ; + Imp Neg Pl => "ندارید" ; + Vvform agr => mkvVform "دار" agr ; + VF pol tense agr => toHave pol tense agr + } + } ; + + toHave : Polarity -> VTense2 -> Agr -> Str = \pol,t,ag -> + let dar = "دار" ; + ndar = addN dar ; + dasht = "داشت" + in case of { + => imperfectSuffixD ag dar ; + => imperfectSuffixD ag ndar ; + _ => mkCmnVF dasht dar pol t ag + } ; + + +} diff --git a/src/persian/NounPes.gf b/src/persian/NounPes.gf index 90a7e2b5..ebaed2e6 100644 --- a/src/persian/NounPes.gf +++ b/src/persian/NounPes.gf @@ -10,11 +10,11 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { => cn.s ! aEzafa ! Sg ++ det.s ; -- noun modified by a number is invariably singular => det.s ++ cn.s ! bEzafa ! Sg }; - a = agrPesP3 det.n ; + a = agrP3 det.n ; animacy = cn.animacy } ; - UsePN pn = {s = \\_ => pn.s ; a = agrPesP3 Sg ; animacy = pn.animacy } ; + UsePN pn = {s = \\_ => pn.s ; a = agrP3 Sg ; animacy = pn.animacy } ; UsePron p = {s = \\_ => p.s ; a = p.a ; animacy = Animate} ; PredetNP pred np = np ** { @@ -49,7 +49,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { DetNP det = { s = \\_ => det.s ; ---- case - a = agrPesP3 det.n ; + a = agrP3 det.n ; animacy = Inanimate } ; @@ -70,15 +70,15 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { OrdSuperl a = {s = a.s ! bEzafa ++ taryn; n = Sg ; isNum=False} ; -- check the form of adjective - DefArt = {s = \\_ => [] ; a = defaultAgrPes ; fromPron = False} ; - IndefArt = {s = table { Sg => IndefArticle ; Pl => []} ; a =defaultAgrPes ; fromPron = False} ; + DefArt = {s = \\_ => [] ; a = defaultAgr ; fromPron = False} ; + IndefArt = {s = table { Sg => IndefArticle ; Pl => []} ; a =defaultAgr ; fromPron = False} ; MassNP cn = {s =\\c => case c of { NPC bEzafa => cn.s ! bEzafa ! Sg ; NPC aEzafa => cn.s ! aEzafa ! Sg ; NPC enClic => cn.s ! enClic ! Sg }; - a = agrPesP3 Sg ; + a = agrP3 Sg ; animacy = cn.animacy } ; @@ -116,7 +116,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { } ; RelCN cn rs = cn ** { - s = \\ez,n => cn.s ! enClic ! n ++ rs.s ! agrPesP3 n ; + s = \\ez,n => cn.s ! enClic ! n ++ rs.s ! agrP3 n ; } ; AdvCN cn ad = cn ** {s = \\ez,n => cn.s ! aEzafa ! n ++ ad.s} ; diff --git a/src/persian/ParadigmsPes.gf b/src/persian/ParadigmsPes.gf index 0d906778..3a14ce67 100644 --- a/src/persian/ParadigmsPes.gf +++ b/src/persian/ParadigmsPes.gf @@ -5,7 +5,8 @@ resource ParadigmsPes = open Predef, Prelude, - MorphoPes, + ResPes, + (M=MorphoPes), CatPes in { @@ -26,22 +27,22 @@ oper mkN01 : (sg : Str) -> Animacy -> Noun ; -- Takes singular form and animacy, forms plural with ها mkN01 sg ani = let pl = zwnj sg "ها" ; -- Using zero-width non-joiner, defined in ResPes - in MorphoPes.mkN sg pl ani ; + in M.mkN sg pl ani ; mkN02 : (sg : Str) -> Animacy -> Noun ; -- Takes singular form and animacy, pattern matches singular and forms plural with either گان, یان or ان mkN02 str ani = case last str of { - "ه" => MorphoPes.mkN str (init str + "گان") ani ; - ("ا"|"و") => MorphoPes.mkN str (str + "یان") ani ; - _ => MorphoPes.mkN str (str + "ان") ani + "ه" => M.mkN str (init str + "گان") ani ; + ("ا"|"و") => M.mkN str (str + "یان") ani ; + _ => M.mkN str (str + "ان") ani }; mkN = overload { mkN : (sg : Str) -> N -- Takes singular form, returns an inanimate noun with ها as the plural form = \sg -> mkN01 sg inanimate ; mkN : (sg,pl : Str) -> N -- Takes singular and plural form, returns an inanimate noun - = \sg,pl -> MorphoPes.mkN sg pl inanimate ; + = \sg,pl -> M.mkN sg pl inanimate ; mkN : (sg,pl : Str) -> Animacy -> N -- Worst-case constructor: takes singular and plural forms and animacy - = \sg,pl,ani -> MorphoPes.mkN sg pl ani + = \sg,pl,ani -> M.mkN sg pl ani } ; {- @@ -68,8 +69,8 @@ oper -- Personal Pronouns - personalPN : Str -> Number -> PPerson -> Pron - = \str,nn,p -> lin Pron {s = str ; a = AgPes nn p ; ps = str}; + personalPN : Str -> Number -> Person -> Pron + = \str,nn,p -> lin Pron {s = str ; a = Ag nn p ; ps = str}; {- -- Demonstration Pronouns demoPN : Str -> Str -> Str -> Quant = @@ -105,7 +106,7 @@ oper mkV : Str -> Str -> V = \s1, s2 -> mkVerb s1 s2 ** {lock_V = <>} ; -- mkVerb takes both the Infinitive and the present root(root2) and is applied for iregular verbs - haveVerb : V = mkHave ; + haveVerb : V = M.haveVerb ; mkV_1 : Str -> V = \s -> mkVerb1 s ** {lock_V = <>} ; @@ -156,48 +157,30 @@ oper -} mkQuant = overload { -- mkQuant : Pron -> Quant = \p -> {s = \\_,_,c => p.s!c ;a = p.a ; lock_Quant = <>}; - mkQuant : Str -> Str -> Quant = \sg,pl -> makeQuant sg pl; + mkQuant : Str -> Str -> Quant + = \sg,pl -> makeQuant sg pl; } ; -{- + --2 Conjunctions - mkConj : overload { - mkConj : Str -> Conj ; -- and (plural agreement) - mkConj : Str -> Number -> Conj ; -- or (agrement number given as argument) - mkConj : Str -> Str -> Conj ; -- both ... and (plural) - mkConj : Str -> Str -> Number -> Conj ; -- either ... or (agrement number given as argument) - } ; - mkConj = overload { - mkConj : Str -> Conj = \y -> mk2Conj [] y plural ; - mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ; - mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y plural ; - mkConj : Str -> Str -> Number -> Conj = mk2Conj ; + mkConj = overload { + mkConj : Str -> Conj -- and (plural agreement) + = \y -> mk2Conj [] y plural ; + mkConj : Str -> Number -> Conj -- or (agrement number given as argument) + = \y,n -> mk2Conj [] y n ; + mkConj : Str -> Str -> Conj -- both ... and (plural) + = \x,y -> mk2Conj x y plural ; + mkConj : Str -> Str -> Number -> Conj -- either ... or (agrement number given as argument) + = mk2Conj } ; + + +--. + + + mk2Conj : Str -> Str -> Number -> Conj = \x,y,n -> - lin Conj (sd2 x y ** {n = n}) ; - --- mkV0 : V -> V0 ; --- mkVS : V -> VS ; --- mkV2S : V -> Prep -> V2S ; - mkVV : V -> VV = \v -> lin VV (v ** {isAux = False}); + lin Conj (sd2 x y ** {n = n}) ; --- mkV2V : V -> Prep -> Prep -> V2V ; --- mkVA : V -> VA ; --- mkV2A : V -> Prep -> V2A ; --- mkVQ : V -> VQ ; --- mkV2Q : V -> Prep -> V2Q ; --- --- mkAS : A -> AS ; --- mkA2S : A -> Prep -> A2S ; --- mkAV : A -> AV ; --- mkA2V : A -> Prep -> A2V ; --- mkA2V a p = a ** {c2 = p.s } ; --- ----- Notice: Categories $V0, AS, A2S, AV, A2V$ are just $A$. ----- $V0$ is just $V$; the second argument is treated as adverb. --- --- V0 : Type ; --- AS, A2S, AV, A2V : Type ; ---} } diff --git a/src/persian/PhrasePes.gf b/src/persian/PhrasePes.gf index aee807d4..d372acee 100644 --- a/src/persian/PhrasePes.gf +++ b/src/persian/PhrasePes.gf @@ -12,7 +12,7 @@ concrete PhrasePes of Phrase = CatPes ** open Prelude, ResPes in { UttIP ip = {s = ip.s } ; --- Acc also UttIAdv iadv = iadv ; UttNP np = {s = np.s ! NPC bEzafa} ; - UttVP vp = {s = vp.ad ++ vp.comp ! (AgPes Sg PPers3 ) ++ vp.obj.s ++ vp.inf ++ vp.vComp ! (AgPes Sg PPers3) ++ vp.embComp} ; + UttVP vp = {s = vp.ad ++ vp.comp ! Ag Sg P3 ++ vp.obj.s ++ vp.inf ++ vp.vComp ! Ag Sg P3 ++ vp.embComp} ; UttAdv adv = {s = adv.s } ; UttCN cn = {s = cn.s ! bEzafa ! Sg }; UttCard n = n ; diff --git a/src/persian/QuestionPes.gf b/src/persian/QuestionPes.gf index b9b1a2e6..1e3bd870 100644 --- a/src/persian/QuestionPes.gf +++ b/src/persian/QuestionPes.gf @@ -5,36 +5,36 @@ concrete QuestionPes of Question = CatPes ** open ResPes, Prelude in { lin QuestCl cl = { - s = \\t,p,qf => case qf of { + s = \\t,p,qf => case qf of { QDir => cl.s ! t ! p ! OQuest; QIndir => cl.s ! t! p ! ODir } - }; + }; - QuestVP qp vp = - let cl = mkSClause ("") (AgPes qp.n PPers3) vp; + QuestVP qp vp = + let cl = mkSClause ("") (Ag qp.n P3) vp; -- qp1 = qp.s; -- qp2 = qp.s ! Obl ++ "nE" in { s = \\t,p,o => qp.s ++ cl.s ! t ! p ! ODir } ; -- _ => qp1 ++ cl.s ! t ! p ! ODir -- } - + QuestSlash ip slash = { s = \\t,p,o => slash.subj ++ slash.c2.s ++ ip.s ++ slash.c2.ra ++ slash.vp ! t ! p ! ODir; -- order of whome and john needs to be changed - -- AR 18/9/2017 now changed by making ClSlash discontinuous + -- AR 18/9/2017 now changed by making ClSlash discontinuous }; - QuestIAdv iadv cl = { + QuestIAdv iadv cl = { s = \\t,p,_ => iadv.s ++ cl.s ! t ! p ! ODir; }; - QuestIComp icomp np = - let cl = mkSClause (np.s ! NPC bEzafa ++ icomp.s) np.a (predAux auxBe); + QuestIComp icomp np = + let cl = mkSClause (np.s ! NPC bEzafa ++ icomp.s) np.a (predAux auxBe); in { - s = \\t,p,qf => case qf of { + s = \\t,p,qf => case qf of { QDir => cl.s ! t ! p ! ODir; QIndir => cl.s ! t! p ! ODir } @@ -46,16 +46,16 @@ concrete QuestionPes of Question = CatPes ** open ResPes, Prelude in { s = ip.s ++ adv.s ; n = ip.n; } ; - + IdetCN idet cn = { - s = case idet.isNum of {False => idet.s ++ cn.s ! bEzafa ! idet.n ; True => idet.s ++ cn.s ! bEzafa ! Sg} ; + s = case idet.isNum of {False => idet.s ++ cn.s ! bEzafa ! idet.n ; True => idet.s ++ cn.s ! bEzafa ! Sg} ; n = idet.n; } ; IdetIP idet = idet ; IdetQuant iqant num = { - s = iqant.s ++ num.s ; + s = iqant.s ++ num.s ; n = num.n ; isNum = True } ; @@ -63,6 +63,6 @@ concrete QuestionPes of Question = CatPes ** open ResPes, Prelude in { CompIAdv a = a ; CompIP p = ss p.s ; AdvIAdv i a = {s = a.s ++ i.s } ; - + } diff --git a/src/persian/ResPes.gf b/src/persian/ResPes.gf index b2f6078c..d5201ab9 100644 --- a/src/persian/ResPes.gf +++ b/src/persian/ResPes.gf @@ -1,237 +1,164 @@ --# -path=.:../abstract:../common:../../prelude -- ---1 Pnbu auxiliary operations. +--1 Persian auxiliary operations. -- -- This module contains operations that are needed to make the --- resource syntax work. +-- resource syntax work. -resource ResPes = ParamX ** open Prelude,Predef in { +resource ResPes = MorphoPes ** open Prelude,Predef in { flags optimize=all ; coding = utf8; param - Order = ODir | OQuest ; - - Animacy = Animate | Inanimate ; PMood = Del | Imper | PCond ; - PPerson = PPers1 - | PPers2 - | PPers3; - - VerbForm1 = VF Polarity VTense2 PPerson Number - | Vvform AgrPes - | Imp Polarity Number - | Inf - | Root1 | Root2 ; - VTense2 = PPresent2 PrAspect | PPast2 PstAspect | PFut2 FtAspect| Infr_Past2 InfrAspect; - PrAspect = PrPerf | PrImperf ; - PstAspect = PstPerf | PstImperf | PstAorist ; - FtAspect = FtAorist ; -- just keep FtAorist - InfrAspect = InfrPerf | InfrImperf ; - - AgrPes = AgPes Number PPerson; - Ezafa = bEzafa | aEzafa | enClic; + NPCase = NPC Ezafa ; CardOrd = NCard | NOrd ; - RAgr = RNoAg | RAg AgrPes ; + RAgr = RNoAg | RAg Agr ; -- RCase = RC Number Case ; - param - CPolarity = - CPos - |CNeg Bool; -- contracted or not - + + CPolarity = CPos + | CNeg Bool; -- contracted or not + oper - Noun = {s : Ezafa => Number => Str ; animacy : Animacy ; definitness : Bool } ; - - Verb = {s : VerbForm1 => Str} ; - Compl : Type = {s : Str ; ra : Str ; c : VType} ; - - Adjective = {s:Ezafa => Str ; adv : Str} ; - - NP : Type = {s : NPCase => Str ; a : AgrPes ; animacy : Animacy } ; - Determiner = {s : Str ; n :Number ; isNum : Bool ; fromPron : Bool} ; - VPHSlash = VPH ** {c2 : Compl} ; - + NP : Type = {s : NPCase => Str ; a : Agr ; animacy : Animacy } ; + VPHSlash : Type = VPH ** {c2 : Compl} ; + oper contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of { - Pos => CPos ; - Neg => CNeg b + Pos => CPos ; + Neg => CNeg b } ; - - -- Zero-width non-joiner, used for certain morphemes - -- See https://en.wikipedia.org/wiki/Persian_alphabet#Word_boundaries - ZWNJ : Str = "‌" ; - zwnj : Str -> Str -> Str = \s1,s2 -> s1 + ZWNJ + s2 ; + ----------------------- --- Verb Phrase ----------------------- - -oper - + +oper + VPH : Type = { - s : VPHForm => {inf : Str} ; - obj : {s : Str ; a : AgrPes} ; + s : VPHForm => Str ; -- {inf : Str} ; + obj : {s : Str ; a : Agr} ; subj : VType ; - comp : AgrPes => Str; - vComp : AgrPes => Str; + comp : Agr => Str; + vComp : Agr => Str; inf : Str; ad : Str; embComp : Str ; wish : Bool ; } ; - param - - VPHForm = - VPTense Polarity VPPTense AgrPes -- 9 * 12 + param + + VPHForm = + VPTense Polarity VPPTense Agr -- 9 * 12 -- | VPReq | VPImp Polarity Number -- | VPReqFut - | VVForm AgrPes + | VVForm Agr | VPStem1 | VPStem2 ; - - VPHTense = + + VPHTense = VPres -- impf hum nahim "I گْ" | VPast -- impf Ta nahim "I weنت" | VFut -- fut na/nahim "I سهلل گْ" | VPerfPres -- perf hum na/nahim "I هوe گْنe" - | VPerfPast -- perf Ta na/nahim "I هد گْنe" + | VPerfPast -- perf Ta na/nahim "I هد گْنe" | VPerfFut | VCondSimul | VCondAnter -- subj na "I می گْ" | VVVForm -- AR 21/3/2018 for mustCl after Nasrin | VRoot1 -- AR 22/3/2018 for mustCl past after Nasrin ; - + VType = VIntrans | VTrans | VTransPost ; - - VPPTense = - VPPres Anteriority - |VPPast Anteriority + + VPPTense = + VPPres Anteriority + |VPPast Anteriority |VPFutr Anteriority |VPCond Anteriority ; oper ---s (Vvform (AgPes Sg PPers1)) : بخوانم +--s (Vvform (Ag Sg P1)) : بخوانم predV : Verb -> VPH = \verb -> { - s = \\vh => - case vh of { - VPTense pol (VPPres Simul) (AgPes n p) => { inf = verb.s ! VF pol (PPresent2 PrImperf) p n } ; - VPTense pol (VPPres Anter) (AgPes n p) => { inf = verb.s ! VF pol (PPresent2 PrPerf) p n } ; - VPTense pol (VPPast Simul) (AgPes n p) => { inf =verb.s ! VF pol (PPast2 PstAorist) p n } ; - VPTense pol (VPPast Anter) (AgPes n p) => { inf =verb.s ! VF pol (PPast2 PstPerf) p n } ; - VPTense pol (VPFutr Simul) (AgPes n p) => { inf = verb.s ! VF pol (PFut2 FtAorist) p n } ; - VPTense pol (VPFutr Anter) (AgPes n p) => { inf = verb.s ! VF pol (PPresent2 PrPerf) p n } ; -- this is to be confirmed - VPTense pol (VPCond Simul) (AgPes n p) => { inf = verb.s ! VF pol (PPast2 PstImperf) p n } ; - VPTense pol (VPCond Anter) (AgPes n p) => { inf = verb.s ! VF pol (PPast2 PstImperf) p n } ; - VVForm (AgPes n p) => {inf = verb.s ! Vvform (AgPes n p)} ; - VPStem1 => { inf = verb.s ! Root1}; - VPStem2 => { inf = verb.s ! Root2} ; - VPImp pol n => { inf = verb.s ! Imp pol n} - - }; - obj = {s = [] ; a = defaultAgrPes} ; - subj = VIntrans ; - inf = verb.s ! Inf; - ad = []; - embComp = []; - wish = False ; - vComp = \\_ => [] ; - comp = \\_ => [] - } ; - - predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb -> - predV verb ** {c2 = {s = verb.c1 ; ra = [] ; c = VTrans} } ; + s = \\vh => + case vh of { + VPTense pol (VPPres Simul) agr => verb.s ! VF pol (PPresent2 PrImperf) agr ; + VPTense pol (VPPres Anter) agr => verb.s ! VF pol (PPresent2 PrPerf) agr ; + VPTense pol (VPPast Simul) agr => verb.s ! VF pol (PPast2 PstAorist) agr ; + VPTense pol (VPPast Anter) agr => verb.s ! VF pol (PPast2 PstPerf) agr ; + VPTense pol (VPFutr Simul) agr => verb.s ! VF pol (PFut2 FtAorist) agr ; + VPTense pol (VPFutr Anter) agr => verb.s ! VF pol (PPresent2 PrPerf) agr ; -- this is to be confirmed + VPTense pol (VPCond Simul) agr => verb.s ! VF pol (PPast2 PstImperf) agr ; + VPTense pol (VPCond Anter) agr => verb.s ! VF pol (PPast2 PstImperf) agr ; + VVForm agr => verb.s ! Vvform agr ; + VPStem1 => verb.s ! Root1 ; + VPStem2 => verb.s ! Root2 ; + VPImp pol n =>verb.s ! Imp pol n }; + obj = {s = [] ; a = defaultAgr} ; + subj = VIntrans ; + inf = verb.s ! Inf; + ad = []; + embComp = []; + wish = False ; + vComp = \\_ => [] ; + comp = \\_ => [] + } ; + + predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb -> + predV verb ** {c2 = {s = verb.c1 ; ra = [] ; c = VTrans} } ; ---------------------- -- Verb Phrase complimantation ------------------------ {- - insertObject : NP -> VPHSlash -> VPH = \np,vps -> { - s = vps.s ; + insertObject : NP -> VPHSlash -> VPH = \np,vps -> vps ** { -- obj = {s = variants { vps.obj.s ++ np.s ++ vps.c2.s ; vps.obj.s ++ np.s } ; a = np.a} ; obj = {s = case vps.c2.s of { "را" => np.s ++ vps.c2.s ++ vps.obj.s; - _ => vps.c2.s ++ np.s ++ vps.obj.s - }; - a = np.a} ; + _ => vps.c2.s ++ np.s ++ vps.obj.s + }; + a = np.a} ; subj = vps.c2.c ; - inf = vps.inf; - ad = vps.ad; - embComp = vps.embComp; - -- wish = vps.wish ; - comp = vps.comp } ; --} - insertObjc : (AgrPes => Str) -> VPHSlash -> VPHSlash = \obj,vp -> +-} + insertObjc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp -> insertObj obj vp ** {c2 = vp.c2} ; - insertVVc : (AgrPes => Str) -> VPHSlash -> VPHSlash = \obj,vp -> + insertVVc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp -> insertVV obj vp ** {c2 = vp.c2} ; - + {- - insertSubj : PPerson -> Str -> Str = \p,s -> + insertSubj : Person -> Str -> Str = \p,s -> case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"}; - -} - insertObj : (AgrPes => Str) -> VPH -> VPH = \obj1,vp -> { - s = vp.s ; - obj = vp.obj ; - subj = vp.subj ; - inf = vp.inf; - ad = vp.ad; - embComp = vp.embComp; - wish = vp.wish ; - vComp = vp.vComp ; - comp = \\a => vp.comp ! a ++ obj1 ! a - } ; - - insertVV : (AgrPes => Str) -> VPH -> VPH = \obj1,vp -> { - s = vp.s ; --- obj = vp.obj ; - obj = vp.obj ; - subj = vp.subj ; - inf = vp.inf; - ad = vp.ad; - embComp = vp.embComp; - wish = True ; - vComp = \\a => vp.comp ! a ++ obj1 ! a ; - comp = vp.comp - } ; - - insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> { - s = vp.s; - obj = vp.obj ; - subj = vp.subj ; - inf = vp.inf; - ad = vp.ad; - embComp = vp.embComp ++ obj1; - wish = vp.wish ; - vComp = vp.vComp ; - comp = \\a => vp.comp ! a -- ++ obj1 - - } ; - insertObj3 : (Str) -> VPH -> VPH = \obj1,vp -> { - s = vp.s; - obj = {s = obj1 ++ vp.obj.s ; a = vp.obj.a }; - subj = vp.subj ; - inf = vp.inf; - ad = vp.ad; - embComp = vp.embComp; - wish = vp.wish ; - vComp = vp.vComp ; - comp = vp.comp - - } ; - - - insertObjc2 : Str -> VPHSlash -> VPHSlash = \obj,vp -> + -} + insertObj : (Agr => Str) -> VPH -> VPH = \obj1,vp -> vp ** { + comp = \\a => vp.comp ! a ++ obj1 ! a + } ; + + insertVV : (Agr => Str) -> VPH -> VPH = \obj1,vp -> vp ** { + wish = True ; + vComp = \\a => vp.comp ! a ++ obj1 ! a ; + } ; + + insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> vp ** { + embComp = vp.embComp ++ obj1; + } ; + + insertObj3 : (Str) -> VPH -> VPH = \obj1,vp -> vp ** { + obj = {s = obj1 ++ vp.obj.s ; a = vp.obj.a }; + } ; + + + insertObjc2 : Str -> VPHSlash -> VPHSlash = \obj,vp -> insertObj2 obj vp ** {c2 = vp.c2} ; - insertObjc3 : Str -> VPHSlash -> VPHSlash = \obj,vp -> + insertObjc3 : Str -> VPHSlash -> VPHSlash = \obj,vp -> insertObj3 obj vp ** {c2 = vp.c2} ; {- infVP : Bool -> VPH -> Agr -> Str = \isAux,vp,a -> @@ -239,213 +166,120 @@ oper -} ---- AR 14/9/2017 trying to fix isAux = True case by inserting conjThat ----- but don't know yet how False should be affect - infVV : Bool -> VPH -> {s : AgrPes => Str} = \isAux,vp -> - {s = \\agr => case agr of { - AgPes n p => case isAux of { - True => conjThat ++ (vp.ad ++ vp.comp ! (toAgr n p)) ++ (vp.s ! VVForm (AgPes n p)).inf ; - False => (vp.ad ++ vp.comp ! (toAgr n p)) ++ (vp.s ! VVForm (AgPes n p)).inf - } - } - } ; - - insertObjPre : (AgrPes => Str) -> VPHSlash -> VPH = \obj,vp -> { - s = vp.s ; - obj = vp.obj ; - inf = vp.inf ; - subj = vp.subj ; - ad = vp.ad ; - embComp = vp.embComp; - wish = vp.wish ; - vComp = vp.vComp ; +---- but don't know yet how False should be affect + infVV : Bool -> VPH -> {s : Agr => Str} = \isAux,vp -> { + s = \\agr => case isAux of { + True => conjThat ++ vp.ad ++ vp.comp ! agr ++ vp.s ! VVForm agr ; + False => vp.ad ++ vp.comp ! agr ++ vp.s ! VVForm agr } + } ; + + insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> vp ** { -- comp = \\a => case vp.c2.s of {"را" => obj ! a ++ vp.c2.s ++ vp.comp ! a ; _ => vp.c2.s ++ obj ! a ++ vp.comp ! a} -- gives linking error - comp = \\a => vp.c2.s ++ obj ! a ++ vp.c2.ra ++ vp.comp ! a + comp = \\a => vp.c2.s ++ obj ! a ++ vp.c2.ra ++ vp.comp ! a } ; - insertAdV : Str -> VPH -> VPH = \ad,vp -> { - s = vp.s ; - obj = vp.obj ; - inf = vp.inf ; - subj = vp.subj; - ad = vp.ad ++ ad ; - embComp = vp.embComp; - wish = vp.wish ; - vComp = vp.vComp ; - comp = vp.comp + insertAdV : Str -> VPH -> VPH = \ad,vp -> vp ** { + ad = vp.ad ++ ad ; } ; - + conjThat : Str = "که" ; {- checkPron : NP -> Str -> Str = \np,str -> case (np.isPron) of { True => np.s ! NPC Obl; False => np.s ! NPC Obl ++ str} ; - - insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> { - s = vp.s ; - obj = vp.obj ; - inf = vp.inf ; - subj = vp.subj; - ad = vp.ad; + + insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> vp ** { embComp = vp.embComp ++ emb; - wish = vp.wish ; - comp = vp.comp } ; - - insertTrans : VPH -> VType -> VPH = \vp,vtype -> { - s = vp.s ; - obj = vp.obj ; - inf = vp.inf ; + + insertTrans : VPH -> VType -> VPH = \vp,vtype -> vp ** { subj = case vtype of {VIntrans => VTransPost ; VTrans => VTrans ; _ => vtype} ; -- still some problem not working properly - ad = vp.ad; - embComp = vp.embComp ; - wish = vp.wish ; - comp = vp.comp } ; -} --------------------------- --- Clauses --------------------------- -Clause : Type = {s : VPHTense => Polarity => Order => Str} ; -SlClause : Type = {quest : Order => Str ; subj : Str ; vp : VPHTense => Polarity => Order => Str} ; + Clause : Type = {s : VPHTense => Polarity => Order => Str} ; + SlClause : Type = {quest : Order => Str ; subj : Str ; vp : VPHTense => Polarity => Order => Str} ; ---- AR 18/9/2017 intermediate SClause to preserve SOV in e.g. QuestionPes.QuestSlash -mkClause : NP -> VPH -> Clause = \np,vp -> - let cls = mkSlClause np vp - in {s = \\vt,b,ord => cls.quest ! ord ++ cls.subj ++ cls.vp ! vt ! b ! ord} ; - -mkSlClause : NP -> VPH -> SlClause = \np,vp -> { + clTable : VPH -> (Agr => VPHTense => Polarity => Str) = \vp -> + \\agr,vt,b => case of { + => vp.s ! VPTense Pos (VPPres Simul) agr ; + => vp.s ! VPTense Neg (VPPres Simul) agr ; + => vp.s ! VPTense Pos (VPPres Anter) agr ; + => vp.s ! VPTense Neg (VPPres Anter) agr ; + => vp.s ! VPTense Pos (VPPast Simul) agr ; + => vp.s ! VPTense Neg (VPPast Simul) agr ; + => vp.s ! VPTense Pos (VPPast Anter) agr ; + => case vp.wish of { + True => vp.s ! VPTense Pos (VPPres Simul) agr ; + False => vp.s ! VPTense Pos (VPFutr Simul) agr }; + => case vp.wish of { + True => vp.s ! VPTense Pos (VPPres Anter) agr ; + False => vp.s ! VPTense Pos (VPFutr Anter) agr }; -- verb form need to be confirmed + => vp.s ! VPTense Neg (VPPast Anter) agr ; + => case vp.wish of { + True => vp.s ! VPTense Neg (VPPres Simul) agr ; + False => vp.s ! VPTense Neg (VPFutr Simul) agr }; + => case vp.wish of { + True => vp.s ! VPTense Neg (VPPres Anter) agr ; + False => vp.s ! VPTense Neg (VPFutr Anter) agr }; -- verb form need to be confirmed + => vp.s ! VPTense Pos (VPCond Simul) agr ; + => vp.s ! VPTense Pos (VPCond Anter) agr; -- verb form to be confirmed + => vp.s ! VPTense Neg (VPCond Simul) agr ; + => vp.s ! VPTense Neg (VPCond Anter) agr ; -- verb form to be confirmed + <_, VVVForm> => vp.s ! VVForm agr ; -- AR 21/3/2018 + <_, VRoot1> => vp.s ! VPStem1 {- ++ Predef.Bind ++ "ه" -} -- AR 22/3/2018 + }; + + mkClause : NP -> VPH -> Clause = \np,vp -> + let cls = mkSlClause np vp + in {s = \\vt,b,ord => cls.quest ! ord ++ cls.subj ++ cls.vp ! vt ! b ! ord} ; + + mkSlClause : NP -> VPH -> SlClause = \np,vp -> { quest = table { ODir => []; - OQuest => "آیا" } ; - + OQuest => "آیا" } ; subj = np.s ! NPC bEzafa ; vp = \\vt,b,ord => - let - agr = np.a ; - n = (fromAgr agr).n; - p = (fromAgr agr).p; - vps = case of { - - => vp.s ! VPTense Pos (VPPres Simul) (AgPes n p) ; - => vp.s ! VPTense Neg (VPPres Simul) (AgPes n p) ; - => vp.s ! VPTense Pos (VPPres Anter) (AgPes n p) ; - => vp.s ! VPTense Neg (VPPres Anter) (AgPes n p) ; - => vp.s ! VPTense Pos (VPPast Simul) (AgPes n p) ; - => vp.s ! VPTense Neg (VPPast Simul) (AgPes n p) ; - => vp.s ! VPTense Pos (VPPast Anter) (AgPes n p) ; - => case vp.wish of - {True => vp.s ! VPTense Pos (VPPres Simul) (AgPes n p) ; - False => vp.s ! VPTense Pos (VPFutr Simul) (AgPes n p) }; - => case vp.wish of - {True => vp.s ! VPTense Pos (VPPres Anter) (AgPes n p) ; - False => vp.s ! VPTense Pos (VPFutr Anter) (AgPes n p) }; -- verb form need to be confirmed - => vp.s ! VPTense Neg (VPPast Anter) (AgPes n p) ; - => case vp.wish of - {True => vp.s ! VPTense Neg (VPPres Simul) (AgPes n p) ; - False => vp.s ! VPTense Neg (VPFutr Simul) (AgPes n p) }; - => case vp.wish of - {True => vp.s ! VPTense Neg (VPPres Anter) (AgPes n p) ; - False => vp.s ! VPTense Neg (VPFutr Anter) (AgPes n p) }; -- verb form need to be confirmed - - => vp.s ! VPTense Pos (VPCond Simul) (AgPes n p) ; - => vp.s ! VPTense Pos (VPCond Anter) (AgPes n p); -- verb form to be confirmed - - => vp.s ! VPTense Neg (VPCond Simul) (AgPes n p) ; - => vp.s ! VPTense Neg (VPCond Anter) (AgPes n p) ; -- verb form to be confirmed - - <_, VVVForm> => vp.s ! VVForm (AgPes n p) ; -- AR 21/3/2018 - <_, VRoot1> => vp.s ! VPStem1 {- ++ Predef.Bind ++ "ه" -} -- AR 22/3/2018 - }; - ---- VVForm (AgPes n p) => {inf = verb.s ! Vvform (AgPes n p)} ; - - - - - in - - vp.ad ++ vp.comp ! np.a ++ vp.obj.s ++ vps.inf ++ vp.vComp ! np.a ++ vp.embComp - -}; + let vps = clTable vp ! np.a ! vt ! b + in vp.ad ++ vp.comp ! np.a ++ vp.obj.s ++ vps ++ vp.vComp ! np.a ++ vp.embComp + }; --Clause : Type = {s : VPHTense => Polarity => Order => Str} ; -mkSClause : Str -> AgrPes -> VPH -> Clause = \subj,agr,vp -> { - s = \\vt,b,ord => - let - n = (fromAgr agr).n; - p = (fromAgr agr).p; - vps = case of { + mkSClause : Str -> Agr -> VPH -> Clause = \subj,agr,vp -> { + s = \\vt,b,ord => + let vps = clTable vp ! agr ! vt ! b ; + quest = case ord of { ODir => [] ; OQuest => "آیا" } + in quest ++ subj ++ vp.ad ++ vp.comp ! agr ++ vp.obj.s ++ vps ++ vp.vComp ! agr ++ vp.embComp + }; - => vp.s ! VPTense Pos (VPPres Simul) (AgPes n p) ; - => vp.s ! VPTense Neg (VPPres Simul) (AgPes n p) ; - => vp.s ! VPTense Pos (VPPres Anter) (AgPes n p) ; - => vp.s ! VPTense Neg (VPPres Anter) (AgPes n p) ; - => vp.s ! VPTense Pos (VPPast Simul) (AgPes n p) ; - => vp.s ! VPTense Neg (VPPast Simul) (AgPes n p) ; - => vp.s ! VPTense Pos (VPPast Anter) (AgPes n p) ; - => case vp.wish of - {True => vp.s ! VPTense Pos (VPPres Simul) (AgPes n p) ; - False => vp.s ! VPTense Pos (VPFutr Simul) (AgPes n p) }; - => case vp.wish of - {True => vp.s ! VPTense Pos (VPPres Anter) (AgPes n p) ; - False => vp.s ! VPTense Pos (VPFutr Anter) (AgPes n p) }; -- verb form need to be confirmed - => vp.s ! VPTense Pos (VPCond Simul) (AgPes n p) ; - => vp.s ! VPTense Pos (VPCond Anter) (AgPes n p); -- verb form to be confirmed - => vp.s ! VPTense Neg (VPPast Anter) (AgPes n p) ; - => case vp.wish of - {True => vp.s ! VPTense Neg (VPPres Simul) (AgPes n p) ; - False => vp.s ! VPTense Neg (VPFutr Simul) (AgPes n p) }; - => case vp.wish of - {True => vp.s ! VPTense Neg (VPPres Anter) (AgPes n p) ; - False => vp.s ! VPTense Neg (VPFutr Anter) (AgPes n p) }; -- verb form need to be confirmed - => vp.s ! VPTense Neg (VPCond Simul) (AgPes n p) ; - => vp.s ! VPTense Neg (VPCond Anter) (AgPes n p) ; -- verb form to be confirmed - <_, VVVForm> => vp.s ! VVForm (AgPes n p) ; -- AR 21/3/2018 - <_, VRoot1> => vp.s ! VPStem1 {- ++ Predef.Bind ++ "ه" -} -- AR 22/3/2018 - - }; - - - quest = - case ord of - { ODir => []; - OQuest => "آیا" }; - - - - in - - quest ++ subj ++ vp.ad ++ vp.comp ! agr ++ vp.obj.s ++ vps.inf ++ vp.vComp ! agr ++ vp.embComp - -}; - predAux : Aux -> VPH = \verb -> { - s = \\vh => - - case vh of { - VPTense pol (VPPres Simul) (AgPes n p) => { inf = verb.inf ! AX pol (AuxPresent PrImperf) p n } ; - VPTense pol (VPPres Anter) (AgPes n p) => { inf = verb.inf ! AX pol (AuxPresent PrPerf) p n } ; - VPTense pol (VPPast Simul) (AgPes n p) => { inf = verb.inf ! AX pol (AuxPast PstAorist) p n } ; - VPTense pol (VPPast Anter) (AgPes n p) => { inf = verb.inf ! AX pol (AuxPresent PrPerf) p n } ; - VPTense pol (VPFutr Simul) (AgPes n p) => { inf = verb.inf ! AX pol (AuxFut FtAorist) p n } ; - VPTense pol (VPFutr Anter) (AgPes n p) => { inf = verb.inf ! AX pol (AuxFut FtAorist) p n } ; -- this is to be confirmed - VPTense pol (VPCond Simul) (AgPes n p) => { inf = verb.inf ! AX pol (AuxFut FtAorist) p n } ; - VPTense pol (VPCond Anter) (AgPes n p) => { inf = verb.inf ! AX pol (AuxPast PstImperf) p n } ; - VVForm (AgPes n p) => {inf = ""} ; -- to be checked => {inf = verb.s ! Vvform (AgPes n p)} ; - VPStem1 => { inf = ""}; - VPStem2 => { inf = "بود"} ; - VPImp _ _ => { inf = ""} -- need to be confirmed --- _ => { inf = ""} + s = \\vh => case vh of { + VPTense pol (VPPres Simul) agr => verb.inf ! AX pol (AuxPresent PrImperf) agr ; + VPTense pol (VPPres Anter) agr => verb.inf ! AX pol (AuxPresent PrPerf) agr ; + VPTense pol (VPPast Simul) agr => verb.inf ! AX pol (AuxPast PstAorist) agr ; + VPTense pol (VPPast Anter) agr => verb.inf ! AX pol (AuxPresent PrPerf) agr ; + VPTense pol (VPFutr Simul) agr => verb.inf ! AX pol (AuxFut FtAorist) agr ; + VPTense pol (VPFutr Anter) agr => verb.inf ! AX pol (AuxFut FtAorist) agr ; -- this is to be confirmed + VPTense pol (VPCond Simul) agr => verb.inf ! AX pol (AuxFut FtAorist) agr ; + VPTense pol (VPCond Anter) agr => verb.inf ! AX pol (AuxPast PstImperf) agr ; + VVForm agr => []; -- to be checked => verb.s ! Vvform agr ; + VPStem1 => []; + VPStem2 => "بود" ; + VPImp _ _ => [] -- need to be confirmed +-- _ => [] }; - obj = {s = [] ; a = defaultAgrPes} ; - subj = VIntrans ; - inf = "بودن"; - ad = []; - embComp = []; - wish = False ; - vComp = \\_ => [] ; - comp = \\_ => [] - } ; - + obj = {s = [] ; a = defaultAgr} ; + subj = VIntrans ; + inf = "بودن"; + ad = []; + embComp = []; + wish = False ; + vComp = \\_ => [] ; + comp = \\_ => [] + } ; Aux = { inf : AuxForm => Str ; @@ -453,441 +287,105 @@ mkSClause : Str -> AgrPes -> VPH -> Clause = \subj,agr,vp -> { auxBe : Aux = { inf = table { + AX pol tense ag => mkAux pol tense ag + } ; + } ; - AX pol tense person number => (mkAux pol tense person number).s + -- TODO: find out how much overlap with beVerb in MorphoPes /IL + mkAux : Polarity -> AuxTense -> Agr -> Str = \pol,t,ag -> + let bodh = "بوده" ; + nbodh = "نبوده" ; + hast = "هست" ; + nhast = "نیست" ; + bod = "بود" ; + khah = "خواه" ; + nbod = "نبود" ; + nkhah = "نخواه" ; + impfSuff : Str -> Str = imperfectSuffix ag ; + impfSuffD : Str -> Str = imperfectSuffixD ag ; + perfSuff : Str -> Str = perfectSuffix ag + in case of { + => "است" ; + => impfSuff hast ; + => perfSuff bodh ; + + => [] ; + => zwnj "می" (impfSuff bod) ; + => impfSuff bod ; + + => impfSuffD khah ++ bod ; + + -- negatives + => impfSuff nhast ; + => perfSuff nbodh ; + + => [] ; + => zwnj "نمی" (impfSuff bod) ; + => impfSuff nbod ; + + => impfSuffD nkhah ++ bod } ; - } ; - - mkAux : Polarity -> AuxTense -> PPerson -> Number -> {s:Str}= \pol,t,p,n -> - {s = - let bodh = "بوده" ; - nbodh = "نبوده" ; - hast = "هست" ; - nhast = "نیست" ; - bod = "بود" ; - khah = "خواه" ; - mekhah = "می" ++ khah ; - bash = "باش" ; - nbod = "نبود" ; - nkhah = "نخواه" ; - nmekhah = "نمی" ++ khah ; - nbash = "نباش" - in - case of { - => bodh ++ "ام" ; - => bodh ++ "ایم" ; - => bodh ++ "ای" ; - => bodh ++ "اید" ; - => bodh ++ "است" ; - => bodh ++ "اند" ; - - => hast + "م" ; - => hast + "یم" ; - => hast + "ی" ; - => hast + "ید" ; - => "است" ; - => hast + "ند" ; - - - => ""; - => "" ; - => "" ; - => "" ; - => "" ; - => "" ; - - => "می" ++ bod + "م" ; - => "می" ++ bod + "یم" ; - => "می" ++ bod + "ی"; - => "می" ++ bod + "ید" ; - => "می" ++ bod ; - => "می" ++ bod + "ند" ; - - => bod + "م" ; - => bod + "یم" ; - => bod + "ی"; - => bod + "ید" ; - => bod ; - => bod + "ند" ; - - {- - => mekhah + "م" ++ bash + "م" ; - => mekhah + "یم" ++ bash + "یم" ; - => mekhah + "ی" ++ bash + "ی" ; - => mekhah + "ید" ++ bash + "ید" ; - => mekhah + "د" ++ bash + "د" ; - => mekhah + "ند" ++ bash + "ند" ; - -} - => khah + "م" ++ bod ; - => khah + "یم" ++ bod ; - => khah + "ی" ++ bod ; - => khah + "ید" ++ bod ; - => khah + "د" ++ bod ; - => khah + "ند" ++ bod ; - - -- nagatives - - => nbodh ++ "ام" ; - => nbodh ++ "ایم" ; - => nbodh ++ "ای" ; - => nbodh ++ "اید" ; - => nbodh ++ "است" ; - => nbodh ++ "اند" ; - - => nhast + "م" ; - => nhast + "یم" ; - => nhast + "ی" ; - => nhast + "ید" ; - => "نیست" ; - => nhast + "ند" ; - - - => ""; - => "" ; - => "" ; - => "" ; - => "" ; - => "" ; - - => "نمی" ++ bod + "م" ; - => "نمی" ++ bod + "یم" ; - => "نمی" ++ bod + "ی"; - => "نمی" ++ bod + "ید" ; - => "نمی" ++ bod ; - => "نمی" ++ bod + "ند" ; - - => nbod + "م" ; - => nbod + "یم" ; - => nbod + "ی"; - => nbod + "ید" ; - => nbod ; - => nbod + "ند" ; - - {- - => nmekhah + "م" ++ bash + "م" ; - => nmekhah + "یم" ++ bash + "یم" ; - => nmekhah + "ی" ++ bash + "ی" ; - => nmekhah + "ید" ++ bash + "ید" ; - => nmekhah + "د" ++ bash + "د" ; - => nmekhah + "ند" ++ bash + "ند" ; - -} - => nkhah + "م" ++ bod ; - => nkhah + "یم" ++ bod ; - => nkhah + "ی" ++ bod ; - => nkhah + "ید" ++ bod ; - => nkhah + "د" ++ bod ; - => nkhah + "ند" ++ bod - - - - {- - => khordh ++ bvdh ++ "ام" ; - => khordh ++ bvdh ++ "ایم" ; - => khordh ++ bvdh ++ "ای" ; - => khordh ++ bvdh ++ "اید" ; - => khordh ++ bvdh ++ "است" ; - => khordh ++ bvdh ++ "اند" ; - - => mekhordh ++ "ام" ; - => mekhordh ++ "ایم" ; - => mekhordh ++ "ای" ; - => mekhordh ++ "اید" ; - => mekhordh ++ "است" ; - => mekhordh ++ "اند" - - - -} - } - } ; - + param AuxTense = AuxPresent PrAspect | AuxPast PstAspect | AuxFut FtAspect ; - AuxForm = AX Polarity AuxTense PPerson Number ; - - + AuxForm = AX Polarity AuxTense Agr ; + + oper - toHave : Polarity -> VTense2 -> Number -> PPerson -> {s:Str} = \pol,t,n,p -> { - s = let dasht = "داشت"; - ndasht = "نداشت" ; - dashteh = "داشته"; - ndashteh = "نداشته" ; - dar = "دار" ; - ndar = "ندار" ; - khah = "خواه" ; - nkhah = "نخواه" ; - bvdh = "بوده" ; - in case of { - => dashteh ++ "ام" ; - => dashteh ++ "ایم" ; - => dashteh ++ "ای" ; - => dashteh ++ "اید" ; - => dashteh ++ "است" ; - => dashteh ++ "اند" ; - - => dar + "م" ; - => dar + "یم" ; - => dar + "ی" ; - => dar + "ید" ; - => dar + "د" ; - => dar + "ند" ; - - - => dashteh ++ "بودم" ; - => dashteh ++ "بودیم" ; - => dashteh ++ "بودی" ; - => dashteh ++ "بودید" ; - => dashteh ++ "بود" ; - => dashteh ++ "بودند" ; - - => dasht + "م" ; - => dasht + "یم" ; - => dasht + "ی"; - => dasht + "ید" ; - => dasht ; - => dasht + "ند" ; - - => dasht + "م" ; - => dasht + "یم" ; - => dasht + "ی"; - => dasht + "ید" ; - => dasht ; - => dasht + "ند" ; - - - => khah + "م" ++ dasht ; - => khah + "یم" ++ dasht ; - => khah + "ی" ++ dasht ; - => khah + "ید" ++ dasht ; - => khah + "د" ++ dasht ; - => khah + "ند" ++ dasht ; - - - => dashteh ++ bvdh ++ "ام" ; - => dashteh ++ bvdh ++ "ایم" ; - => dashteh ++ bvdh ++ "ای" ; - => dashteh ++ bvdh ++ "اید" ; - => dashteh ++ bvdh ++ "است" ; - => dashteh ++ bvdh ++ "اند" ; - - => dashteh ++ "ام" ; - => dashteh ++ "ایم" ; - => dashteh ++ "ای" ; - => dashteh ++ "اید" ; - => dashteh ++ "است" ; - => dashteh ++ "اند" ; - - -- negatives - - => ndashteh ++ "ام" ; - => ndashteh ++ "ایم" ; - => ndashteh ++ "ای" ; - => ndashteh ++ "اید" ; - => ndashteh ++ "است" ; - => ndashteh ++ "اند" ; - - => ndar + "م" ; - => ndar + "یم" ; - => ndar + "ی" ; - => ndar + "ید" ; - => ndar + "د" ; - => ndar + "ند" ; - - - => ndashteh ++ "بودم" ; - => ndashteh ++ "بودیم" ; - => ndashteh ++ "بودی" ; - => ndashteh ++ "بودید" ; - => ndashteh ++ "بود" ; - => ndashteh ++ "بودند" ; - - => ndasht + "م" ; - => ndasht + "یم" ; - => ndasht + "ی"; - => ndasht + "ید" ; - => ndasht ; - => ndasht + "ند" ; - - => ndasht + "م" ; - => ndasht + "یم" ; - => ndasht + "ی"; - => ndasht + "ید" ; - => ndasht ; - => ndasht + "ند" ; - - - => nkhah + "م" ++ dasht ; - => nkhah + "یم" ++ dasht ; - => nkhah + "ی" ++ dasht ; - => nkhah + "ید" ++ dasht ; - => nkhah + "د" ++ dasht ; - => nkhah + "ند" ++ dasht ; - - - => ndashteh ++ bvdh ++ "ام" ; - => ndashteh ++ bvdh ++ "ایم" ; - => ndashteh ++ bvdh ++ "ای" ; - => ndashteh ++ bvdh ++ "اید" ; - => ndashteh ++ bvdh ++ "است" ; - => ndashteh ++ bvdh ++ "اند" ; - - => ndashteh ++ "ام" ; - => ndashteh ++ "ایم" ; - => ndashteh ++ "ای" ; - => ndashteh ++ "اید" ; - => ndashteh ++ "است" ; - => ndashteh ++ "اند" - - - }; - - } ; - - predProg : VPH -> VPH = \verb -> { - s = \\vh => - case vh of { - VPTense pol (VPPres Simul) (AgPes n p) => { inf = (toHave Pos (PPresent2 PrImperf) n p).s ++ (verb.s ! VPTense pol (VPPres Simul) (AgPes n p)).inf } ; - VPTense pol (VPPres Anter) (AgPes n p) => { inf = (verb.s ! VPTense pol (VPPres Anter) (AgPes n p)).inf } ; - VPTense pol (VPPast Simul) (AgPes n p) => { inf = (toHave Pos (PPast2 PstAorist) n p).s ++ (verb.s ! VPTense pol (VPCond Simul) (AgPes n p)).inf } ; - VPTense pol (VPPast Anter) (AgPes n p) => { inf = (verb.s ! VPTense pol (VPPast Anter) (AgPes n p)).inf } ; - VPTense pol (VPFutr Simul) (AgPes n p) => { inf = (verb.s ! VPTense pol (VPFutr Simul) (AgPes n p)).inf } ; - VPTense pol (VPFutr Anter) (AgPes n p) => { inf = (verb.s ! VPTense pol (VPFutr Anter) (AgPes n p)).inf } ; -- this is to be confirmed - VPTense pol (VPCond Simul) (AgPes n p) => { inf = (toHave Pos (PPast2 PstAorist) n p).s ++ (verb.s ! VPTense pol (VPCond Simul) (AgPes n p)).inf } ; - VPTense pol (VPCond Anter) (AgPes n p) => { inf = (toHave Pos (PPast2 PstAorist) n p).s ++ (verb.s ! VPTense pol (VPCond Anter) (AgPes n p)).inf } ; - VVForm (AgPes n p) => {inf = (verb.s ! VVForm (AgPes n p)).inf} ; - VPStem1 => { inf = (verb.s ! VPStem1).inf}; - VPStem2 => { inf = (verb.s ! VPStem2).inf} ; - VPImp pol n => { inf = (verb.s ! VPImp pol n).inf} -- need to be confirmed --- _ => { inf = (verb.s ! VPStem1).inf} - }; - - obj = verb.obj ; - subj = VIntrans ; - inf = verb.inf; - ad = verb.ad; - wish = verb.wish; - vComp = verb.vComp ; - embComp = verb.embComp ; - comp = verb.comp - } ; - -------------------------- --- Ezafa construction ------------------------- -oper -mkEzafa : Str -> Str ; -mkEzafa str = case str of { - st + "اه" => str ; - st + "وه" => str ; - st + "ه" => str ++ "ی" ; - st + "او" => str ; - st + "وو" => str ; - st + "و" => str + "ی" ; - st + "ا" => str + "ی" ; - _ => str - }; -mkEnclic : Str -> Str ; -mkEnclic str = case str of { - st + "ا" => str ++ "یی" ; - st + "و" => str ++ "یی" ; - st + "ی" => str ++ "یی" ; - st + "ه" => str ++ "یی" ; - _ => str + "ی" - }; - + + predProg : VPH -> VPH = \verb -> verb ** { + s = \\vh => case vh of { + VPTense pol (VPPres Simul) agr => toHave Pos (PPresent2 PrImperf) agr ++ verb.s ! VPTense pol (VPPres Simul) agr ; + VPTense pol (VPPast Simul) agr => toHave Pos (PPast2 PstAorist) agr ++ verb.s ! VPTense pol (VPCond Simul) agr ; + VPTense pol (VPCond Simul) agr => toHave Pos (PPast2 PstAorist) agr ++ verb.s ! VPTense pol (VPCond Simul) agr ; + VPTense pol (VPCond Anter) agr => toHave Pos (PPast2 PstAorist) agr ++ verb.s ! VPTense pol (VPCond Anter) agr ; + -- VPTense pol (VPFutr Anter) agr => verb.s ! VPTense pol (VPFutr Anter) agr ; -- this is to be confirmed + _ => verb.s ! vh } ; + subj = VIntrans + } ; + + + IndefArticle : Str ; IndefArticle = "یک"; taryn : Str ; taryn = "ترین" ; ---------------- --- making negatives ---------------- -addN : Str -> Str ; -addN str = - case str of { - "ا" + st => "نی" + str ; - "آ" + st => "نیا" + st ; - _ => "ن" + str - }; -addBh2 : Str -> Str ; -- should use drop instead but it gives linking error -addBh2 str1 = - case str1 of { - "می" + str => - case str of { - "ا" + st => Prelude.glue "بی" str ; -- need to use '+' but it gives linking error - "آ" + st => Prelude.glue "بیا" st ; - _ => Prelude.glue "ب" str - }; - _ => "" - }; - ----------------------------- -- Noun Phrase ----------------------------- {-toNP : Str -> Str = \pn, npc -> case npc of { NPC c => pn ! c ; NPObj => pn ! Dir ; - NPErg => pn ! Obl + NPErg => pn ! Obl } ; -} partNP : Str -> Str = \str -> (Prelude.glue str "ه") ++ "شده" ; -- partNP : Str -> Str = \str -> str + "ه" ++ "شده" ; - - ------------------------------------------- --- Agreement transformations ------------------------------------------ - toAgr : Number -> PPerson -> AgrPes = \n,p -> - AgPes n p; - - fromAgr : AgrPes -> {n : Number ; p : PPerson } = \agr -> case agr of { - AgPes n p => {n = n ; p = p } - } ; - - conjAgrPes : AgrPes -> AgrPes -> AgrPes = \a0,b0 -> - let a = fromAgr a0 ; b = fromAgr b0 - in - toAgr - (conjNumber a.n b.n) - b.p; - - giveNumber : AgrPes -> Number =\a -> case a of { - AgPes n _ => n - }; - - --- defaultAgr : Agr = agrP3 Sg Inanimate ; --- agrP3 : Number -> Animacy -> Agr = \n,a -> Ag n PPers3 a ; - defaultAgrPes : AgrPes = agrPesP3 Sg ; - agrPesP3 : Number -> AgrPes = \n -> AgPes n PPers3 ; --- personalAgr : Agr = agrP1 Sg ; - agrPesP1 : Number -> AgrPes = \n -> AgPes n PPers1 ; - --------------------------------------------------------- +----------------------------------- -- Reflexive Pronouns ----------------------------------- -reflPron : AgrPes => Str = table { - AgPes Sg PPers1 => "خودم" ; - AgPes Sg PPers2 => "خودت" ; - AgPes Sg PPers3 => "خودش" ; - AgPes Pl PPers1 => "خودمان" ; - AgPes Pl PPers2 => "خودتان" ; - AgPes Pl PPers3 => "خودشان" - + reflPron : Agr => Str = table { + Ag Sg P1 => "خودم" ; + Ag Sg P2 => "خودت" ; + Ag Sg P3 => "خودش" ; + Ag Pl P1 => "خودمان" ; + Ag Pl P2 => "خودتان" ; + Ag Pl P3 => "خودشان" + } ; - + getPron : Animacy -> Number -> Str = \ani,number -> case of { => "او" ; - => ["آن ها"] ; + => zwnj "آن" "ها" ; => "آن" ; - => ["آن ها"] + => zwnj "آن" "ها" }; - + } - diff --git a/src/persian/SentencePes.gf b/src/persian/SentencePes.gf index eeca14f1..500a9760 100644 --- a/src/persian/SentencePes.gf +++ b/src/persian/SentencePes.gf @@ -7,20 +7,19 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in { PredVP np vp = mkClause np vp ; - PredSCVP sc vp = mkSClause ("این" ++ sc.s) (defaultAgrPes) vp ; + PredSCVP sc vp = mkSClause ("این" ++ sc.s) (defaultAgr) vp ; ImpVP vp = { - s = \\pol,n => - let - agr = AgPes (numImp n) PPers2 ; - in case pol of { - CPos => vp.ad ++ vp.comp ! agr ++ vp.obj.s ++ vp.vComp ! agr ++ ((vp.s ! VPImp Pos (numImp n)).inf) ++ vp.embComp; - CNeg _ => vp.ad ++ vp.comp ! agr ++ vp.obj.s ++ vp.vComp ! agr ++ ((vp.s ! VPImp Neg (numImp n)).inf) ++ vp.embComp - } ; + s = \\pol,n => + let agr = Ag (numImp n) P2 ; + in case pol of { + CPos => vp.ad ++ vp.comp ! agr ++ vp.obj.s ++ vp.vComp ! agr ++ vp.s ! VPImp Pos (numImp n) ++ vp.embComp; + CNeg _ => vp.ad ++ vp.comp ! agr ++ vp.obj.s ++ vp.vComp ! agr ++ vp.s ! VPImp Neg (numImp n) ++ vp.embComp + } ; } ; - SlashVP np vp = + SlashVP np vp = mkSlClause np vp ** {c2 = vp.c2} ; AdvSlash slash adv = slash ** { @@ -33,17 +32,17 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in { c2 = { s = prep.s ; ra = [] ; c = VIntrans} } ; - SlashVS np vs slash = - mkSlClause np + SlashVS np vs slash = + mkSlClause np (insertObj2 (conjThat ++ slash.s) (predV vs)) ** {c2 = slash.c2} ; EmbedS s = {s = conjThat ++ s.s} ; EmbedQS qs = {s = qs.s ! QIndir} ; - EmbedVP vp = {s = vp.obj.s ++ vp.inf ++ vp.comp ! defaultAgrPes} ; --- agr + EmbedVP vp = {s = vp.obj.s ++ vp.inf ++ vp.comp ! defaultAgr} ; --- agr - UseCl temp p cl = + UseCl temp p cl = { s = case of { => temp.s ++ p.s ++ cl.s ! VPres ! p.p ! ODir; => temp.s ++ p.s ++ cl.s ! VPerfPres ! p.p ! ODir; @@ -52,7 +51,7 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in { => temp.s ++ p.s ++ cl.s ! VFut ! p.p ! ODir; => temp.s ++ p.s ++ cl.s ! VPerfFut ! p.p ! ODir; => temp.s ++ p.s ++ cl.s ! VCondSimul ! p.p ! ODir; - => temp.s ++ p.s ++ cl.s ! VCondAnter ! p.p ! ODir -- this needs to be fixed by making SubjPerf in ResPnb + => temp.s ++ p.s ++ cl.s ! VCondAnter ! p.p ! ODir -- this needs to be fixed by making SubjPerf in ResPnb }; } ; @@ -65,8 +64,8 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in { => temp.s ++ p.s ++ cl.s ! VFut ! p.p ! q; => temp.s ++ p.s ++ cl.s ! VPerfFut ! p.p ! q; => temp.s ++ p.s ++ cl.s ! VCondSimul ! p.p ! q; - => temp.s ++ p.s ++ cl.s ! VCondAnter ! p.p ! q - + => temp.s ++ p.s ++ cl.s ! VCondAnter ! p.p ! q + }; } ; @@ -80,10 +79,10 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in { => temp.s ++ p.s ++ rcl.s ! VPerfFut ! p.p ! ODir ! q; => temp.s ++ p.s ++ rcl.s ! VCondSimul ! p.p ! ODir ! q; => temp.s ++ p.s ++ rcl.s ! VCondAnter ! p.p ! ODir ! q - }; + }; c = rcl.c } ; - + UseSlash temp p clslash = { s = temp.s ++ p.s ++ clslash.subj ++ case of { @@ -95,13 +94,13 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in { => clslash.vp ! VPerfFut ! p.p ! ODir; => clslash.vp ! VCondSimul ! p.p ! ODir; => clslash.vp ! VCondSimul ! p.p ! ODir - }; + }; c2 = clslash.c2 } ; AdvS a s = {s = a.s ++ s.s} ; - RelS s r = {s = s.s ++ r.s ! agrPesP3 Sg} ; + RelS s r = {s = s.s ++ r.s ! agrP3 Sg} ; SSubjS s sj s = { s = s.s ++ sj.s ++ s.s}; } diff --git a/src/persian/StructuralPes.gf b/src/persian/StructuralPes.gf index 61d76416..f47286eb 100644 --- a/src/persian/StructuralPes.gf +++ b/src/persian/StructuralPes.gf @@ -1,4 +1,4 @@ -concrete StructuralPes of Structural = CatPes ** +concrete StructuralPes of Structural = CatPes ** open MorphoPes, ParadigmsPes, Prelude, NounPes, (R=ResPes) in { flags optimize=all ; @@ -32,7 +32,7 @@ concrete StructuralPes of Structural = CatPes ** -- first_Ord = {s = "اولین" ; n = Sg} ; --DEPRECATED for_Prep = ss "برای" ; from_Prep = ss "از" ; - he_Pron = personalPN "او" Sg PPers3 ; + he_Pron = personalPN "او" Sg P3 ; here_Adv = ss "اینجا" ; here7to_Adv = ss "اینجا" ; here7from_Adv = ss "اینجا" ; @@ -41,12 +41,12 @@ concrete StructuralPes of Structural = CatPes ** how8much_IAdv = ss "چقدر" ; if_Subj = ss "اگر" ; in8front_Prep = ss "جلوی" ; - i_Pron = personalPN "من" Sg PPers1; + i_Pron = personalPN "من" Sg P1; in_Prep = ss "در" ; - it_Pron = personalPN "آن" Sg PPers3; + it_Pron = personalPN "آن" Sg P3; less_CAdv = {s = "کمتر" ; p = ""} ; many_Det = mkDet ["تعداد زیادی"] Pl True; -- check - more_CAdv = {s = "بیشتر" ; p = "" } ; + more_CAdv = {s = "بیشتر" ; p = "" } ; most_Predet = ss "اکثر"; much_Det = mkDet ["مقدار زیادی"] Pl ; must_VV = invarV " بایستن " ** {isAux = True} ; ---- AR @@ -71,35 +71,35 @@ concrete StructuralPes of Structural = CatPes ** only_Predet = ss "فقط" ; or_Conj = sd2 [] "یا" ** {n = Sg} ; otherwise_PConj = ss ["درغیراین صورت"] ; - part_Prep = ss "از" ; -- the object following it should be in Ezafa form + part_Prep = ss "از" ; -- the object following it should be in Ezafa form please_Voc = ss "لطفاً" ; possess_Prep = ss "" ; -- will be handeled in Ezafeh quite_Adv = ss "کاملاً" ; - she_Pron = personalPN "او" Sg PPers3 ; - so_AdA = ss "بسیار" ; + she_Pron = personalPN "او" Sg P3 ; + so_AdA = ss "بسیار" ; -- somebody_NP = MassNP (UseN (MorphoPnb.mkN11 "کwی" )); someSg_Det = mkDet "مقداری" Sg True ; somePl_Det = mkDet "چند" Pl True ; -- something_NP = MassNP (UseN (MorphoPnb.mkN11 "چیزی")); - somewhere_Adv = ss "جایی" ; - that_Quant = mkQuant "آن" "آن"; - that_Subj = ss "آن"; - there_Adv = ss "آنجا" ; + somewhere_Adv = ss "جایی" ; + that_Quant = mkQuant "آن" "آن"; + that_Subj = ss "آن"; + there_Adv = ss "آنجا" ; there7to_Adv = ss "آنجا" ; there7from_Adv = ss "آنجا" ; - therefore_PConj = ss ["به همین دلیل"] ; - they_Pron = personalPN ["آن ها"] Pl PPers3 ; - this_Quant = mkQuant "این" "این" ; + therefore_PConj = ss ["به همین دلیل"] ; + they_Pron = personalPN ["آن ها"] Pl P3 ; + this_Quant = mkQuant "این" "این" ; through_Prep = ss ["از طریق"] ; - too_AdA = ss "خیلی" ; + too_AdA = ss "خیلی" ; to_Prep = ss "به" ** {lock_Prep = <>}; under_Prep = ss "زیر" ** {lock_Prep = <>}; very_AdA = ss "خیلی" ; - want_VV = mkV "خواستن" "خواه" ** { isAux = False} ; - we_Pron = personalPN "ما" Pl PPers1 ; + want_VV = mkV "خواستن" "خواه" ** { isAux = False} ; + we_Pron = personalPN "ما" Pl P1 ; whatSg_IP = {s = ["چه چیزی"] ; n = Sg } ; whatPl_IP = {s = ["چه چیزهایی"] ; n = Pl } ; - when_IAdv = ss "کی" ; + when_IAdv = ss "کی" ; when_Subj = ss "وقتی" ; where_IAdv = ss "کجا" ; which_IQuant = {s = "کدام" ; n = Sg} ; @@ -112,17 +112,17 @@ concrete StructuralPes of Structural = CatPes ** with_Prep = ss "با"; -- yes_Phr = ss "بله" ; yes_Utt = ss "بله" ; - youSg_Pron = personalPN "تو" Sg PPers2 ; - youPl_Pron = personalPN "شما" Pl PPers2 ; - youPol_Pron = personalPN "شما" Pl PPers2 ; --- no_Quant = demoPN "هیچ" ; + youSg_Pron = personalPN "تو" Sg P2 ; + youPl_Pron = personalPN "شما" Pl P2 ; + youPol_Pron = personalPN "شما" Pl P2 ; +-- no_Quant = demoPN "هیچ" ; not_Predet = {s="نه"} ; - if_then_Conj = sd2 "اگر" "آنگاه" ** {n = Sg} ; + if_then_Conj = sd2 "اگر" "آنگاه" ** {n = Sg} ; at_least_AdN = ss "حداقل" ; at_most_AdN = ss "حداکثر"; --- nothing_NP = MassNP (UseN (MorphoPnb.mkN11 "هیچ چیز" )); +-- nothing_NP = MassNP (UseN (MorphoPnb.mkN11 "هیچ چیز" )); except_Prep = ss ["به جز"] ; --- nobody_NP = MassNP (UseN (MorphoPnb.mkN11 "هیچ کس")); +-- nobody_NP = MassNP (UseN (MorphoPnb.mkN11 "هیچ کس")); as_CAdv = {s = ["به اندازه ی"] ; p = ""} ; @@ -132,126 +132,147 @@ concrete StructuralPes of Structural = CatPes ** ---- AR from Nasrin -have_V2 = { +-- have_V2: "have" as an independent verb. +-- MorphoPes.haveVerb: "have" as auxiliary. +have_V2 = haveVerb ** { s = table { - (VF Pos (PPresent2 PrPerf) PPers1 Sg) => "داشته ام" ; - (VF Pos (PPresent2 PrPerf) PPers1 Pl) => "داشته ایم" ; - (VF Pos (PPresent2 PrPerf) PPers2 Sg) => "داشته ای" ; - (VF Pos (PPresent2 PrPerf) PPers2 Pl) => "داشته اید" ; - (VF Pos (PPresent2 PrPerf) PPers3 Sg) => "داشته است" ; - (VF Pos (PPresent2 PrPerf) PPers3 Pl) => "داشته اند" ; - (VF Pos (PPresent2 PrImperf) PPers1 Sg) => "دارم" ; - (VF Pos (PPresent2 PrImperf) PPers1 Pl) => "داریم" ; - (VF Pos (PPresent2 PrImperf) PPers2 Sg) => " داری" ; - (VF Pos (PPresent2 PrImperf) PPers2 Pl) => "دارید" ; - (VF Pos (PPresent2 PrImperf) PPers3 Sg) => "دارد" ; - (VF Pos (PPresent2 PrImperf) PPers3 Pl) => "دارند" ; - (VF Pos (PPast2 PstPerf) PPers1 Sg) => "داشته بودم" ; - (VF Pos (PPast2 PstPerf) PPers1 Pl) => "داشته بودیم" ; - (VF Pos (PPast2 PstPerf) PPers2 Sg) => "داشته بودی" ; - (VF Pos (PPast2 PstPerf) PPers2 Pl) => "داشته بودید" ; - (VF Pos (PPast2 PstPerf) PPers3 Sg) => "داشته بود" ; - (VF Pos (PPast2 PstPerf) PPers3 Pl) => "داشته بودند" ; - (VF Pos (PPast2 PstImperf) PPers1 Sg) => "می داشتم" ; - (VF Pos (PPast2 PstImperf) PPers1 Pl) => "می داشتیم" ; - (VF Pos (PPast2 PstImperf) PPers2 Sg) => "می داشتی" ; - (VF Pos (PPast2 PstImperf) PPers2 Pl) => "می داشتید" ; - (VF Pos (PPast2 PstImperf) PPers3 Sg) => "می داشت" ; - (VF Pos (PPast2 PstImperf) PPers3 Pl) => "می داشتند" ; - (VF Pos (PPast2 PstAorist) PPers1 Sg) => "داشتم" ; - (VF Pos (PPast2 PstAorist) PPers1 Pl) => "داشتیم" ; - (VF Pos (PPast2 PstAorist) PPers2 Sg) => "داشتی" ; - (VF Pos (PPast2 PstAorist) PPers2 Pl) => "داشتید" ; - (VF Pos (PPast2 PstAorist) PPers3 Sg) => "داشت" ; - (VF Pos (PPast2 PstAorist) PPers3 Pl) => "داشتند" ; - (VF Pos (PFut2 FtAorist) PPers1 Sg) => "خواهم داشت" ; - (VF Pos (PFut2 FtAorist) PPers1 Pl) => "خواهیم داشت" ; - (VF Pos (PFut2 FtAorist) PPers2 Sg) => "خواهی داشت" ; - (VF Pos (PFut2 FtAorist) PPers2 Pl) => "خواهید داشت" ; - (VF Pos (PFut2 FtAorist) PPers3 Sg) => "خواهد داشت" ; - (VF Pos (PFut2 FtAorist) PPers3 Pl) => "خواهند داشت" ; - (VF Pos (Infr_Past2 InfrPerf) PPers1 Sg) => "داشته بوده ام" ; - (VF Pos (Infr_Past2 InfrPerf) PPers1 Pl) => "داشته بوده ایم" ; - (VF Pos (Infr_Past2 InfrPerf) PPers2 Sg) => "داشته بوده ای" ; - (VF Pos (Infr_Past2 InfrPerf) PPers2 Pl) => "داشته بوده اید" ; - (VF Pos (Infr_Past2 InfrPerf) PPers3 Sg) => "داشته بوده است" ; - (VF Pos (Infr_Past2 InfrPerf) PPers3 Pl) => "داشته بوده اند" ; - (VF Pos (Infr_Past2 InfrImperf) PPers1 Sg) => "می داشته ام" ; - (VF Pos (Infr_Past2 InfrImperf) PPers1 Pl) => "می داشته ایم" ; - (VF Pos (Infr_Past2 InfrImperf) PPers2 Sg) => "می داشته ای" ; - (VF Pos (Infr_Past2 InfrImperf) PPers2 Pl) => "می داشته اید" ; - (VF Pos (Infr_Past2 InfrImperf) PPers3 Sg) => "می داشته است" ; - (VF Pos (Infr_Past2 InfrImperf) PPers3 Pl) => "می داشته اند" ; - (VF Neg (PPresent2 PrPerf) PPers1 Sg) => "نداشته ام" ; - (VF Neg (PPresent2 PrPerf) PPers1 Pl) => "نداشته ایم" ; - (VF Neg (PPresent2 PrPerf) PPers2 Sg) => "نداشته ای" ; - (VF Neg (PPresent2 PrPerf) PPers2 Pl) => "نداشته اید" ; - (VF Neg (PPresent2 PrPerf) PPers3 Sg) => "نداشته است" ; - (VF Neg (PPresent2 PrPerf) PPers3 Pl) => "نداشته اند" ; - (VF Neg (PPresent2 PrImperf) PPers1 Sg) => "ندارم" ; - (VF Neg (PPresent2 PrImperf) PPers1 Pl) => "نداریم" ; - (VF Neg (PPresent2 PrImperf) PPers2 Sg) => "نداری" ; - (VF Neg (PPresent2 PrImperf) PPers2 Pl) => "ندارید" ; - (VF Neg (PPresent2 PrImperf) PPers3 Sg) => "ندارد" ; - (VF Neg (PPresent2 PrImperf) PPers3 Pl) => "ندارند" ; - (VF Neg (PPast2 PstPerf) PPers1 Sg) => "نداشته بودم" ; - (VF Neg (PPast2 PstPerf) PPers1 Pl) => "نداشته بودیم" ; - (VF Neg (PPast2 PstPerf) PPers2 Sg) => "نداشته بودی" ; - (VF Neg (PPast2 PstPerf) PPers2 Pl) => "نداشته بودید" ; - (VF Neg (PPast2 PstPerf) PPers3 Sg) => "نداشته بود" ; - (VF Neg (PPast2 PstPerf) PPers3 Pl) => "نداشته بودند" ; - (VF Neg (PPast2 PstImperf) PPers1 Sg) => "نمی داشتم" ; - (VF Neg (PPast2 PstImperf) PPers1 Pl) => "نمی داشتیم" ; - (VF Neg (PPast2 PstImperf) PPers2 Sg) => "نمی داشتی" ; - (VF Neg (PPast2 PstImperf) PPers2 Pl) => "نمی داشتید" ; - (VF Neg (PPast2 PstImperf) PPers3 Sg) => "نمی داشت" ; - (VF Neg (PPast2 PstImperf) PPers3 Pl) => "نمی داشتند" ; - (VF Neg (PPast2 PstAorist) PPers1 Sg) => "نداشتم" ; - (VF Neg (PPast2 PstAorist) PPers1 Pl) => "نداشتیم" ; - (VF Neg (PPast2 PstAorist) PPers2 Sg) => "نداشتی" ; - (VF Neg (PPast2 PstAorist) PPers2 Pl) => "نداشتید" ; - (VF Neg (PPast2 PstAorist) PPers3 Sg) => "نداشت" ; - (VF Neg (PPast2 PstAorist) PPers3 Pl) => "نداشتند" ; - (VF Neg (PFut2 FtAorist) PPers1 Sg) => "نخواهم داشت" ; - (VF Neg (PFut2 FtAorist) PPers1 Pl) => "نخواهیم داشت" ; - (VF Neg (PFut2 FtAorist) PPers2 Sg) => "نخواهی داشت" ; - (VF Neg (PFut2 FtAorist) PPers2 Pl) => "نخواهید داشت" ; - (VF Neg (PFut2 FtAorist) PPers3 Sg) => "نخواهد داشت" ; - (VF Neg (PFut2 FtAorist) PPers3 Pl) => "نخواهند داشت" ; - (VF Neg (Infr_Past2 InfrPerf) PPers1 Sg) => "نداشته بوده ام" ; - (VF Neg (Infr_Past2 InfrPerf) PPers1 Pl) => "نداشته بوده ایم" ; - (VF Neg (Infr_Past2 InfrPerf) PPers2 Sg) => "نداشته بوده ای" ; - (VF Neg (Infr_Past2 InfrPerf) PPers2 Pl) => "نداشته بوده اید" ; - (VF Neg (Infr_Past2 InfrPerf) PPers3 Sg) => "نداشته بوده است" ; - (VF Neg (Infr_Past2 InfrPerf) PPers3 Pl) => "نداشته بوده اند" ; - (VF Neg (Infr_Past2 InfrImperf) PPers1 Sg) => "نمی داشته ام" ; - (VF Neg (Infr_Past2 InfrImperf) PPers1 Pl) => "نمی داشته ایم" ; - (VF Neg (Infr_Past2 InfrImperf) PPers2 Sg) => "نمی داشته ای" ; - (VF Neg (Infr_Past2 InfrImperf) PPers2 Pl) => "نمی داشته اید" ; - (VF Neg (Infr_Past2 InfrImperf) PPers3 Sg) => "نمی داشته است" ; - (VF Neg (Infr_Past2 InfrImperf) PPers3 Pl) => "نمی داشته اند" ; - (Vvform (AgPes Sg PPers1)) => "بدارم" ; - (Vvform (AgPes Sg PPers2)) => "بداری" ; - (Vvform (AgPes Sg PPers3)) => "بدارد" ; - (Vvform (AgPes Pl PPers1)) => "بداریم" ; - (Vvform (AgPes Pl PPers2)) => "بدارید" ; - (Vvform (AgPes Pl PPers3)) => "بدارند" ; + R.Imp Pos Sg => "داشته باش" ; + R.Imp Pos Pl => "داشته باشید" ; + R.Imp Neg Sg => "نداشته باش" ; + R.Imp Neg Pl => "نداشته باشید" ; + Vvform (Ag Sg P1) => "داشته باشم" ; + Vvform (Ag Sg P2) => "داشته باشی" ; + Vvform (Ag Sg P3) => "داشته باشد" ; + Vvform (Ag Pl P1) => "داشته باشیم" ; + Vvform (Ag Pl P2) => "داشته باشید" ; + Vvform (Ag Pl P3) => "داشته باشند" ; + x => haveVerb.s ! x } ; + c2 = { + s = [] ; + ra = [] ; --- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky + c = R.VTrans + } + } ; + +--have_V2 = { +have_nasrin_V2 = { + s = table { + (VF Pos (PPresent2 PrPerf) P1 Sg) => "داشته ام" ; + (VF Pos (PPresent2 PrPerf) P1 Pl) => "داشته ایم" ; + (VF Pos (PPresent2 PrPerf) P2 Sg) => "داشته ای" ; + (VF Pos (PPresent2 PrPerf) P2 Pl) => "داشته اید" ; + (VF Pos (PPresent2 PrPerf) P3 Sg) => "داشته است" ; + (VF Pos (PPresent2 PrPerf) P3 Pl) => "داشته اند" ; + (VF Pos (PPresent2 PrImperf) P1 Sg) => "دارم" ; + (VF Pos (PPresent2 PrImperf) P1 Pl) => "داریم" ; + (VF Pos (PPresent2 PrImperf) P2 Sg) => " داری" ; + (VF Pos (PPresent2 PrImperf) P2 Pl) => "دارید" ; + (VF Pos (PPresent2 PrImperf) P3 Sg) => "دارد" ; + (VF Pos (PPresent2 PrImperf) P3 Pl) => "دارند" ; + (VF Pos (PPast2 PstPerf) P1 Sg) => "داشته بودم" ; + (VF Pos (PPast2 PstPerf) P1 Pl) => "داشته بودیم" ; + (VF Pos (PPast2 PstPerf) P2 Sg) => "داشته بودی" ; + (VF Pos (PPast2 PstPerf) P2 Pl) => "داشته بودید" ; + (VF Pos (PPast2 PstPerf) P3 Sg) => "داشته بود" ; + (VF Pos (PPast2 PstPerf) P3 Pl) => "داشته بودند" ; + (VF Pos (PPast2 PstImperf) P1 Sg) => "می داشتم" ; + (VF Pos (PPast2 PstImperf) P1 Pl) => "می داشتیم" ; + (VF Pos (PPast2 PstImperf) P2 Sg) => "می داشتی" ; + (VF Pos (PPast2 PstImperf) P2 Pl) => "می داشتید" ; + (VF Pos (PPast2 PstImperf) P3 Sg) => "می داشت" ; + (VF Pos (PPast2 PstImperf) P3 Pl) => "می داشتند" ; + (VF Pos (PPast2 PstAorist) P1 Sg) => "داشتم" ; + (VF Pos (PPast2 PstAorist) P1 Pl) => "داشتیم" ; + (VF Pos (PPast2 PstAorist) P2 Sg) => "داشتی" ; + (VF Pos (PPast2 PstAorist) P2 Pl) => "داشتید" ; + (VF Pos (PPast2 PstAorist) P3 Sg) => "داشت" ; + (VF Pos (PPast2 PstAorist) P3 Pl) => "داشتند" ; + (VF Pos (PFut2 FtAorist) P1 Sg) => "خواهم داشت" ; + (VF Pos (PFut2 FtAorist) P1 Pl) => "خواهیم داشت" ; + (VF Pos (PFut2 FtAorist) P2 Sg) => "خواهی داشت" ; + (VF Pos (PFut2 FtAorist) P2 Pl) => "خواهید داشت" ; + (VF Pos (PFut2 FtAorist) P3 Sg) => "خواهد داشت" ; + (VF Pos (PFut2 FtAorist) P3 Pl) => "خواهند داشت" ; + (VF Pos (Infr_Past2 InfrPerf) P1 Sg) => "داشته بوده ام" ; + (VF Pos (Infr_Past2 InfrPerf) P1 Pl) => "داشته بوده ایم" ; + (VF Pos (Infr_Past2 InfrPerf) P2 Sg) => "داشته بوده ای" ; + (VF Pos (Infr_Past2 InfrPerf) P2 Pl) => "داشته بوده اید" ; + (VF Pos (Infr_Past2 InfrPerf) P3 Sg) => "داشته بوده است" ; + (VF Pos (Infr_Past2 InfrPerf) P3 Pl) => "داشته بوده اند" ; + (VF Pos (Infr_Past2 InfrImperf) P1 Sg) => "می داشته ام" ; + (VF Pos (Infr_Past2 InfrImperf) P1 Pl) => "می داشته ایم" ; + (VF Pos (Infr_Past2 InfrImperf) P2 Sg) => "می داشته ای" ; + (VF Pos (Infr_Past2 InfrImperf) P2 Pl) => "می داشته اید" ; + (VF Pos (Infr_Past2 InfrImperf) P3 Sg) => "می داشته است" ; + (VF Pos (Infr_Past2 InfrImperf) P3 Pl) => "می داشته اند" ; + (VF Neg (PPresent2 PrPerf) P1 Sg) => "نداشته ام" ; + (VF Neg (PPresent2 PrPerf) P1 Pl) => "نداشته ایم" ; + (VF Neg (PPresent2 PrPerf) P2 Sg) => "نداشته ای" ; + (VF Neg (PPresent2 PrPerf) P2 Pl) => "نداشته اید" ; + (VF Neg (PPresent2 PrPerf) P3 Sg) => "نداشته است" ; + (VF Neg (PPresent2 PrPerf) P3 Pl) => "نداشته اند" ; + (VF Neg (PPresent2 PrImperf) P1 Sg) => "ندارم" ; + (VF Neg (PPresent2 PrImperf) P1 Pl) => "نداریم" ; + (VF Neg (PPresent2 PrImperf) P2 Sg) => "نداری" ; + (VF Neg (PPresent2 PrImperf) P2 Pl) => "ندارید" ; + (VF Neg (PPresent2 PrImperf) P3 Sg) => "ندارد" ; + (VF Neg (PPresent2 PrImperf) P3 Pl) => "ندارند" ; + (VF Neg (PPast2 PstPerf) P1 Sg) => "نداشته بودم" ; + (VF Neg (PPast2 PstPerf) P1 Pl) => "نداشته بودیم" ; + (VF Neg (PPast2 PstPerf) P2 Sg) => "نداشته بودی" ; + (VF Neg (PPast2 PstPerf) P2 Pl) => "نداشته بودید" ; + (VF Neg (PPast2 PstPerf) P3 Sg) => "نداشته بود" ; + (VF Neg (PPast2 PstPerf) P3 Pl) => "نداشته بودند" ; + (VF Neg (PPast2 PstImperf) P1 Sg) => "نمی داشتم" ; + (VF Neg (PPast2 PstImperf) P1 Pl) => "نمی داشتیم" ; + (VF Neg (PPast2 PstImperf) P2 Sg) => "نمی داشتی" ; + (VF Neg (PPast2 PstImperf) P2 Pl) => "نمی داشتید" ; + (VF Neg (PPast2 PstImperf) P3 Sg) => "نمی داشت" ; + (VF Neg (PPast2 PstImperf) P3 Pl) => "نمی داشتند" ; + (VF Neg (PPast2 PstAorist) P1 Sg) => "نداشتم" ; + (VF Neg (PPast2 PstAorist) P1 Pl) => "نداشتیم" ; + (VF Neg (PPast2 PstAorist) P2 Sg) => "نداشتی" ; + (VF Neg (PPast2 PstAorist) P2 Pl) => "نداشتید" ; + (VF Neg (PPast2 PstAorist) P3 Sg) => "نداشت" ; + (VF Neg (PPast2 PstAorist) P3 Pl) => "نداشتند" ; + (VF Neg (PFut2 FtAorist) P1 Sg) => "نخواهم داشت" ; + (VF Neg (PFut2 FtAorist) P1 Pl) => "نخواهیم داشت" ; + (VF Neg (PFut2 FtAorist) P2 Sg) => "نخواهی داشت" ; + (VF Neg (PFut2 FtAorist) P2 Pl) => "نخواهید داشت" ; + (VF Neg (PFut2 FtAorist) P3 Sg) => "نخواهد داشت" ; + (VF Neg (PFut2 FtAorist) P3 Pl) => "نخواهند داشت" ; + (VF Neg (Infr_Past2 InfrPerf) P1 Sg) => "نداشته بوده ام" ; + (VF Neg (Infr_Past2 InfrPerf) P1 Pl) => "نداشته بوده ایم" ; + (VF Neg (Infr_Past2 InfrPerf) P2 Sg) => "نداشته بوده ای" ; + (VF Neg (Infr_Past2 InfrPerf) P2 Pl) => "نداشته بوده اید" ; + (VF Neg (Infr_Past2 InfrPerf) P3 Sg) => "نداشته بوده است" ; + (VF Neg (Infr_Past2 InfrPerf) P3 Pl) => "نداشته بوده اند" ; + (VF Neg (Infr_Past2 InfrImperf) P1 Sg) => "نمی داشته ام" ; + (VF Neg (Infr_Past2 InfrImperf) P1 Pl) => "نمی داشته ایم" ; + (VF Neg (Infr_Past2 InfrImperf) P2 Sg) => "نمی داشته ای" ; + (VF Neg (Infr_Past2 InfrImperf) P2 Pl) => "نمی داشته اید" ; + (VF Neg (Infr_Past2 InfrImperf) P3 Sg) => "نمی داشته است" ; + (VF Neg (Infr_Past2 InfrImperf) P3 Pl) => "نمی داشته اند" ; + (Vvform (Ag Sg P1)) => "بدارم" ; + (Vvform (Ag Sg P2)) => "بداری" ; + (Vvform (Ag Sg P3)) => "بدارد" ; + (Vvform (Ag Pl P1)) => "بداریم" ; + (Vvform (Ag Pl P2)) => "بدارید" ; + (Vvform (Ag Pl P3)) => "بدارند" ; (R.Imp Pos Sg) => "بدار" ; (R.Imp Pos Pl) => "بدارید" ; (R.Imp Neg Sg) => "ندار" ; (R.Imp Neg Pl) => "ندارید" ; Inf => "داشتن" ; Root1 => "داشت" ; - Root2 => "دار" + Root2 => "دار" } ; c2 = { s = [] ; - ra = [] ; --- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky + ra = [] ; --- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky c = R.VTrans } } ; } - - diff --git a/src/persian/SymbolPes.gf b/src/persian/SymbolPes.gf index 4f62b66b..ef8e2922 100644 --- a/src/persian/SymbolPes.gf +++ b/src/persian/SymbolPes.gf @@ -12,17 +12,17 @@ concrete SymbolPes of Symbol = CatPes ** open Prelude, ResPes in { NumPN i = {s = i.s ; animacy = Inanimate} ; CNIntNP cn i = { s = \\ez => cn.s ! aEzafa ! Sg ++ i.s ; - a = agrPesP3 Sg ; + a = agrP3 Sg ; animacy = cn.animacy } ; CNSymbNP det cn xs = { s = \\ez => det.s ++ cn.s ! aEzafa ! det.n ++ xs.s ; - a = agrPesP3 det.n ; + a = agrP3 det.n ; animacy = cn.animacy } ; CNNumNP cn i = { s = \\ez => cn.s ! aEzafa ! Sg ++ i.s ; - a = agrPesP3 Sg ; + a = agrP3 Sg ; animacy = cn.animacy } ;