diff --git a/src/persian/AdjectivePes.gf b/src/persian/AdjectivePes.gf index 253c73a73..cad4b4a9a 100644 --- a/src/persian/AdjectivePes.gf +++ b/src/persian/AdjectivePes.gf @@ -7,20 +7,20 @@ concrete AdjectivePes of Adjective = CatPes ** open ResPes, Prelude in { UseComparA a = a ; ComparA a np = a ** { - s = \\m => a.s ! m ++ "تر" ++ "از" ++ np.s ! Bare ; - adv = a.adv ++ "تر" ++ "از" ++ np.s ! Bare ; + s = \\m => a.s ! m ++ "تر" ++ "از" ++ np2str np ; + adv = a.adv ++ "تر" ++ "از" ++ np2str np ; } ; ---- $SuperlA$ belongs to determiner syntax in $Noun$. ComplA2 a np = a ** { - s = \\m => np.s ! Bare ++ a.c2 ++ a.s ! m ; - adv = np.s ! Bare ++ a.c2 ++ a.adv + s = \\m => np2str np ++ a.c2 ++ a.s ! m ; + adv = np2str np ++ a.c2 ++ a.adv } ; ReflA2 a = a ** { - s = \\m => a.s ! m ++ reflPron ! defaultAgr ; ---- need to be fixed - adv = a.adv ++ reflPron ! defaultAgr + s = \\m => a.s ! m ++ reflPron ! defaultAgr ! Bare ; ---- need to be fixed + adv = a.adv ++ reflPron ! defaultAgr ! Bare } ; SentAP ap sc = ap ** { @@ -36,7 +36,7 @@ concrete AdjectivePes of Adjective = CatPes ** open ResPes, Prelude in { UseA2 a = a ; CAdvAP cadv ap np = ap ** { - s = \\m => cadv.s ++ np.s ! Bare ++ ap.s ! m ; + s = \\m => cadv.s ++ np2str np ++ ap.s ! m ; adv = cadv.s ++ ap.adv } ; diff --git a/src/persian/ConjunctionPes.gf b/src/persian/ConjunctionPes.gf index 996f601d0..df292d93f 100644 --- a/src/persian/ConjunctionPes.gf +++ b/src/persian/ConjunctionPes.gf @@ -38,7 +38,7 @@ concrete ConjunctionPes of Conjunction = lincat [S] = {s1,s2 : VVForm => Str} ; [Adv] = {s1,s2 : Str} ; - [NP] = {s1,s2 : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool; compl:Str} ; + [NP] = {s1,s2 : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool} ; [AP] = {s1,s2 : Mod => Str ; adv : Str ; isPre : Bool} ; [RS] = {s1,s2 : Agr => Str }; diff --git a/src/persian/ExtendPes.gf b/src/persian/ExtendPes.gf index da5754392..2a8f7fafa 100644 --- a/src/persian/ExtendPes.gf +++ b/src/persian/ExtendPes.gf @@ -12,7 +12,7 @@ lin -- NP -> Quant ; -- this man's GenNP np = np ** { mod = Ezafe ; -- the possessed will get Ezafe - s = \\num,cmpd => np.s ! Bare -- possesser is unmarked; https://sites.la.utexas.edu/persian_online_resources/language-specific-grammar/ezfe/ + s = \\num,cmpd => np2str np -- possesser is unmarked; https://sites.la.utexas.edu/persian_online_resources/language-specific-grammar/ezfe/ } ; -- : NP -> NP -> NP diff --git a/src/persian/IdiomPes.gf b/src/persian/IdiomPes.gf index cef5b6f79..d4cfcdcf8 100644 --- a/src/persian/IdiomPes.gf +++ b/src/persian/IdiomPes.gf @@ -9,7 +9,7 @@ lin GenericCl vp = mkSClause "آدم" (agrP3 Sg) vp ; CleftNP np rs = - let cl = mkSClause (np.s ! Bare) (np.a) (predV beVerb); + let cl = mkSClause (np2str np) (np.a) (predV beVerb); in {s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a }; @@ -17,11 +17,11 @@ lin ExistNP np = mkSClause [] (agrP3 (fromAgr np.a).n) - (insertComp (\\_ => np.s ! Bare) (predV existVerb)) ; + (insertComp (\\_ => np2str np) (predV existVerb)) ; ExistNPAdv np adv = mkSClause [] (agrP3 (fromAgr np.a).n) - (insertComp (\\_ => np.s ! Bare ++ adv.s) + (insertComp (\\_ => np2str np ++ adv.s) (predV existVerb) ) ; @@ -36,7 +36,7 @@ lin ImpPl1 vp = let a = agrP1 Pl in {s = "بیایید" ++ showVPH (VSubj Pos a) a vp } ; ImpP3 np vp = - {s = "بگذارید" ++ np.s ! Bare ++ showVPH (VSubj Pos np.a) np.a vp}; + {s = "بگذارید" ++ np2str np ++ showVPH (VSubj Pos np.a) np.a vp}; oper existVerb = mkV "وجود" haveVerb ; diff --git a/src/persian/MorphoPes.gf b/src/persian/MorphoPes.gf index 557a74736..0e2eb679b 100644 --- a/src/persian/MorphoPes.gf +++ b/src/persian/MorphoPes.gf @@ -91,22 +91,20 @@ oper _ => str + "ی" -- any other case: just a single ی } ; + modTable : Str -> Mod => Str = \str -> + table {Bare => str ; + Ezafe => mkEzafe str ; + Clitic => mkEnclic str ; + Poss => mkPossStem str } ; + Noun = { s : Number => Mod => Str ; animacy : Animacy ; - isCmpd : CmpdStatus -- Affects possession: awkward to use poss. suff. with compound nouns + isCmpd : CmpdStatus -- Affects possession: awkward to use poss. suff. with compound nouns } ; mkN : (x1,x2 : Str) -> Animacy -> Noun = \sg,pl,ani -> indeclN sg ** { - s = table { - Sg => table {Bare => sg ; - Ezafe => mkEzafe sg ; - Clitic => mkEnclic sg ; - Poss => mkPossStem sg } ; - Pl => table {Bare => pl ; - Ezafe => mkEzafe pl ; - Clitic => mkEnclic pl ; - Poss => mkPossStem pl }} + s = table {Sg => modTable sg ; Pl => modTable pl} } ; indeclN : Str -> Noun = \s -> { diff --git a/src/persian/NounPes.gf b/src/persian/NounPes.gf index 62e3673ee..043d3da19 100644 --- a/src/persian/NounPes.gf +++ b/src/persian/NounPes.gf @@ -15,10 +15,9 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { NotCmpd => det.s ; -- possessive suffix IsCmpd => det.sp } ; -- full form in case mod of { - Bare => detStr ++ cn.s ! num ! m ; -- det doesn't require a special form, keep the Mod=>Str table - x => cn.s ! num ! x ++ detStr } ; -- det requires a special form - a = agrP3 det.n ; - compl = cn.compl ! det.n + Bare => detStr ++ cn.s ! num ! m ++ cn.compl ! det.n ; -- det doesn't require a special form, keep the Mod=>Str table + x => cn.s ! num ! x ++ detStr ++ cn.compl ! det.n } ; -- det requires a special form + a = agrP3 det.n } ; UsePN pn = emptyNP ** pn ** {s = \\_ => pn.s} ; @@ -33,7 +32,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { } ; RelNP np rs = np ** { - s = \\ez => np.s ! ez ++ rs.s ! np.a + s = \\m => np.s ! Clitic ++ rs.s ! np.a } ; AdvNP np adv = np ** { @@ -61,7 +60,6 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { a = agrP3 det.n ; hasAdj = False ; animacy = Inanimate ; - compl = [] } ; PossPron p = { @@ -69,7 +67,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { NotCmpd => BIND ++ p.ps ; IsCmpd => p.s } ; -- is a compound a = p.a ; - mod = Poss} ; -- make into Ezafe if DetCN if N is compound + mod = Poss} ; -- is changed into Ezafe in DetCN, if the CN is compound NumSg = {s = [] ; n = Sg ; isNum = False} ; NumPl = {s = [] ; n = Pl ; isNum = False} ; @@ -90,9 +88,8 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { IndefArt = {s = table {Sg => \\_ => IndefArticle ; Pl => \\_ => []} ; mod = Bare} ; MassNP cn = cn ** { - s = cn.s ! Sg ; + s = \\m => cn.s ! Sg ! m ++ cn.compl ! Sg ; a = agrP3 Sg ; - compl = cn.compl ! Sg } ; UseN, @@ -110,13 +107,13 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { ComplN2 n2 np = n2 ** { s = \\n,m => n2.s ! n ! Ezafe ; - compl = \\_ => n2.compl ++ n2.c2 ++ np.s ! Bare ; + compl = \\_ => n2.compl ++ n2.c2 ++ np2str np ; hasAdj = False }; ComplN3 n3 np = n3 ** { s = \\n,m => n3.s ! n ! Ezafe ; - compl = n3.c2 ++ np.s ! Bare ; + compl = n3.c2 ++ np2str np ; c = n3.c3; } ; @@ -129,15 +126,21 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { RelCN cn rs = cn ** { s = \\n,ez => cn.s ! n ! Clitic ; - compl = \\n => rs.s ! agrP3 n ; + compl = \\n => cn.compl ! n ++ rs.s ! agrP3 n ; } ; - AdvCN cn ad = cn ** {s = \\n,m => cn.s ! n ! Ezafe ++ ad.s} ; + AdvCN cn ad = cn ** { + s = \\n,m => cn.s ! n ! Ezafe ; + compl = \\n => cn.compl ! n ++ ad.s} ; - SentCN cn sc = cn ** {compl = \\n => sc.s} ; + SentCN cn sc = cn ** {compl = \\n => cn.compl ! n ++ sc.s} ; -- correct for /city Paris/, incorrect for /king John/ -- ApposNP in ExtendPes works for /king John/ (no ezafe). ApposCN cn np = cn ** {s = \\n,m => cn.s ! n ! Ezafe ++ np.s ! m} ; + -- : CN -> NP -> CN ; -- house of Paris, house of mine + PossNP cn np = cn ** { + s = \\n,m => cn.s ! n ! Ezafe ; -- TODO or here for " " + compl = \\n => cn.compl ! n ++ np2str np } ; -- " " } diff --git a/src/persian/QuestionPes.gf b/src/persian/QuestionPes.gf index 2fba87468..8f5b753aa 100644 --- a/src/persian/QuestionPes.gf +++ b/src/persian/QuestionPes.gf @@ -22,7 +22,7 @@ concrete QuestionPes of Question = CatPes ** open ResPes, Prelude in { }; QuestIComp icomp np = - let cl = mkSClause (np.s ! Bare ++ icomp.s) np.a (predV beVerb) + let cl = mkSClause (np2str np ++ icomp.s) np.a (predV beVerb) in {s = \\t,p => cl.s ! t ! p ! ODir}; PrepIP p ip = {s = p.s ++ ip.s } ; diff --git a/src/persian/ResPes.gf b/src/persian/ResPes.gf index cca04f258..ebb15c7d7 100644 --- a/src/persian/ResPes.gf +++ b/src/persian/ResPes.gf @@ -28,7 +28,6 @@ resource ResPes = MorphoPes ** open Prelude,Predef in { s : Mod => Str ; -- NP can appear with a clitic, need to keep Mod open a : Agr ; hasAdj : Bool ; -- to get the right form when NP is a predicate - compl : Str ; -- to make possessive suffix attach to the right word animacy : Animacy -- to get the right relative pronoun } ; @@ -38,7 +37,6 @@ resource ResPes = MorphoPes ** open Prelude,Predef in { a = defaultAgr ; hasAdj = False ; animacy = Inanimate ; - compl = [] } ; indeclNP : Str -> NP = \s -> emptyNP ** {s = \\m => s} ; @@ -49,7 +47,7 @@ resource ResPes = MorphoPes ** open Prelude,Predef in { } ; np2str : NP -> Str = \np -> - np.s ! Bare ++ np.compl ; + np.s ! Bare ; cn2str : CN -> Str = \cn -> cn.s ! Sg ! Bare ++ cn.compl ! Sg ; diff --git a/src/persian/SymbolPes.gf b/src/persian/SymbolPes.gf index e349fd2d4..7c23265ba 100644 --- a/src/persian/SymbolPes.gf +++ b/src/persian/SymbolPes.gf @@ -11,19 +11,16 @@ concrete SymbolPes of Symbol = CatPes ** open Prelude, ResPes in { FloatPN i = {s = i.s ; animacy = Inanimate} ; NumPN i = {s = i.s ; animacy = Inanimate} ; CNIntNP cn i = cn ** { - s = \\ez => cn.s ! Sg ! Ezafe ++ i.s ; - a = agrP3 Sg ; - compl = cn.compl ! Sg + s = \\ez => cn.s ! Sg ! Ezafe ++ i.s ++ cn.compl ! Sg ; + a = agrP3 Sg } ; CNSymbNP det cn xs = cn ** { - s = \\ez => det.s ++ cn.s ! det.n ! Ezafe ++ xs.s ; - a = agrP3 det.n ; - compl = cn.compl ! det.n + s = \\ez => det.s ++ cn.s ! det.n ! Ezafe ++ xs.s ++ cn.compl ! det.n ; + a = agrP3 det.n } ; CNNumNP cn i = cn ** { - s = \\ez => cn.s ! Sg ! Ezafe ++ i.s ; + s = \\ez => cn.s ! Sg ! Ezafe ++ i.s ++ cn.compl ! Sg ; a = agrP3 Sg ; - compl = cn.compl ! Sg } ; SymbS sy = {s = \\_ => sy.s} ; @@ -40,12 +37,6 @@ lin BaseSymb = infixSS "تE" ; ConsSymb = infixSS "" ; ---oper - -- Note: this results in a space before 's, but there's - -- not mauch we can do about that. --- addGenitiveS : Str ; --- addGenitiveS s = --- s ++ "از" ; - + -- TODO: what are wN and تE? /IL }