forked from GitHub/gf-rgl
@@ -7,20 +7,20 @@ concrete AdjectivePes of Adjective = CatPes ** open ResPes, Prelude in {
|
|||||||
UseComparA a = a ;
|
UseComparA a = a ;
|
||||||
|
|
||||||
ComparA a np = a ** {
|
ComparA a np = a ** {
|
||||||
s = \\m => a.s ! m ++ "تر" ++ "از" ++ np.s ! Bare ;
|
s = \\m => a.s ! m ++ "تر" ++ "از" ++ np2str np ;
|
||||||
adv = a.adv ++ "تر" ++ "از" ++ np.s ! Bare ;
|
adv = a.adv ++ "تر" ++ "از" ++ np2str np ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---- $SuperlA$ belongs to determiner syntax in $Noun$.
|
---- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||||
|
|
||||||
ComplA2 a np = a ** {
|
ComplA2 a np = a ** {
|
||||||
s = \\m => np.s ! Bare ++ a.c2 ++ a.s ! m ;
|
s = \\m => np2str np ++ a.c2 ++ a.s ! m ;
|
||||||
adv = np.s ! Bare ++ a.c2 ++ a.adv
|
adv = np2str np ++ a.c2 ++ a.adv
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ReflA2 a = a ** {
|
ReflA2 a = a ** {
|
||||||
s = \\m => a.s ! m ++ reflPron ! defaultAgr ; ---- need to be fixed
|
s = \\m => a.s ! m ++ reflPron ! defaultAgr ! Bare ; ---- need to be fixed
|
||||||
adv = a.adv ++ reflPron ! defaultAgr
|
adv = a.adv ++ reflPron ! defaultAgr ! Bare
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SentAP ap sc = ap ** {
|
SentAP ap sc = ap ** {
|
||||||
@@ -36,7 +36,7 @@ concrete AdjectivePes of Adjective = CatPes ** open ResPes, Prelude in {
|
|||||||
UseA2 a = a ;
|
UseA2 a = a ;
|
||||||
|
|
||||||
CAdvAP cadv ap np = ap ** {
|
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
|
adv = cadv.s ++ ap.adv
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ concrete ConjunctionPes of Conjunction =
|
|||||||
lincat
|
lincat
|
||||||
[S] = {s1,s2 : VVForm => Str} ;
|
[S] = {s1,s2 : VVForm => Str} ;
|
||||||
[Adv] = {s1,s2 : 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} ;
|
[AP] = {s1,s2 : Mod => Str ; adv : Str ; isPre : Bool} ;
|
||||||
[RS] = {s1,s2 : Agr => Str };
|
[RS] = {s1,s2 : Agr => Str };
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ lin
|
|||||||
-- NP -> Quant ; -- this man's
|
-- NP -> Quant ; -- this man's
|
||||||
GenNP np = np ** {
|
GenNP np = np ** {
|
||||||
mod = Ezafe ; -- the possessed will get Ezafe
|
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
|
-- : NP -> NP -> NP
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete IdiomPes of Idiom = CatPes ** open Prelude,Predef, ResPes in {
|
concrete IdiomPes of Idiom = CatPes ** open Prelude,ParadigmsPes,ResPes in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
flags coding = utf8;
|
flags coding = utf8;
|
||||||
@@ -9,7 +9,7 @@ lin
|
|||||||
GenericCl vp = mkSClause "آدم" (agrP3 Sg) vp ;
|
GenericCl vp = mkSClause "آدم" (agrP3 Sg) vp ;
|
||||||
|
|
||||||
CleftNP np rs =
|
CleftNP np rs =
|
||||||
let cl = mkSClause (np.s ! Bare) (np.a) (predV beVerb);
|
let cl = mkSClause (np2str np) (np.a) (predV beVerb);
|
||||||
in
|
in
|
||||||
{s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a };
|
{s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a };
|
||||||
|
|
||||||
@@ -17,7 +17,14 @@ lin
|
|||||||
|
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
mkSClause [] (agrP3 (fromAgr np.a).n)
|
mkSClause [] (agrP3 (fromAgr np.a).n)
|
||||||
(insertComp (\\_ => np.s ! Bare) (predV beVerb)) ;
|
(insertComp (\\_ => np2str np) (predV existVerb)) ;
|
||||||
|
|
||||||
|
ExistNPAdv np adv =
|
||||||
|
mkSClause [] (agrP3 (fromAgr np.a).n)
|
||||||
|
(insertComp (\\_ => np2str np ++ adv.s)
|
||||||
|
(predV existVerb)
|
||||||
|
) ;
|
||||||
|
|
||||||
|
|
||||||
ExistIP ip =
|
ExistIP ip =
|
||||||
let cl = mkSClause ip.s (agrP3 ip.n) (predV beVerb);
|
let cl = mkSClause ip.s (agrP3 ip.n) (predV beVerb);
|
||||||
@@ -29,7 +36,9 @@ lin
|
|||||||
ImpPl1 vp = let a = agrP1 Pl in
|
ImpPl1 vp = let a = agrP1 Pl in
|
||||||
{s = "بیایید" ++ showVPH (VSubj Pos a) a vp } ;
|
{s = "بیایید" ++ showVPH (VSubj Pos a) a vp } ;
|
||||||
ImpP3 np 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 ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,22 +91,20 @@ oper
|
|||||||
_ => str + "ی" -- any other case: just a single ی
|
_ => 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 = {
|
Noun = {
|
||||||
s : Number => Mod => Str ;
|
s : Number => Mod => Str ;
|
||||||
animacy : Animacy ;
|
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 ** {
|
mkN : (x1,x2 : Str) -> Animacy -> Noun = \sg,pl,ani -> indeclN sg ** {
|
||||||
s = table {
|
s = table {Sg => modTable sg ; Pl => modTable pl}
|
||||||
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 }}
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
indeclN : Str -> Noun = \s -> {
|
indeclN : Str -> Noun = \s -> {
|
||||||
|
|||||||
@@ -15,10 +15,9 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
NotCmpd => det.s ; -- possessive suffix
|
NotCmpd => det.s ; -- possessive suffix
|
||||||
IsCmpd => det.sp } ; -- full form
|
IsCmpd => det.sp } ; -- full form
|
||||||
in case mod of {
|
in case mod of {
|
||||||
Bare => detStr ++ cn.s ! num ! m ; -- det doesn't require a special form, keep the Mod=>Str table
|
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 } ; -- det requires a special form
|
x => cn.s ! num ! x ++ detStr ++ cn.compl ! det.n } ; -- det requires a special form
|
||||||
a = agrP3 det.n ;
|
a = agrP3 det.n
|
||||||
compl = cn.compl ! det.n
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UsePN pn = emptyNP ** pn ** {s = \\_ => pn.s} ;
|
UsePN pn = emptyNP ** pn ** {s = \\_ => pn.s} ;
|
||||||
@@ -33,7 +32,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelNP np rs = np ** {
|
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 ** {
|
AdvNP np adv = np ** {
|
||||||
@@ -61,7 +60,6 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
a = agrP3 det.n ;
|
a = agrP3 det.n ;
|
||||||
hasAdj = False ;
|
hasAdj = False ;
|
||||||
animacy = Inanimate ;
|
animacy = Inanimate ;
|
||||||
compl = []
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PossPron p = {
|
PossPron p = {
|
||||||
@@ -69,7 +67,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
NotCmpd => BIND ++ p.ps ;
|
NotCmpd => BIND ++ p.ps ;
|
||||||
IsCmpd => p.s } ; -- is a compound
|
IsCmpd => p.s } ; -- is a compound
|
||||||
a = p.a ;
|
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} ;
|
NumSg = {s = [] ; n = Sg ; isNum = False} ;
|
||||||
NumPl = {s = [] ; n = Pl ; 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} ;
|
IndefArt = {s = table {Sg => \\_ => IndefArticle ; Pl => \\_ => []} ; mod = Bare} ;
|
||||||
|
|
||||||
MassNP cn = cn ** {
|
MassNP cn = cn ** {
|
||||||
s = cn.s ! Sg ;
|
s = \\m => cn.s ! Sg ! m ++ cn.compl ! Sg ;
|
||||||
a = agrP3 Sg ;
|
a = agrP3 Sg ;
|
||||||
compl = cn.compl ! Sg
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UseN,
|
UseN,
|
||||||
@@ -110,13 +107,13 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
|
|
||||||
ComplN2 n2 np = n2 ** {
|
ComplN2 n2 np = n2 ** {
|
||||||
s = \\n,m => n2.s ! n ! Ezafe ;
|
s = \\n,m => n2.s ! n ! Ezafe ;
|
||||||
compl = \\_ => n2.compl ++ n2.c2 ++ np.s ! Bare ;
|
compl = \\_ => n2.compl ++ n2.c2 ++ np2str np ;
|
||||||
hasAdj = False
|
hasAdj = False
|
||||||
};
|
};
|
||||||
|
|
||||||
ComplN3 n3 np = n3 ** {
|
ComplN3 n3 np = n3 ** {
|
||||||
s = \\n,m => n3.s ! n ! Ezafe ;
|
s = \\n,m => n3.s ! n ! Ezafe ;
|
||||||
compl = n3.c2 ++ np.s ! Bare ;
|
compl = n3.c2 ++ np2str np ;
|
||||||
c = n3.c3;
|
c = n3.c3;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -129,15 +126,21 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
|
|
||||||
RelCN cn rs = cn ** {
|
RelCN cn rs = cn ** {
|
||||||
s = \\n,ez => cn.s ! n ! Clitic ;
|
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/
|
-- correct for /city Paris/, incorrect for /king John/
|
||||||
-- ApposNP in ExtendPes works for /king John/ (no ezafe).
|
-- ApposNP in ExtendPes works for /king John/ (no ezafe).
|
||||||
ApposCN cn np = cn ** {s = \\n,m => cn.s ! n ! Ezafe ++ np.s ! m} ;
|
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 "<house of mine> <on the hill>"
|
||||||
|
compl = \\n => cn.compl ! n ++ np2str np } ; -- "<house> <on the hill of mine>"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ oper
|
|||||||
subjunctive : VVForm ; -- The verbal complement of VV is in subjunctive
|
subjunctive : VVForm ; -- The verbal complement of VV is in subjunctive
|
||||||
indicative : VVForm ; -- The verbal complement of VV is in indicative
|
indicative : VVForm ; -- The verbal complement of VV is in indicative
|
||||||
|
|
||||||
|
Mod : Type ; -- Argument to mkDet and mkPrep
|
||||||
|
ezafe : Mod ; -- e.g. mkPrep "برای" ezafe
|
||||||
|
-- poss : Mod ; -- TODO is this needed?
|
||||||
|
--clitic : Mod ; -- TODO is this needed?
|
||||||
--2 Nouns
|
--2 Nouns
|
||||||
|
|
||||||
mkN : overload {
|
mkN : overload {
|
||||||
@@ -66,9 +70,11 @@ oper
|
|||||||
|
|
||||||
mkDet = overload {
|
mkDet = overload {
|
||||||
mkDet : Str -> Number -> Det -- Takes a string, number (sg/pl) and returns a det which is not a numeral
|
mkDet : Str -> Number -> Det -- Takes a string, number (sg/pl) and returns a det which is not a numeral
|
||||||
= \s1,n -> lin Det (makeDet s1 n False);
|
= \s,n -> lin Det (makeDet s n False);
|
||||||
mkDet : Str -> Number -> Bool -> Det -- Takes a string, number (sg/pl) and a Boolean for whether the det is a numeral
|
mkDet : Str -> Number -> Bool -> Det -- As above + a Boolean for whether the det is a numeral
|
||||||
= \s1,n,b -> lin Det (makeDet s1 n b)
|
= \s,n,b -> lin Det (makeDet s n b) ;
|
||||||
|
mkDet : Str -> Number -> Bool -> Mod -> Det -- As above + Mod for which form the determiner expects its argument to be (default bare)
|
||||||
|
= \s,n,b,m -> lin Det (makeDet s n b ** {mod=m})
|
||||||
};
|
};
|
||||||
|
|
||||||
{-
|
{-
|
||||||
@@ -173,8 +179,13 @@ oper
|
|||||||
|
|
||||||
----2 Prepositions
|
----2 Prepositions
|
||||||
|
|
||||||
mkPrep : Str -> Prep ; -- Takes a string, returns a preposition.
|
mkPrep = overload {
|
||||||
mkPrep str = lin Prep {s = str ; ra = []} ;
|
mkPrep : Str -> Prep -- Takes a string, returns a preposition.
|
||||||
|
= \str -> lin Prep {s = str ; ra = [] ; mod = Bare} ;
|
||||||
|
mkPrep : Str -> Mod -> Prep -- Takes a string and Mod (so far only option is ezafe), returns a preposition.
|
||||||
|
= \str,m -> lin Prep {s = str ; ra = [] ; mod=m}
|
||||||
|
} ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
--3 Determiners and quantifiers
|
--3 Determiners and quantifiers
|
||||||
|
|
||||||
@@ -224,6 +235,9 @@ oper
|
|||||||
subjunctive = ResPes.Subj ;
|
subjunctive = ResPes.Subj ;
|
||||||
indicative = Indic ;
|
indicative = Indic ;
|
||||||
|
|
||||||
|
Mod = ResPes.Mod ;
|
||||||
|
ezafe = ResPes.Ezafe ;
|
||||||
|
|
||||||
-- Removed mkV_1, mkV_2, mkN01 and mkN02 from public API, still available for
|
-- Removed mkV_1, mkV_2, mkN01 and mkN02 from public API, still available for
|
||||||
-- any applications that open ParadigmsPes. /IL 2019-02-08
|
-- any applications that open ParadigmsPes. /IL 2019-02-08
|
||||||
mkV_1 : Str -> V
|
mkV_1 : Str -> V
|
||||||
@@ -329,15 +343,15 @@ oper
|
|||||||
mkV2 : V -> Str -> V2
|
mkV2 : V -> Str -> V2
|
||||||
= \v,ra -> lin V2 (v ** {c2 = prepOrRa ra}) ;
|
= \v,ra -> lin V2 (v ** {c2 = prepOrRa ra}) ;
|
||||||
mkV2 : V -> Str -> Bool -> V2
|
mkV2 : V -> Str -> Bool -> V2
|
||||||
= \v,p,b -> lin V2 (v ** {c2 = {ra = [] ; s = p}}) ;
|
= \v,p,b -> lin V2 (v ** {c2 = {ra = [] ; s = p ; mod=Bare}}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
prepOrRa : Str -> Compl = \s -> case s of {
|
prepOrRa : Str -> Compl = \s -> case s of {
|
||||||
"را" => {s = [] ; ra = "را"} ;
|
"را" => {s = [] ; ra = "را" ; mod=Bare} ;
|
||||||
prep => {s = prep ; ra = []}
|
prep => {s = prep ; ra = []; mod=Bare}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkPost : Str -> Prep = \s -> lin Prep {s=[] ; ra=s} ;
|
mkPost : Str -> Prep = \s -> lin Prep {s=[] ; ra=s ; mod=Bare} ;
|
||||||
|
|
||||||
mkN2 = overload {
|
mkN2 = overload {
|
||||||
mkN2 : Str -> N2 -- Predictable N2 without complement
|
mkN2 : Str -> N2 -- Predictable N2 without complement
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ concrete QuestionPes of Question = CatPes ** open ResPes, Prelude in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
QuestIComp icomp np =
|
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};
|
in {s = \\t,p => cl.s ! t ! p ! ODir};
|
||||||
|
|
||||||
PrepIP p ip = {s = p.s ++ ip.s } ;
|
PrepIP p ip = {s = p.s ++ ip.s } ;
|
||||||
|
|||||||
@@ -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
|
s : Mod => Str ; -- NP can appear with a clitic, need to keep Mod open
|
||||||
a : Agr ;
|
a : Agr ;
|
||||||
hasAdj : Bool ; -- to get the right form when NP is a predicate
|
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
|
animacy : Animacy -- to get the right relative pronoun
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -38,7 +37,6 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
|
|||||||
a = defaultAgr ;
|
a = defaultAgr ;
|
||||||
hasAdj = False ;
|
hasAdj = False ;
|
||||||
animacy = Inanimate ;
|
animacy = Inanimate ;
|
||||||
compl = []
|
|
||||||
} ;
|
} ;
|
||||||
indeclNP : Str -> NP = \s ->
|
indeclNP : Str -> NP = \s ->
|
||||||
emptyNP ** {s = \\m => s} ;
|
emptyNP ** {s = \\m => s} ;
|
||||||
@@ -49,7 +47,7 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
np2str : NP -> Str = \np ->
|
np2str : NP -> Str = \np ->
|
||||||
np.s ! Bare ++ np.compl ;
|
np.s ! Bare ;
|
||||||
|
|
||||||
cn2str : CN -> Str = \cn ->
|
cn2str : CN -> Str = \cn ->
|
||||||
cn.s ! Sg ! Bare ++ cn.compl ! Sg ;
|
cn.s ! Sg ! Bare ++ cn.compl ! Sg ;
|
||||||
@@ -102,7 +100,7 @@ oper
|
|||||||
vp.comp ! agr ++ vp.prefix ++ vp.s ! vf -- vp.ad is missing on purpose! we add it in insertVV.
|
vp.comp ! agr ++ vp.prefix ++ vp.s ! vf -- vp.ad is missing on purpose! we add it in insertVV.
|
||||||
++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vp.embComp ;
|
++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vp.embComp ;
|
||||||
|
|
||||||
Compl : Type = {s : Str ; ra : Str} ;
|
Compl : Type = {s : Str ; ra : Str ; mod : Mod} ;
|
||||||
|
|
||||||
VPHSlash : Type = VPH ** {
|
VPHSlash : Type = VPH ** {
|
||||||
c2 : Compl ; -- prep or ra for the complement
|
c2 : Compl ; -- prep or ra for the complement
|
||||||
@@ -126,17 +124,21 @@ oper
|
|||||||
---------------------
|
---------------------
|
||||||
-- VP complementation
|
-- VP complementation
|
||||||
---------------------
|
---------------------
|
||||||
appComp : Compl -> Str -> Str = \c2,obj ->
|
appComp : Compl -> (Mod=>Str) -> Str = \c2,obj ->
|
||||||
c2.s ++ obj ++ c2.ra ;
|
c2.s ++ obj ! c2.mod ++ c2.ra ;
|
||||||
|
|
||||||
insertComp : (Agr => Str) -> VPH -> VPH = \obj,vp -> vp ** {
|
insertComp : (Agr => Str) -> VPH -> VPH = \obj,vp -> vp ** {
|
||||||
comp = \\a => vp.comp ! a ++ obj ! a
|
comp = \\a => vp.comp ! a ++ obj ! a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertCompPre : (Agr=>Str) -> VPHSlash -> VPH = \obj,vp -> vp ** {
|
insertCompPre : (Agr=>Mod=>Str) -> VPHSlash -> VPH = \obj,vp -> vp ** {
|
||||||
comp = \\a => appComp vp.c2 (obj ! a) ++ vp.comp ! a
|
comp = \\a => appComp vp.c2 (obj ! a) ++ vp.comp ! a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
insertCompPost : (Agr=>Mod=>Str) -> VPHSlash -> VPH = \obj,vp -> vp ** {
|
||||||
|
comp = \\a => vp.comp ! a ++ appComp vp.c2 (obj ! a)
|
||||||
|
} ;
|
||||||
|
|
||||||
insertVV : VV -> VPH -> VPH = \vv,vp -> predV vv ** {
|
insertVV : VV -> VPH -> VPH = \vv,vp -> predV vv ** {
|
||||||
vComp = \\a,t => vp.vComp ! a ! t ++ complVV vv vp ! a ! t ;
|
vComp = \\a,t => vp.vComp ! a ! t ++ complVV vv vp ! a ! t ;
|
||||||
vvType = case vv.isDef of {True => DefVV ; _ => FullVV} ;
|
vvType = case vv.isDef of {True => DefVV ; _ => FullVV} ;
|
||||||
@@ -152,8 +154,7 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
complSlash : VPHSlash -> NP -> VPH = \vp,np -> vp ** {
|
complSlash : VPHSlash -> NP -> VPH = \vp,np -> vp ** {
|
||||||
comp = \\a => appComp vp.c2 (np.s ! Bare)
|
comp = \\a => appComp vp.c2 np.s ++ vp.comp ! a ;
|
||||||
++ np.compl ++ vp.comp ! a ;
|
|
||||||
obj = vp.obj ++ vp.agrObj ! np.a -- "beg her to buy", buy agrees with her
|
obj = vp.obj ++ vp.agrObj ! np.a -- "beg her to buy", buy agrees with her
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -264,14 +265,13 @@ oper
|
|||||||
-- Reflexive pronouns
|
-- Reflexive pronouns
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
reflPron : Agr => Str = table {
|
reflPron : Agr => Mod => Str = table {
|
||||||
Ag Sg P1 => "خودم" ;
|
Ag Sg P1 => modTable "خودم" ;
|
||||||
Ag Sg P2 => "خودت" ;
|
Ag Sg P2 => modTable "خودت" ;
|
||||||
Ag Sg P3 => "خودش" ;
|
Ag Sg P3 => modTable "خودش" ;
|
||||||
Ag Pl P1 => "خودمان" ;
|
Ag Pl P1 => modTable "خودمان" ;
|
||||||
Ag Pl P2 => "خودتان" ;
|
Ag Pl P2 => modTable "خودتان" ;
|
||||||
Ag Pl P3 => "خودشان"
|
Ag Pl P3 => modTable "خودشان"
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
getPron : Animacy -> Number -> Str = \ani,number ->
|
getPron : Animacy -> Number -> Str = \ani,number ->
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
-- everything_NP = R.indeclNP ["هر XE"]));
|
-- everything_NP = R.indeclNP ["هر XE"]));
|
||||||
everywhere_Adv = ss ["هر جا"] ;
|
everywhere_Adv = ss ["هر جا"] ;
|
||||||
few_Det = mkDet ["تعداد کمی"] Pl True; -- check
|
few_Det = mkDet ["تعداد کمی"] Pl True; -- check
|
||||||
for_Prep = mkPrep "برای" ;
|
for_Prep = mkPrep "برای" Ezafe ;
|
||||||
from_Prep = mkPrep "از" ;
|
from_Prep = mkPrep "از" ;
|
||||||
he_Pron = R.agr2pron ! Ag Sg P3 ;
|
he_Pron = R.agr2pron ! Ag Sg P3 ;
|
||||||
here_Adv = ss "اینجا" ;
|
here_Adv = ss "اینجا" ;
|
||||||
@@ -44,7 +44,7 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
in_Prep = mkPrep "در" ;
|
in_Prep = mkPrep "در" ;
|
||||||
it_Pron = R.agr2pron ! Ag Sg P3;
|
it_Pron = R.agr2pron ! Ag Sg P3;
|
||||||
less_CAdv = {s = "کمتر" ; p = ""} ;
|
less_CAdv = {s = "کمتر" ; p = ""} ;
|
||||||
many_Det = mkDet ["تعداد زیادی"] Pl True; -- check
|
many_Det = mkDet "بسیار" Pl False Ezafe ;
|
||||||
more_CAdv = {s = "بیشتر" ; p = "" } ;
|
more_CAdv = {s = "بیشتر" ; p = "" } ;
|
||||||
most_Predet = ss "اکثر";
|
most_Predet = ss "اکثر";
|
||||||
much_Det = mkDet ["مقدار زیادی"] Pl ;
|
much_Det = mkDet ["مقدار زیادی"] Pl ;
|
||||||
@@ -133,9 +133,6 @@ have_V2 = haveVerb ** {
|
|||||||
VSubj _ (Ag Pl P2) => "داشته باشید" ;
|
VSubj _ (Ag Pl P2) => "داشته باشید" ;
|
||||||
VSubj _ (Ag Pl P3) => "داشته باشند" ;
|
VSubj _ (Ag Pl P3) => "داشته باشند" ;
|
||||||
x => haveVerb.s ! x } ;
|
x => haveVerb.s ! x } ;
|
||||||
c2 = {
|
c2 = prepOrRa [] -- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky
|
||||||
s = [] ;
|
|
||||||
ra = [] --- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky
|
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,19 +11,16 @@ concrete SymbolPes of Symbol = CatPes ** open Prelude, ResPes in {
|
|||||||
FloatPN i = {s = i.s ; animacy = Inanimate} ;
|
FloatPN i = {s = i.s ; animacy = Inanimate} ;
|
||||||
NumPN i = {s = i.s ; animacy = Inanimate} ;
|
NumPN i = {s = i.s ; animacy = Inanimate} ;
|
||||||
CNIntNP cn i = cn ** {
|
CNIntNP 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 ;
|
a = agrP3 Sg
|
||||||
compl = cn.compl ! Sg
|
|
||||||
} ;
|
} ;
|
||||||
CNSymbNP det cn xs = cn ** {
|
CNSymbNP det cn xs = cn ** {
|
||||||
s = \\ez => det.s ++ cn.s ! det.n ! Ezafe ++ xs.s ;
|
s = \\ez => det.s ++ cn.s ! det.n ! Ezafe ++ xs.s ++ cn.compl ! det.n ;
|
||||||
a = agrP3 det.n ;
|
a = agrP3 det.n
|
||||||
compl = cn.compl ! det.n
|
|
||||||
} ;
|
} ;
|
||||||
CNNumNP cn i = cn ** {
|
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 ;
|
a = agrP3 Sg ;
|
||||||
compl = cn.compl ! Sg
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SymbS sy = {s = \\_ => sy.s} ;
|
SymbS sy = {s = \\_ => sy.s} ;
|
||||||
@@ -40,12 +37,6 @@ lin
|
|||||||
BaseSymb = infixSS "تE" ;
|
BaseSymb = infixSS "تE" ;
|
||||||
ConsSymb = infixSS "" ;
|
ConsSymb = infixSS "" ;
|
||||||
|
|
||||||
--oper
|
-- TODO: what are wN and تE? /IL
|
||||||
-- Note: this results in a space before 's, but there's
|
|
||||||
-- not mauch we can do about that.
|
|
||||||
-- addGenitiveS : Str ;
|
|
||||||
-- addGenitiveS s =
|
|
||||||
-- s ++ "از" ;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
|
|||||||
ComplVV = insertVV ;
|
ComplVV = insertVV ;
|
||||||
ComplVS v s = embComp (conjThat ++ s.s ! Indic) (predV v) ;
|
ComplVS v s = embComp (conjThat ++ s.s ! Indic) (predV v) ;
|
||||||
ComplVQ v q = embComp (conjThat ++ q.s) (predV v) ;
|
ComplVQ v q = embComp (conjThat ++ q.s) (predV v) ;
|
||||||
ComplVA v ap = insertObj (appComp v.c2 (ap.s ! Bare)) (predV v) ; -- check form of adjective
|
ComplVA v ap = insertObj (appComp v.c2 ap.s) (predV v) ; -- check form of adjective
|
||||||
|
|
||||||
SlashVV vv vps = vps ** ComplVV vv vps ;
|
SlashVV vv vps = vps ** ComplVV vv vps ;
|
||||||
SlashV2S v s = predVc v ** embComp (conjThat ++ s.s ! Indic) (predV v) ;
|
SlashV2S v s = predVc v ** embComp (conjThat ++ s.s ! Indic) (predV v) ;
|
||||||
SlashV2Q v q = predVc v ** embComp q.s (predV v) ;
|
SlashV2Q v q = predVc v ** embComp q.s (predV v) ;
|
||||||
SlashV2A v ap = predVc v ** insertObj (appComp v.c2 (ap.s ! Bare)) (predV v) ; ---- paint it red , check form of adjective
|
SlashV2A v ap = predVc v ** insertObj (appComp v.c2 ap.s) (predV v) ; ---- paint it red , check form of adjective
|
||||||
|
|
||||||
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
|
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
|
||||||
SlashV2V v2v vp = predVc v2v ** {
|
SlashV2V v2v vp = predVc v2v ** {
|
||||||
@@ -36,9 +36,9 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
|
|||||||
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
|
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
|
||||||
SlashV2VNP v2v np vps = predVc v2v ** {
|
SlashV2VNP v2v np vps = predVc v2v ** {
|
||||||
comp = \\a => if_then_Str v2v.isAux conjThat [] -- that
|
comp = \\a => if_then_Str v2v.isAux conjThat [] -- that
|
||||||
++ appComp v2v.c2 (np.s ! Bare) ; -- I
|
++ appComp v2v.c2 np.s ; -- I
|
||||||
-- ∅ is placed in comp
|
-- ∅ is placed in comp
|
||||||
vComp = \\_,_ => showVPH (case v2v.compl of { -- buy
|
vComp = \\_,_ => showVPH (case v2v.compl of { -- buy
|
||||||
Subj => VSubj Pos np.a ;
|
Subj => VSubj Pos np.a ;
|
||||||
Indic => VAor Pos np.a })
|
Indic => VAor Pos np.a })
|
||||||
np.a -- agreement fixed to np.a
|
np.a -- agreement fixed to np.a
|
||||||
@@ -46,6 +46,10 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
|
|||||||
c2 = vps.c2 -- preposition for the direct object comes from VPSlash
|
c2 = vps.c2 -- preposition for the direct object comes from VPSlash
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- : VP -> Prep -> VPSlash ;
|
||||||
|
VPSlashPrep vp prep = vp ** vs prep ;
|
||||||
|
|
||||||
|
|
||||||
AdvVP vp adv = insertAdV adv.s vp ;
|
AdvVP vp adv = insertAdV adv.s vp ;
|
||||||
AdVVP adv vp = insertAdV adv.s vp ;
|
AdVVP adv vp = insertAdV adv.s vp ;
|
||||||
ReflVP v = insertCompPre reflPron v ;
|
ReflVP v = insertCompPre reflPron v ;
|
||||||
|
|||||||
Reference in New Issue
Block a user