diff --git a/src/persian/AdjectivePes.gf b/src/persian/AdjectivePes.gf index 111fd94a5..253c73a73 100644 --- a/src/persian/AdjectivePes.gf +++ b/src/persian/AdjectivePes.gf @@ -3,46 +3,51 @@ concrete AdjectivePes of Adjective = CatPes ** open ResPes, Prelude in { flags coding = utf8; lin - PositA a = a ; - UseComparA a = a; + PositA a = a ; + UseComparA a = a ; - ComparA a np = { - s =\\ez => a.s ! ez ++ "تر" ++ "از" ++ np.s ! Bare ; - adv = a.adv - } ; + ComparA a np = a ** { + s = \\m => a.s ! m ++ "تر" ++ "از" ++ np.s ! Bare ; + adv = a.adv ++ "تر" ++ "از" ++ np.s ! Bare ; + } ; ---- $SuperlA$ belongs to determiner syntax in $Noun$. - ComplA2 a np = { - s =\\ez => np.s ! Bare ++ a.c2 ++ a.s ! ez ; - adv = a.adv - } ; + ComplA2 a np = a ** { + s = \\m => np.s ! Bare ++ a.c2 ++ a.s ! m ; + adv = np.s ! Bare ++ a.c2 ++ a.adv + } ; - ReflA2 a = { - s =\\ez => a.s ! ez ++ "" ; -- need to be fixed - adv = a.adv - } ; + ReflA2 a = a ** { + s = \\m => a.s ! m ++ reflPron ! defaultAgr ; ---- need to be fixed + adv = a.adv ++ reflPron ! defaultAgr + } ; - SentAP ap sc = { - s =\\ez => ap.s! ez ++ sc.s ; - adv = ap.adv - } ; + SentAP ap sc = ap ** { + s = \\m => ap.s ! m ++ sc.s ; + adv = ap.adv ++ sc.s + } ; - AdAP ada ap = { - s =\\ez => ada.s ++ ap.s ! ez ; - adv = ap.adv - } ; + AdAP ada ap = ap ** { + s = \\m => ada.s ++ ap.s ! m ; + adv = ada.s ++ ap.adv ; + } ; - UseA2 a = a ; + UseA2 a = a ; - CAdvAP cadv ap np = { - s =\\ez => cadv.s ++ np.s ! Bare ++ ap.s ! ez ; - adv = ap.adv - }; + CAdvAP cadv ap np = ap ** { + s = \\m => cadv.s ++ np.s ! Bare ++ ap.s ! m ; + adv = cadv.s ++ ap.adv + } ; - AdjOrd ord = { s =\\_ => ord.s ; adv = ""}; + AdjOrd ord = { + s = \\_ => ord.s ; + adv = ord.s ; + isPre = ord.isPre + } ; - - - AdvAP ap adv = {s =\\ez => ap.s ! ez ++ adv.s ; adv = ap.adv}; + AdvAP ap adv = ap ** { + s = \\m => ap.s ! m ++ adv.s ; + adv = ap.adv ++ adv.s + } ; } diff --git a/src/persian/CatPes.gf b/src/persian/CatPes.gf index fe5d2cab9..69077d1cc 100644 --- a/src/persian/CatPes.gf +++ b/src/persian/CatPes.gf @@ -58,7 +58,7 @@ concrete CatPes of Cat = CommonX ** open ResPes, Prelude in { Predet = {s : Str} ; Num = {s : Str ; n : Number ; isNum : Bool} ; Card = {s : Str; n : Number} ; - Ord = {s : Str; n : Number ; isNum : Bool} ; + Ord = {s : Str; n : Number ; isNum,isPre : Bool} ; Quant = ResPes.Quant ; ---- Numeral diff --git a/src/persian/ConjunctionPes.gf b/src/persian/ConjunctionPes.gf index 27f6dd2e5..996f601d0 100644 --- a/src/persian/ConjunctionPes.gf +++ b/src/persian/ConjunctionPes.gf @@ -17,7 +17,7 @@ concrete ConjunctionPes of Conjunction = animacy = ss.animacy ; } ; - ConjAP conj ss = conjunctDistrTable Mod conj ss ** {adv = ss.adv}; + ConjAP conj ss = ss ** conjunctDistrTable Mod conj ss ; -- Adv isn't changed ConjRS conj rs = conjunctDistrTable Agr conj rs ** { c = rs.c}; ---- These fun's are generated from the list cat's. @@ -32,15 +32,14 @@ concrete ConjunctionPes of Conjunction = BaseRS x y = twoTable Agr x y ** {c = x.c}; ConsNP xs x = xs ** consrTable Mod 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 Mod x y ** {adv = x.adv}; - ConsAP xs x = consrTable Mod comma xs x ** {adv = x.adv}; -- Table3 Number Gender Case comma xs x ;-- ** {isPre = andB xs.isPre x.isPre} ; + BaseAP x y = y ** twoTable Mod x y ; + ConsAP xs x = xs ** consrTable Mod comma xs x ; -- Table3 Number Gender Case comma xs x ;-- ** {isPre = andB xs.isPre x.isPre} ; lincat [S] = {s1,s2 : VVForm => Str} ; [Adv] = {s1,s2 : Str} ; [NP] = {s1,s2 : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool; compl:Str} ; - [AP] = {s1,s2 : Mod => Str ; adv : Str} ; + [AP] = {s1,s2 : Mod => Str ; adv : Str ; isPre : Bool} ; [RS] = {s1,s2 : Agr => Str }; } diff --git a/src/persian/LexiconPes.gf b/src/persian/LexiconPes.gf index 30fee4903..3073cef97 100644 --- a/src/persian/LexiconPes.gf +++ b/src/persian/LexiconPes.gf @@ -132,7 +132,7 @@ concrete LexiconPes of Lexicon = CatPes ** new_A = mkA "نو" "تازه"; newspaper_N = mkN01 "روزنامه" inanimate; oil_N = mkN "نفت" "نفت" inanimate; -- also "روغن" - old_A = mkA "پیر" "پیرانه"; + old_A = preA "پیر" "پیرانه" ; open_V2 = mkV2 (compoundV "باز" doVerb) "را"; paint_V2A = mkV2 (compoundV "رنگ" doVerb) "را" ; paper_N = mkN01 "کاغذ" inanimate; diff --git a/src/persian/MorphoPes.gf b/src/persian/MorphoPes.gf index ab02b8719..557a74736 100644 --- a/src/persian/MorphoPes.gf +++ b/src/persian/MorphoPes.gf @@ -147,7 +147,11 @@ oper --------------------------- -- Adjectives -------------------------- - Adjective : Type = {s : Mod => Str ; adv : Str} ; + Adjective : Type = { + s : Mod => Str ; + adv : Str ; + isPre : Bool + } ; mkAdj : Str -> Str -> Adjective = \adj,adv -> { s = table { Bare => adj; @@ -155,7 +159,7 @@ oper Clitic => mkEnclic adj ; Poss => mkPossStem adj } ; - adv = adv + adv = adv ; isPre = False }; ------------------------------------------------------------------ diff --git a/src/persian/NounPes.gf b/src/persian/NounPes.gf index c517e246d..62e3673ee 100644 --- a/src/persian/NounPes.gf +++ b/src/persian/NounPes.gf @@ -77,14 +77,14 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { NumCard n = n ** {isNum = True} ; NumDigits n = n ** {s = n.s ! NCard; isNum = True} ; - OrdDigits n = n ** {s = n.s ! NOrd ; isNum = True} ; + OrdDigits n = n ** {s = n.s ! NOrd ; isNum = True ; isPre=False} ; NumNumeral n = n ** {s = n.s ! NCard; isNum = True} ; - OrdNumeral n = n ** {s = n.s ! NOrd ; isNum = True} ; + OrdNumeral n = n ** {s = n.s ! NOrd ; isNum = True ; isPre=False} ; -- to here AdNum adn num = num ** {s = adn.s ++ num.s} ; - OrdSuperl a = {s = a.s ! Bare ++ taryn; n = Sg ; isNum=False} ; -- check the form of adjective + OrdSuperl a = {s = a.s ! Bare ++ taryn; n = Sg ; isNum=False ; isPre = True} ; -- check the form of adjective DefArt = {s = \\_,_ => [] ; mod = Bare} ; IndefArt = {s = table {Sg => \\_ => IndefArticle ; Pl => \\_ => []} ; mod = Bare} ; @@ -121,7 +121,9 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { } ; AdjCN ap cn = cn ** { - s = \\n,ez => cn.s ! n ! Ezafe ++ ap.s ! ez ; + s = \\n,m => case ap.isPre of { + True => ap.s ! Bare ++ cn.s ! n ! m ; -- TODO check mod of ap + False => cn.s ! n ! Ezafe ++ ap.s ! m } ; hasAdj = True } ; diff --git a/src/persian/ParadigmsPes.gf b/src/persian/ParadigmsPes.gf index 30faba830..127c717aa 100644 --- a/src/persian/ParadigmsPes.gf +++ b/src/persian/ParadigmsPes.gf @@ -282,6 +282,8 @@ oper = \a,c -> lin A2 (mkAdj a a ** {c2 = c}) } ; + preA : (adj,adv : Str) -> A = \adj,adv -> + lin A ((mkAdj adj adv) ** {isPre=True}) ; {- -- Demonstrative Pronouns diff --git a/src/persian/SymbolPes.gf b/src/persian/SymbolPes.gf index 6012cf555..e349fd2d4 100644 --- a/src/persian/SymbolPes.gf +++ b/src/persian/SymbolPes.gf @@ -28,7 +28,7 @@ concrete SymbolPes of Symbol = CatPes ** open Prelude, ResPes in { SymbS sy = {s = \\_ => sy.s} ; SymbNum sy = { s = sy.s ; n = Pl } ; - SymbOrd sy = { s = sy.s ++ "wN" ; n = Pl; isNum=False} ; + SymbOrd sy = { s = sy.s ++ "wN" ; n = Pl; isNum,isPre=False} ; lincat