forked from GitHub/gf-rgl
(Pes) Fixes in NP complements
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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,11 +17,11 @@ lin
|
|||||||
|
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
mkSClause [] (agrP3 (fromAgr np.a).n)
|
mkSClause [] (agrP3 (fromAgr np.a).n)
|
||||||
(insertComp (\\_ => np.s ! Bare) (predV existVerb)) ;
|
(insertComp (\\_ => np2str np) (predV existVerb)) ;
|
||||||
|
|
||||||
ExistNPAdv np adv =
|
ExistNPAdv np adv =
|
||||||
mkSClause [] (agrP3 (fromAgr np.a).n)
|
mkSClause [] (agrP3 (fromAgr np.a).n)
|
||||||
(insertComp (\\_ => np.s ! Bare ++ adv.s)
|
(insertComp (\\_ => np2str np ++ adv.s)
|
||||||
(predV existVerb)
|
(predV existVerb)
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ 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
|
oper
|
||||||
existVerb = mkV "وجود" haveVerb ;
|
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>"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 ;
|
||||||
|
|||||||
@@ -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 ++ "از" ;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user