From 9ea34d871c767e31358831173a677d03a65cba4d Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 11 Feb 2019 11:29:45 +0100 Subject: [PATCH 1/4] (Pes) More comments in ParadigmsPes --- src/persian/ParadigmsPes.gf | 38 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/persian/ParadigmsPes.gf b/src/persian/ParadigmsPes.gf index ca8901c4c..a6c97807a 100644 --- a/src/persian/ParadigmsPes.gf +++ b/src/persian/ParadigmsPes.gf @@ -17,26 +17,24 @@ resource ParadigmsPes = open oper Animacy : Type ; -- Argument to mkN - animate : Animacy ; - inanimate : Animacy ; + animate : Animacy ; -- e.g. /mkN "خواهر" animate/ to get the plural خواهران. + inanimate : Animacy ; -- default animacy for mkN, not needed unless you want to make the animacy explicit or force a plural with ها. - Number : Type ; -- Argument to - singular : Number ; - plural : Number ; + Number : Type ; -- Argument to mkDet and mkConj + singular : Number ; -- e.g. mkConj "یا" singular + plural : Number ; -- e.g. mkConj "و" plural --2 Nouns mkN = overload { - mkN : (sg : Str) -> N -- Takes singular form, returns an inanimate noun with ها as the plural form + mkN : (sg : Str) -> N -- Takes singular form, returns an inanimate noun with ها as the plural form. = \sg -> mkN01 sg inanimate ; - mkN : (sg : Str) -> Animacy -> N -- Takes singular form and animacy. Inaminate plural ها. Animate plural ان or an allomorph of it (یان or گان) depending on the singular form. + mkN : (sg : Str) -> Animacy -> N -- Takes singular form and animacy. Inanimate plural ها. Animate plural ان or an allomorph of it (یان or گان) depending on the singular form. = \sg,ani -> case ani of { Inanimate => mkN01 sg ani ; Animate => mkN02 sg ani } ; - -- mkN : (sg,pl : Str) -> N -- Takes singular and plural form, returns an inanimate noun - -- = \sg,pl -> M.mkN sg pl inanimate ; - mkN : (sg,pl : Str) -> Animacy -> N -- Worst-case constructor: takes singular and plural forms and animacy. Use for e.g. loanwords with Arabic plural. + mkN : (sg,pl : Str) -> Animacy -> N -- Worst-case constructor: takes singular and plural forms and animacy. Use for e.g. loanwords with Arabic plural, or animate nouns with ها as plural. = \sg,pl,ani -> M.mkN sg pl ani } ; @@ -93,9 +91,10 @@ oper = \s1, s2 -> lin V (mkVerb s1 s2) } ; - haveVerb : V = lin V M.haveVerb ; -- The verb "have", to be used for light verb constructions: e.g. compoundV "دوست" haveVerb. NB. this has different imperative and VV forms from StructuralPes.have_V2. - beVerb : V = lin V M.beVerb ; -- The verb "be", to be used for light verb constructions: e.g. compoundV "عاشق" beVerb. - + haveVerb : V -- The verb "have", to be used for light verb constructions: e.g. compoundV "دوست" haveVerb. NB. this has different imperative and VV forms from StructuralPes.have_V2. + = lin V M.haveVerb ; + beVerb : V -- The verb "be", to be used for light verb constructions: e.g. compoundV "عاشق" beVerb. + = lin V M.beVerb ; mkV2 : overload { mkV2 : Str -> V2 ; -- Predictable V2 out of string. No preposition, را for direct object. mkV2 : V -> V2 ; -- V2 out of V. No preposition, را for direct object. @@ -103,10 +102,10 @@ oper } ; - mkV3 : V -> Str -> Str -> V3 ; -- Takes a verb and two prepositions (can be empty), e.g. speak, with, about + mkV3 : V -> (dir,indir : Str) -> V3 ; -- Takes a verb and two prepositions as strings (can be empty). If the verb takes را for direct object, it's the first Str argument. e.g. talk, با, دربارۀ mkV3 v p q = lin V3 (v ** {c2 = p ; c3 = q}) ; - mkV2V : V -> (cV : Str) -> (cN : Str) -> (isAux : Bool) -> V2V ; -- Verb, complementiser for the verb, complementiser for the noun, whether it's auxiliary. + mkV2V : V -> (cV, cN : Str) -> (isAux : Bool) -> V2V ; -- Verb, complementiser for the verb, complementiser for the noun, whether it's auxiliary. mkV2V v s1 s2 b = lin V2V (v ** {isAux = b ; c1 = s1 ; c2 = s2}) ; -- compund verbs @@ -114,11 +113,12 @@ oper compoundV : Str -> V -> V -- Invariable prefix to a verb, e.g. compoundV "دوست" haveVerb } ; - invarV : Str -> V -- for verbs like " بایستن " ("must"), which don't inflect + invarV : Str -> V -- for verbs like بایستن ('must'), which don't inflect = \s -> lin V {s = \\_ => s} ; ----2 Adverbs - mkAdv : Str -> Adv = \str -> lin Adv {s = str} ; -- Takes a string, returns an adverb. + mkAdv : Str -> Adv -- Takes a string, returns an adverb. + = \str -> lin Adv {s = str} ; ----2 Prepositions @@ -171,7 +171,9 @@ 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 + let pl : Str = case last sg of { + --"د"|"ذ"|"ر"|"ز"|"ژ" => sg + "ها" ; -- these letters are separated by default + _ => zwnj sg "ها" } ; -- Using zero-width non-joiner, defined in MorphoPes 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 ان From a532389bbd7b866dadc03e4fedc0dc538fe86398 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 11 Feb 2019 11:30:05 +0100 Subject: [PATCH 2/4] (Pes) Fix orthography + add a few words in LexiconPes --- src/persian/LexiconPes.gf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/persian/LexiconPes.gf b/src/persian/LexiconPes.gf index 4a44edf2d..2fba727da 100644 --- a/src/persian/LexiconPes.gf +++ b/src/persian/LexiconPes.gf @@ -188,7 +188,7 @@ concrete LexiconPes of Lexicon = CatPes ** switch8off_V2 = mkV2 (compoundV "خاموش" doVerb) "را"; switch8on_V2 = mkV2 (compoundV "روشن" doVerb) "را"; table_N = mkN01 "میز" inanimate; - talk_V3 = mkV3 (compoundV "حرف" hitVerb) "با" [" درباره ی"]; + talk_V3 = mkV3 (compoundV "حرف" hitVerb) "با" "دربارۀ"; teacher_N = mkN02 "معلم" animate; teach_V2 = mkV2 (compoundV "آموزش" giveVerb) "را"; television_N = mkN01 "تلوزیون" inanimate; @@ -202,18 +202,18 @@ concrete LexiconPes of Lexicon = CatPes ** understand_V2 = mkV2 (mkV_1 "فهمیدن") "را"; university_N = mkN01 "دانشگاه" inanimate; village_N = mkN01 "روستا" inanimate; --- wait_V2 = mkV2 (compoundV "منتظر" (mkVToBe "بودن" "باش")); + wait_V2 = mkV2 (compoundV "منتظر" beVerb); walk_V = compoundV "راه" (mkV "رفتن" "رو"); warm_A = mkA "گرم" ; war_N = mkN01 "جنگ" inanimate; --- watch_V2 = mkV2 (compoundV "مراقب" (mkVToBe "بودن" "باش")); -- check harfe rabt!!! + watch_V2 = mkV2 (compoundV "مراقب" beVerb); -- check harfe rabt!!! water_N = mkN01 "آب" inanimate; white_A = mkA "سفید" ; window_N = mkN01 "پنجره" inanimate; wine_N = mkN01 "شراب" inanimate; win_V2 = mkV2 (compoundV "برنده" (mkV "شدن" "شو")) "را"; -- also possible with simple verb: mkV_2 "بردن" woman_N = mkN02 "زن" animate; --- wonder_VQ = compoundV "متعجب" (mkVToBe "بودن" "باش") ; + wonder_VQ = compoundV "متعجب" beVerb ; wood_N = mkN01 "چوب" inanimate; write_V2 = mkV2 (mkV "نوشتن" "نویس") "را" ; yellow_A = mkA "زرد" ; From f8c0f7038f42fe85040d9e8c6b6a01ca0de8ac69 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 13 Feb 2019 10:09:02 +0100 Subject: [PATCH 3/4] (Pes) A few more orthography issues --- src/persian/MorphoPes.gf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/persian/MorphoPes.gf b/src/persian/MorphoPes.gf index 730dc3245..b9856e576 100644 --- a/src/persian/MorphoPes.gf +++ b/src/persian/MorphoPes.gf @@ -60,7 +60,7 @@ oper case str of { st + "اه" => str + kasre ; st + "وه" => str + kasre ; - st + "ه" => st + "ۀ" ; -- str ++ "ی" ; + st + "ه" => zwnj str "ی" ;-- alt. st + "ۀ" ; st + "او" => str + kasre ; st + "وو" => str + kasre ; st + "و" => str + "ی" ; @@ -71,7 +71,8 @@ oper mkEnclic : Str -> Str ; mkEnclic str = case str of { st + ("ا"|"و") => zwnj str "یی" ; -- ی after a long vowel to help pronunciation - st + "اه" => str + "ی" ; -- here ه is a consonant, so single ی + st + "اه" => zwnj str "ی" ; -- here ه is a consonant, so single ی +-- st + "اه" => str + "ی" ; -- old version, no ZWNJ st + ("ی"|"ه") => zwnj str "ای" ; -- after ی or ه as a vowel, add an alif to help pronunciation _ => str + "ی" -- any other case: just a single ی } ; From 23897186768d9993b36902dc271db867b3663db5 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 13 Feb 2019 10:09:22 +0100 Subject: [PATCH 4/4] (Pes) Special agreement rules --- src/persian/VerbPes.gf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/persian/VerbPes.gf b/src/persian/VerbPes.gf index eacd0aca2..34808a8d8 100644 --- a/src/persian/VerbPes.gf +++ b/src/persian/VerbPes.gf @@ -45,10 +45,10 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in { -- see https://sites.la.utexas.edu/persian_online_resources/nouns/noun-in-a-predicative-position/ CompCN cn = { - s = \\a => cn.s ! case cn.hasAdj of { - False => bEzafa ; - True => enClic } - ! giveNumber a + s = \\a => + case cn.hasAdj of { + False => cn.s ! bEzafa ! Sg ; + True => cn.s ! enClic ! giveNumber a } } ; CompNP np = {