forked from GitHub/gf-rgl
Merge remote-tracking branch 'upstream/master' into por-ter-aux
This commit is contained in:
@@ -29,7 +29,7 @@ concrete IdiomAra of Idiom = CatAra ** open
|
|||||||
|
|
||||||
-- : NP -> Cl ; -- there is a house
|
-- : NP -> Cl ; -- there is a house
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
predVP (emptyNP ** {s=\\c=>"هُنَاكَ"}) (UseComp (CompNP np)) ; -- IL
|
predVP (indeclNP "هُنَاكَ" Sg) (UseComp (CompNP np)) ; -- IL
|
||||||
|
|
||||||
-- : IP -> QCl ; -- which houses are there
|
-- : IP -> QCl ; -- which houses are there
|
||||||
ExistIP ip = let cl = ExistNP (ip2np ip False) in {
|
ExistIP ip = let cl = ExistNP (ip2np ip False) in {
|
||||||
@@ -40,7 +40,7 @@ concrete IdiomAra of Idiom = CatAra ** open
|
|||||||
|
|
||||||
-- : NP -> Adv -> Cl ; -- there is a house in Paris
|
-- : NP -> Adv -> Cl ; -- there is a house in Paris
|
||||||
ExistNPAdv np adv =
|
ExistNPAdv np adv =
|
||||||
predVP (emptyNP ** {s=\\c=>"هُنَاكَ"}) (AdvVP (UseComp (CompNP np)) adv) ; -- IL
|
predVP (indeclNP "هُنَاكَ" Sg) (AdvVP (UseComp (CompNP np)) adv) ; -- IL
|
||||||
|
|
||||||
-- ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
|
-- ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
|
||||||
|
|
||||||
|
|||||||
@@ -393,8 +393,8 @@ oper
|
|||||||
mkPN : N -> PN = \x -> lin PN {s = x.s ! Sg ; g = x.g} ;
|
mkPN : N -> PN = \x -> lin PN {s = x.s ! Sg ; g = x.g} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mk4A a b c d = mk5A a a b c d ;
|
mk4A masc fem mascpl aa = mk5A masc masc fem mascpl aa ;
|
||||||
mk5A a b c d e = compADeg {s = \\_ => (mkAdj' a b c d e).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ;
|
mk5A masc masc fem mascpl aa = compADeg {s = \\_ => (mkAdj' masc masc mascpl fem aa).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ;
|
||||||
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ;
|
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ;
|
||||||
prefA a = {s = a.s ; isPre = True ; copTyp = a.copTyp ; lock_A = <>} ;
|
prefA a = {s = a.s ; isPre = True ; copTyp = a.copTyp ; lock_A = <>} ;
|
||||||
adjCopula a cop = a ** {copTyp = cop} ;
|
adjCopula a cop = a ** {copTyp = cop} ;
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ concrete AdjectivePes of Adjective = CatPes ** open ResPes, Prelude in {
|
|||||||
UseComparA a = a;
|
UseComparA a = a;
|
||||||
|
|
||||||
ComparA a np = {
|
ComparA a np = {
|
||||||
s =\\ez => a.s ! ez ++ "تر" ++ "از" ++ np.s ! NPC bEzafa ;
|
s =\\ez => a.s ! ez ++ "تر" ++ "از" ++ np.s ! Bare ;
|
||||||
adv = a.adv
|
adv = a.adv
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---- $SuperlA$ belongs to determiner syntax in $Noun$.
|
---- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||||
|
|
||||||
ComplA2 a np = {
|
ComplA2 a np = {
|
||||||
s =\\ez => np.s ! NPC bEzafa ++ a.c2 ++ a.s ! ez ;
|
s =\\ez => np.s ! Bare ++ a.c2 ++ a.s ! ez ;
|
||||||
adv = a.adv
|
adv = a.adv
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -34,15 +34,15 @@ concrete AdjectivePes of Adjective = CatPes ** open ResPes, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
UseA2 a = a ;
|
UseA2 a = a ;
|
||||||
|
|
||||||
CAdvAP cadv ap np = {
|
CAdvAP cadv ap np = {
|
||||||
s =\\ez => cadv.s ++ np.s ! NPC bEzafa ++ ap.s ! ez ;
|
s =\\ez => cadv.s ++ np.s ! Bare ++ ap.s ! ez ;
|
||||||
adv = ap.adv
|
adv = ap.adv
|
||||||
};
|
};
|
||||||
|
|
||||||
AdjOrd ord = { s =\\_ => ord.s ; adv = ""};
|
AdjOrd ord = { s =\\_ => ord.s ; adv = ""};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AdvAP ap adv = {s =\\ez => ap.s ! ez ++ adv.s ; adv = ap.adv};
|
AdvAP ap adv = {s =\\ez => ap.s ! ez ++ adv.s ; adv = ap.adv};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ concrete AdverbPes of Adverb = CatPes ** open ResPes, Prelude in {
|
|||||||
|
|
||||||
flags coding = utf8;
|
flags coding = utf8;
|
||||||
lin
|
lin
|
||||||
-- PositAdvAdj a = {s = a.s ! bEzafa } ;
|
-- PositAdvAdj a = {s = a.s ! Bare } ;
|
||||||
PositAdvAdj a = {s = a.adv } ;
|
PositAdvAdj a = {s = a.adv } ;
|
||||||
ComparAdvAdj cadv a np = {
|
ComparAdvAdj cadv a np = {
|
||||||
s = a.adv ++ cadv.p ++ cadv.s ++ np.s ! NPC bEzafa ;
|
s = a.adv ++ cadv.p ++ cadv.s ++ np.s ! Bare ;
|
||||||
} ;
|
} ;
|
||||||
ComparAdvAdjS cadv a s = {
|
ComparAdvAdjS cadv a s = {
|
||||||
s = a.adv ++ cadv.p ++ cadv.s ++ s.s;
|
s = a.adv ++ cadv.p ++ cadv.s ++ s.s;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PrepNP prep np = {s = prep.s ++ np.s ! NPC bEzafa } ;
|
PrepNP prep np = {s = prep.s ++ np.s ! Bare } ;
|
||||||
|
|
||||||
AdAdv ada adv = { s = ada.s ++ adv.s} ;
|
AdAdv ada adv = { s = ada.s ++ adv.s} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--# -path=.:../abstract:../common:../prelude
|
--# -path=.:alltenses:prelude:../api:../common
|
||||||
|
|
||||||
concrete AllPes of AllPesAbs =
|
concrete AllPes of AllPesAbs =
|
||||||
LangPes,
|
LangPes,
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in {
|
|||||||
Num = {s : Str ; n : Number ; isNum : Bool} ;
|
Num = {s : Str ; n : Number ; isNum : Bool} ;
|
||||||
Card = {s : Str; n : Number} ;
|
Card = {s : Str; n : Number} ;
|
||||||
Ord = {s : Str; n : Number ; isNum : Bool} ;
|
Ord = {s : Str; n : Number ; isNum : Bool} ;
|
||||||
Quant = {s: Number => Str ; a:Agr ; fromPron : Bool};
|
Quant = {s: Number => Str ; a:Agr ; mod : Mod};
|
||||||
Art = {s : Str} ;
|
Art = {s : Str} ;
|
||||||
|
|
||||||
---- Numeral
|
---- Numeral
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ concrete ConjunctionPes of Conjunction =
|
|||||||
ConjAdv = conjunctDistrSS ;
|
ConjAdv = conjunctDistrSS ;
|
||||||
-- ConjAdv conj advs = conjunctDistrTable Gender conj advs ;
|
-- ConjAdv conj advs = conjunctDistrTable Gender conj advs ;
|
||||||
|
|
||||||
ConjNP conj ss = ss ** conjunctDistrTable NPCase conj ss ** {
|
ConjNP conj ss = ss ** conjunctDistrTable Mod conj ss ** {
|
||||||
a = conjAgr (agrP3 conj.n) ss.a ;
|
a = conjAgr (agrP3 conj.n) ss.a ;
|
||||||
animacy = ss.animacy ;
|
animacy = ss.animacy ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConjAP conj ss = conjunctDistrTable Ezafa conj ss ** {adv = ss.adv};
|
ConjAP conj ss = conjunctDistrTable Mod conj ss ** {adv = ss.adv};
|
||||||
ConjRS conj rs = conjunctDistrTable Agr conj rs ** { c = rs.c};
|
ConjRS conj rs = conjunctDistrTable Agr conj rs ** { c = rs.c};
|
||||||
|
|
||||||
---- These fun's are generated from the list cat's.
|
---- These fun's are generated from the list cat's.
|
||||||
@@ -28,19 +28,19 @@ concrete ConjunctionPes of Conjunction =
|
|||||||
-- BaseAdv x y = twoTable Gender x y ;
|
-- BaseAdv x y = twoTable Gender x y ;
|
||||||
ConsAdv = consrSS comma ;
|
ConsAdv = consrSS comma ;
|
||||||
-- ConsAdv xs x = consrTable Gender comma xs x ;
|
-- ConsAdv xs x = consrTable Gender comma xs x ;
|
||||||
BaseNP x y = y ** twoTable NPCase x y ** {a = conjAgr x.a y.a ; animacy = y.animacy } ; -- check animacy
|
BaseNP x y = y ** twoTable Mod x y ** {a = conjAgr x.a y.a ; animacy = y.animacy } ; -- check animacy
|
||||||
BaseRS x y = twoTable Agr x y ** {c = x.c};
|
BaseRS x y = twoTable Agr x y ** {c = x.c};
|
||||||
ConsNP xs x = xs ** consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a ; animacy = xs.animacy } ; -- InaandB xs.animacy x.animacy} ;
|
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};
|
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 = twoTable3 Number Gender Case x y ; -- ** {isPre = andB x.isPre y.isPre} ;
|
||||||
BaseAP x y = twoTable Ezafa x y ** {adv = x.adv};
|
BaseAP x y = twoTable Mod x y ** {adv = x.adv};
|
||||||
ConsAP xs x = consrTable Ezafa comma xs x ** {adv = x.adv}; -- Table3 Number Gender Case comma xs x ;-- ** {isPre = andB xs.isPre x.isPre} ;
|
ConsAP xs x = consrTable Mod comma xs x ** {adv = x.adv}; -- Table3 Number Gender Case comma xs x ;-- ** {isPre = andB xs.isPre x.isPre} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[S] = {s1,s2 : Str} ;
|
[S] = {s1,s2 : Str} ;
|
||||||
[Adv] = {s1,s2 : Str} ;
|
[Adv] = {s1,s2 : Str} ;
|
||||||
[NP] = {s1,s2 : NPCase => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool} ;
|
[NP] = {s1,s2 : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool} ;
|
||||||
[AP] = {s1,s2 : Ezafa => Str ; adv : Str} ;
|
[AP] = {s1,s2 : Mod => Str ; adv : Str} ;
|
||||||
[RS] = {s1,s2 : Agr => Str };
|
[RS] = {s1,s2 : Agr => Str };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
88
src/persian/ConstructionPes.gf
Normal file
88
src/persian/ConstructionPes.gf
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
--# -path=.:abstract:prelude:api:common
|
||||||
|
concrete ConstructionPes of Construction = CatPes ** open
|
||||||
|
Prelude,
|
||||||
|
ParadigmsPes,
|
||||||
|
(P=ParadigmsPes),
|
||||||
|
SyntaxPes,
|
||||||
|
(S=SyntaxPes),
|
||||||
|
SymbolicPes,
|
||||||
|
StructuralPes,
|
||||||
|
(E=ExtendPes),
|
||||||
|
(R=ResPes),
|
||||||
|
(L=LexiconPes) in {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Timeunit = N ;
|
||||||
|
Weekday = N ;
|
||||||
|
Monthday = NP ;
|
||||||
|
Month = N ;
|
||||||
|
Year = NP ;
|
||||||
|
Language = N ;
|
||||||
|
|
||||||
|
|
||||||
|
lin
|
||||||
|
weekdayN w = w ;
|
||||||
|
monthN m = m ;
|
||||||
|
|
||||||
|
-- weekdayPN w = mkPN w ;
|
||||||
|
-- monthPN m = mkPN m ;
|
||||||
|
|
||||||
|
timeunitAdv n time =
|
||||||
|
let n_card : Card = n ;
|
||||||
|
n_hours_NP : NP = mkNP n_card time ;
|
||||||
|
in S.mkAdv during_Prep n_hours_NP ; ---- /IL
|
||||||
|
|
||||||
|
weekdayPunctualAdv w = lin Adv (S.mkUtt (mkNP w)) ; -- on Sunday
|
||||||
|
-- TODO
|
||||||
|
weekdayHabitualAdv, -- on Sundays
|
||||||
|
weekdayNextAdv, -- next Sunday
|
||||||
|
weekdayLastAdv = weekdayPunctualAdv ; -- last Sunday
|
||||||
|
|
||||||
|
monthAdv january =
|
||||||
|
let january_NP : NP = mkNP january ;
|
||||||
|
in S.mkAdv in_Prep january_NP ;
|
||||||
|
|
||||||
|
yearAdv y = S.mkAdv in_Prep y ;
|
||||||
|
|
||||||
|
intYear = symb ;
|
||||||
|
intMonthday = symb ;
|
||||||
|
|
||||||
|
languageCN l = mkCN l ;
|
||||||
|
languageNP l = mkNP l ;
|
||||||
|
|
||||||
|
InLanguage l = S.mkAdv in_Prep (mkNP l) ;
|
||||||
|
|
||||||
|
english_Language = mkLanguage "انگلیسی" ;
|
||||||
|
finnish_Language = mkLanguage "فنلاند" ;
|
||||||
|
swedish_Language = mkLanguage "سوئدی" ;
|
||||||
|
arabicLanguage = mkLanguage "عربی" ;
|
||||||
|
finnishLanguage = mkLanguage "فنلاندی" ;
|
||||||
|
frenchLanguage = mkLanguage "فرانسوی" ;
|
||||||
|
persianLanguage = mkLanguage "فارسی" ;
|
||||||
|
romanianLanguage = mkLanguage "رومانیایی" ;
|
||||||
|
polishLanguage = mkLanguage "لهستانی" ;
|
||||||
|
bulgarianLanguage = mkLanguage "بلغاری" ;
|
||||||
|
somaliLanguage = mkLanguage "سومالیایی" ;
|
||||||
|
turkishLanguage = mkLanguage "ترکی" ;
|
||||||
|
kurdishLanguage = mkLanguage "کردی" ;
|
||||||
|
|
||||||
|
-- : Card -> CN -> A -> AP
|
||||||
|
n_units_AP card cn a =
|
||||||
|
let ap = mkAP a in ap ** {
|
||||||
|
s = \\ez =>
|
||||||
|
ap.s ! ez
|
||||||
|
++ (mkUtt (mkNP card cn)).s ---- just guessing /IL
|
||||||
|
} ;
|
||||||
|
|
||||||
|
hungry_VP = mkVP (mkA "گرسنه") ;
|
||||||
|
thirsty_VP = mkVP (mkA "تشنه") ;
|
||||||
|
have_name_Cl p n = mkCl (mkNP (E.GenNP p) L.name_N) n ;
|
||||||
|
what_name_QCl p = mkQCl what_IAdv (mkNP (E.GenNP p) L.name_N) ;
|
||||||
|
|
||||||
|
how_old_QCl p = mkQCl howMuchAge_IAdv (mkNP (mkNP (E.GenNP p)) (P.mkAdv "سال")) ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
howMuchAge_IAdv = lin IAdv {s = "چند"} ;
|
||||||
|
what_IAdv = lin IAdv {s = "چه چیزی"} ;
|
||||||
|
mkLanguage : Str -> N = mkN ;
|
||||||
|
}
|
||||||
@@ -9,9 +9,9 @@ concrete ExtendPes of Extend =
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
-- NP -> Quant ; -- this man's
|
-- NP -> Quant ; -- this man's
|
||||||
GenNP np = np ** {
|
GenNP np = np ** {
|
||||||
s = \\num => np.s ! NPC bEzafa ; -- the possessed will get aEzafa, possesser is just unmarked; https://sites.la.utexas.edu/persian_online_resources/language-specific-grammar/ezfe/
|
mod = Ezafe ; -- the possessed will get Ezafe
|
||||||
fromPron = True -- not necessarily from Pron, but it should come after the noun, and if fromPron=True, then DetCN places determiner after cn.
|
s = \\num => np.s ! Bare -- possesser is unmarked; https://sites.la.utexas.edu/persian_online_resources/language-specific-grammar/ezfe/
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
concrete ExtraPes of ExtraPesAbs = CatPes **
|
concrete ExtraPes of ExtraPesAbs = CatPes **
|
||||||
open ResPes, Coordination, Prelude, MorphoPes, ParadigmsPes in {
|
open ResPes, Coordination, Prelude, MorphoPes, ParadigmsPes in {
|
||||||
|
|
||||||
flags coding = utf8;
|
flags coding = utf8;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
GenNP np = {s = \\_ => np.s ! NPC aEzafa ; a = np.a ; fromPron = True} ; -- changed from fromPron=False for Phrasebook
|
GenNP np = {s = \\_ => np.s ! Ezafe ; a = np.a ; mod = Ezafe} ; -- changed from mod=False for Phrasebook
|
||||||
|
|
||||||
-- each_Det = mkDet "هر کwی" "هر کwی" "هر کwی" "هر کwی" Sg ;
|
-- each_Det = mkDet "هر کwی" "هر کwی" "هر کwی" "هر کwی" Sg ;
|
||||||
-- have_V = mkV "رکh-ن";
|
-- have_V = mkV "رکh-ن";
|
||||||
IAdvAdv adv = {s = "تا چه" ++ adv.s} ;
|
IAdvAdv adv = {s = "تا چه" ++ adv.s} ;
|
||||||
-- ICompAP ap = {s = "کتنE" ++ ap.s ! Sg ! Masc ! Dir ! Posit} ;
|
-- ICompAP ap = {s = "کتنE" ++ ap.s ! Sg ! Masc ! Dir ! Posit} ;
|
||||||
-- cost_V = mkV "قیمت" ;
|
-- cost_V = mkV "قیمت" ;
|
||||||
|
|
||||||
-- added for causitives
|
-- added for causitives
|
||||||
-- make_CV = mkVerb "نْتهنگ" ** {c2 = "" };
|
-- make_CV = mkVerb "نْتهنگ" ** {c2 = "" };
|
||||||
|
|
||||||
-- for VP conjunction
|
-- for VP conjunction
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 ! NPC bEzafa) (np.a) (predAux auxBe);
|
let cl = mkSClause (np.s ! Bare) (np.a) (predAux auxBe);
|
||||||
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,7 @@ lin
|
|||||||
|
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
mkSClause " " (agrP3 (fromAgr np.a).n)
|
mkSClause " " (agrP3 (fromAgr np.a).n)
|
||||||
(insertObj (\\_ => np.s ! NPC bEzafa) (predAux auxBe)) ;
|
(insertObj (\\_ => np.s ! Bare) (predAux auxBe)) ;
|
||||||
|
|
||||||
ExistIP ip =
|
ExistIP ip =
|
||||||
let cl = mkSClause ( ip.s ) (agrP3 ip.n) (predAux auxBe);
|
let cl = mkSClause ( ip.s ) (agrP3 ip.n) (predAux auxBe);
|
||||||
@@ -32,7 +32,7 @@ lin
|
|||||||
ProgrVP vp = predProg vp ;
|
ProgrVP vp = predProg vp ;
|
||||||
|
|
||||||
ImpPl1 vp = {s = "بیایید" ++ vp.s ! VVForm (agrP1 Pl)} ;
|
ImpPl1 vp = {s = "بیایید" ++ vp.s ! VVForm (agrP1 Pl)} ;
|
||||||
ImpP3 np vp = {s = "بگذارید" ++ np.s!NPC bEzafa ++ vp.s ! VVForm np.a};
|
ImpP3 np vp = {s = "بگذارید" ++ np.s!Bare ++ vp.s ! VVForm np.a};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
--# -path=.:../abstract:../common
|
--# -path=.:alltenses:prelude:../api:../common
|
||||||
|
|
||||||
concrete LangPes of Lang =
|
concrete LangPes of Lang =
|
||||||
GrammarPes
|
GrammarPes
|
||||||
,LexiconPes
|
,LexiconPes
|
||||||
** {
|
,ConstructionPes
|
||||||
|
** {} ;
|
||||||
flags startcat = Phr ; unlexer=unwords ; lexer=words ;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ concrete LexiconPes of Lexicon = CatPes **
|
|||||||
switch8off_V2 = mkV2 (compoundV "خاموش" doVerb) "را";
|
switch8off_V2 = mkV2 (compoundV "خاموش" doVerb) "را";
|
||||||
switch8on_V2 = mkV2 (compoundV "روشن" doVerb) "را";
|
switch8on_V2 = mkV2 (compoundV "روشن" doVerb) "را";
|
||||||
table_N = mkN01 "میز" inanimate;
|
table_N = mkN01 "میز" inanimate;
|
||||||
talk_V3 = mkV3 (compoundV "حرف" hitVerb) "با" [" درباره ی"];
|
talk_V3 = mkV3 (compoundV "حرف" hitVerb) "با" "دربارۀ";
|
||||||
teacher_N = mkN02 "معلم" animate;
|
teacher_N = mkN02 "معلم" animate;
|
||||||
teach_V2 = mkV2 (compoundV "آموزش" giveVerb) "را";
|
teach_V2 = mkV2 (compoundV "آموزش" giveVerb) "را";
|
||||||
television_N = mkN01 "تلوزیون" inanimate;
|
television_N = mkN01 "تلوزیون" inanimate;
|
||||||
@@ -202,18 +202,18 @@ concrete LexiconPes of Lexicon = CatPes **
|
|||||||
understand_V2 = mkV2 (mkV_1 "فهمیدن") "را";
|
understand_V2 = mkV2 (mkV_1 "فهمیدن") "را";
|
||||||
university_N = mkN01 "دانشگاه" inanimate;
|
university_N = mkN01 "دانشگاه" inanimate;
|
||||||
village_N = mkN01 "روستا" inanimate;
|
village_N = mkN01 "روستا" inanimate;
|
||||||
-- wait_V2 = mkV2 (compoundV "منتظر" (mkVToBe "بودن" "باش"));
|
wait_V2 = mkV2 (compoundV "منتظر" beVerb);
|
||||||
walk_V = compoundV "راه" (mkV "رفتن" "رو");
|
walk_V = compoundV "راه" (mkV "رفتن" "رو");
|
||||||
warm_A = mkA "گرم" ;
|
warm_A = mkA "گرم" ;
|
||||||
war_N = mkN01 "جنگ" inanimate;
|
war_N = mkN01 "جنگ" inanimate;
|
||||||
-- watch_V2 = mkV2 (compoundV "مراقب" (mkVToBe "بودن" "باش")); -- check harfe rabt!!!
|
watch_V2 = mkV2 (compoundV "مراقب" beVerb); -- check harfe rabt!!!
|
||||||
water_N = mkN01 "آب" inanimate;
|
water_N = mkN01 "آب" inanimate;
|
||||||
white_A = mkA "سفید" ;
|
white_A = mkA "سفید" ;
|
||||||
window_N = mkN01 "پنجره" inanimate;
|
window_N = mkN01 "پنجره" inanimate;
|
||||||
wine_N = mkN01 "شراب" inanimate;
|
wine_N = mkN01 "شراب" inanimate;
|
||||||
win_V2 = mkV2 (compoundV "برنده" (mkV "شدن" "شو")) "را"; -- also possible with simple verb: mkV_2 "بردن"
|
win_V2 = mkV2 (compoundV "برنده" (mkV "شدن" "شو")) "را"; -- also possible with simple verb: mkV_2 "بردن"
|
||||||
woman_N = mkN02 "زن" animate;
|
woman_N = mkN02 "زن" animate;
|
||||||
-- wonder_VQ = compoundV "متعجب" (mkVToBe "بودن" "باش") ;
|
wonder_VQ = compoundV "متعجب" beVerb ;
|
||||||
wood_N = mkN01 "چوب" inanimate;
|
wood_N = mkN01 "چوب" inanimate;
|
||||||
write_V2 = mkV2 (mkV "نوشتن" "نویس") "را" ;
|
write_V2 = mkV2 (mkV "نوشتن" "نویس") "را" ;
|
||||||
yellow_A = mkA "زرد" ;
|
yellow_A = mkA "زرد" ;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ oper
|
|||||||
---- Nouns
|
---- Nouns
|
||||||
param
|
param
|
||||||
Animacy = Animate | Inanimate ;
|
Animacy = Animate | Inanimate ;
|
||||||
Ezafa = bEzafa | aEzafa | enClic ;
|
Mod = Bare | Ezafe | Clitic | Poss ;
|
||||||
Agr = Ag Number Person ;
|
Agr = Ag Number Person ;
|
||||||
|
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
@@ -50,17 +50,30 @@ oper
|
|||||||
agrP1 : Number -> Agr = \n -> Ag n P1 ;
|
agrP1 : Number -> Agr = \n -> Ag n P1 ;
|
||||||
|
|
||||||
-------------------------
|
-------------------------
|
||||||
-- Ezafa construction
|
-- Ezafe construction
|
||||||
------------------------
|
------------------------
|
||||||
oper
|
oper
|
||||||
|
|
||||||
mkEzafa : Str -> Str = \str ->
|
|
||||||
--let kasre = "ِ" in -- TODO: Eventually use this
|
mkPossStem : Str -> Str = \str ->
|
||||||
|
|
||||||
|
case str of {
|
||||||
|
_+ "اه" => str ;
|
||||||
|
_+ "او" => str ;
|
||||||
|
_+ "وه" => str ;
|
||||||
|
_+ ("ا"|"و") => str + "ی" ;
|
||||||
|
_+ "ه" => zwnj str "ا" ;
|
||||||
|
_ => str } ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mkEzafe : Str -> Str = \str ->
|
||||||
|
--let kasre = "ِ" in -- TODO: Eventually use this
|
||||||
let kasre = "" in
|
let kasre = "" in
|
||||||
case str of {
|
case str of {
|
||||||
st + "اه" => str + kasre ;
|
st + "اه" => str + kasre ;
|
||||||
st + "وه" => str + kasre ;
|
st + "وه" => str + kasre ;
|
||||||
st + "ه" => st + "ۀ" ; -- str ++ "ی" ;
|
st + "ه" => zwnj str "ی" ;-- alt. st + "ۀ" ;
|
||||||
st + "او" => str + kasre ;
|
st + "او" => str + kasre ;
|
||||||
st + "وو" => str + kasre ;
|
st + "وو" => str + kasre ;
|
||||||
st + "و" => str + "ی" ;
|
st + "و" => str + "ی" ;
|
||||||
@@ -71,27 +84,25 @@ oper
|
|||||||
mkEnclic : Str -> Str ;
|
mkEnclic : Str -> Str ;
|
||||||
mkEnclic str = case str of {
|
mkEnclic str = case str of {
|
||||||
st + ("ا"|"و") => zwnj str "یی" ; -- ی after a long vowel to help pronunciation
|
st + ("ا"|"و") => zwnj str "یی" ; -- ی after a long vowel to help pronunciation
|
||||||
st + "اه" => str + "ی" ; -- here ه is a consonant, so single ی
|
st + "اه" => str + "ی" ; -- here ه is a consonant, so single ی
|
||||||
st + ("ی"|"ه") => zwnj str "ای" ; -- after ی or ه as a vowel, add an alif to help pronunciation
|
st + ("ی"|"ه") => zwnj str "ای" ; -- after ی or ه as a vowel, add an alif to help pronunciation
|
||||||
_ => str + "ی" -- any other case: just a single ی
|
_ => str + "ی" -- any other case: just a single ی
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Noun = {s : Ezafa => Number => Str ; animacy : Animacy ; definitness : Bool } ;
|
Noun = {s : Number => Mod => Str ; animacy : Animacy} ;
|
||||||
mkN : (x1,x2 : Str) -> Animacy -> Noun = \sg,pl,ani -> {
|
mkN : (x1,x2 : Str) -> Animacy -> Noun = \sg,pl,ani -> {
|
||||||
s = table {
|
s = table {
|
||||||
bEzafa => table { Sg => sg ;
|
Sg => table {Bare => sg ;
|
||||||
Pl => pl
|
Ezafe => mkEzafe sg ;
|
||||||
} ;
|
Clitic => mkEnclic sg ;
|
||||||
aEzafa => table { Sg => mkEzafa sg ;
|
Poss => mkPossStem sg } ;
|
||||||
Pl => mkEzafa pl
|
Pl => table {Bare => pl ;
|
||||||
} ;
|
Ezafe => mkEzafe pl ;
|
||||||
enClic => table { Sg => mkEnclic sg ;
|
Clitic => mkEnclic pl ;
|
||||||
Pl => mkEnclic pl
|
Poss => mkPossStem pl }
|
||||||
}
|
} ;
|
||||||
};
|
animacy = ani
|
||||||
animacy = ani ;
|
} ;
|
||||||
definitness = True
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e)
|
-- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e)
|
||||||
-- Arabic nouns ends with h. also taken as Masc
|
-- Arabic nouns ends with h. also taken as Masc
|
||||||
@@ -99,29 +110,30 @@ oper
|
|||||||
---------------------
|
---------------------
|
||||||
--Determiners
|
--Determiners
|
||||||
--------------------
|
--------------------
|
||||||
Determiner : Type = {s : Str ; n :Number ; isNum : Bool ; fromPron : Bool} ;
|
Determiner : Type = {s : Str ; n :Number ; isNum : Bool ; mod : Mod} ;
|
||||||
|
|
||||||
makeDet : Str -> Number -> Bool -> Determiner = \str,n,b -> {
|
makeDet : Str -> Number -> Bool -> Determiner = \str,n,b -> {
|
||||||
s = str;
|
s = str;
|
||||||
isNum = b;
|
isNum = b;
|
||||||
fromPron = False ;
|
mod = Bare ;
|
||||||
n = n
|
n = n
|
||||||
};
|
};
|
||||||
|
|
||||||
makeQuant : Str -> Str -> {s : Number => Str ; a : Agr; fromPron : Bool } = \sg,pl -> {
|
makeQuant : Str -> Str -> {s : Number => Str ; a : Agr; mod : Mod } = \sg,pl -> {
|
||||||
s = table {Sg => sg ; Pl => pl} ;
|
s = table {Sg => sg ; Pl => pl} ;
|
||||||
fromPron = False ;
|
mod = Bare ;
|
||||||
a = agrP3 Sg
|
a = agrP3 Sg
|
||||||
};
|
};
|
||||||
---------------------------
|
---------------------------
|
||||||
-- Adjectives
|
-- Adjectives
|
||||||
--------------------------
|
--------------------------
|
||||||
Adjective : Type = {s : Ezafa => Str ; adv : Str} ;
|
Adjective : Type = {s : Mod => Str ; adv : Str} ;
|
||||||
|
|
||||||
mkAdj : Str -> Str -> Adjective = \adj,adv -> {
|
mkAdj : Str -> Str -> Adjective = \adj,adv -> {
|
||||||
s = table { bEzafa => adj;
|
s = table { Bare => adj;
|
||||||
aEzafa => mkEzafa adj ;
|
Ezafe => mkEzafe adj ;
|
||||||
enClic => mkEnclic adj
|
Clitic => mkEnclic adj ;
|
||||||
|
Poss => mkPossStem adj
|
||||||
} ;
|
} ;
|
||||||
adv = adv
|
adv = adv
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
DetCN det cn = cn ** {s = \\npc =>
|
DetCN det cn = cn ** {s = \\mod =>
|
||||||
case <det.isNum,det.fromPron,npc> of {
|
case <det.isNum,det.mod> of {
|
||||||
<False,False,NPC ez> => det.s ++ cn.s ! ez ! det.n ; -- det is not from Pron, retain NPForm.
|
<False,Bare> => det.s ++ cn.s ! det.n ! mod ; -- det is not from Pron, retain NPForm.
|
||||||
<False,True> => cn.s ! aEzafa ! det.n ++ det.s ; -- det is from Pron, cn is in aEzafa.
|
<False,X> => cn.s ! det.n ! X ++ det.s ; -- det is from Pron, cn is in Ezafe.
|
||||||
<True,False,NPC ez> => det.s ++ cn.s ! ez ! Sg ; -- noun modified by a number is invariably singular
|
<True,Bare> => det.s ++ cn.s ! Sg ! mod ; -- noun modified by a number is invariably singular
|
||||||
<True,True> => cn.s ! aEzafa ! Sg ++ det.s
|
<True,X> => cn.s ! Sg ! X ++ det.s
|
||||||
} ;
|
} ;
|
||||||
a = agrP3 det.n ;
|
a = agrP3 det.n ;
|
||||||
} ;
|
} ;
|
||||||
@@ -29,20 +29,20 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdvNP np adv = np ** {
|
AdvNP np adv = np ** {
|
||||||
s = \\ez => np.s ! NPC aEzafa ++ adv.s
|
s = \\ez => np.s ! Ezafe ++ adv.s
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetQuantOrd quant num ord = {
|
DetQuantOrd quant num ord = {
|
||||||
s = quant.s ! num.n ++ num.s ++ ord.s ;
|
s = quant.s ! num.n ++ num.s ++ ord.s ;
|
||||||
isNum = orB num.isNum ord.isNum ;
|
isNum = orB num.isNum ord.isNum ;
|
||||||
fromPron = quant.fromPron ;
|
mod = quant.mod ;
|
||||||
n = num.n
|
n = num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetQuant quant num = {
|
DetQuant quant num = {
|
||||||
s = quant.s ! num.n ++ num.s;
|
s = quant.s ! num.n ++ num.s;
|
||||||
isNum = num.isNum;
|
isNum = num.isNum;
|
||||||
fromPron = quant.fromPron ;
|
mod = quant.mod ;
|
||||||
n = num.n
|
n = num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
animacy = Inanimate
|
animacy = Inanimate
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PossPron p = {s = \\_ => p.ps ; a = p.a ; fromPron = True} ;
|
PossPron p = {s = \\_ => BIND ++ p.ps ; a = p.a ; mod = Poss} ;
|
||||||
|
|
||||||
NumSg = {s = [] ; n = Sg ; isNum = False} ;
|
NumSg = {s = [] ; n = Sg ; isNum = False} ;
|
||||||
NumPl = {s = [] ; n = Pl ; isNum = False} ;
|
NumPl = {s = [] ; n = Pl ; isNum = False} ;
|
||||||
@@ -68,17 +68,14 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
-- to here
|
-- to here
|
||||||
AdNum adn num = num ** {s = adn.s ++ num.s} ;
|
AdNum adn num = num ** {s = adn.s ++ num.s} ;
|
||||||
|
|
||||||
OrdSuperl a = {s = a.s ! bEzafa ++ taryn; n = Sg ; isNum=False} ; -- check the form of adjective
|
OrdSuperl a = {s = a.s ! Bare ++ taryn; n = Sg ; isNum=False} ; -- check the form of adjective
|
||||||
|
|
||||||
DefArt = {s = \\_ => [] ; a = defaultAgr ; fromPron = False} ;
|
DefArt = {s = \\_ => [] ; a = defaultAgr ; mod = Bare} ;
|
||||||
IndefArt = {s = table { Sg => IndefArticle ; Pl => []} ; a =defaultAgr ; fromPron = False} ;
|
IndefArt = {s = table { Sg => IndefArticle ; Pl => []} ; a =defaultAgr ; mod = Bare} ;
|
||||||
|
|
||||||
MassNP cn = cn ** {s =\\c => case c of {
|
MassNP cn = cn ** {
|
||||||
NPC bEzafa => cn.s ! bEzafa ! Sg ;
|
s = cn.s ! Sg ;
|
||||||
NPC aEzafa => cn.s ! aEzafa ! Sg ;
|
a = agrP3 Sg
|
||||||
NPC enClic => cn.s ! enClic ! Sg
|
|
||||||
};
|
|
||||||
a = agrP3 Sg ;
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UseN n = n ** {hasAdj=False};
|
UseN n = n ** {hasAdj=False};
|
||||||
@@ -95,29 +92,29 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplN2 f x = f ** {
|
ComplN2 f x = f ** {
|
||||||
s = \\ez,n => f.s ! ez ! n ++ f.c ++ x.s ! NPC ez ;
|
s = \\n,ez => f.s ! n ! Ezafe ++ f.c ++ x.s ! ez ;
|
||||||
definitness = True ;
|
definitness = True ;
|
||||||
hasAdj = False ;
|
hasAdj = False ;
|
||||||
};
|
};
|
||||||
ComplN3 f x = f ** {
|
ComplN3 f x = f ** {
|
||||||
s = \\ez,n => f.s ! ez ! n ++ f.c2 ++ x.s ! NPC ez ;
|
s = \\n,ez => f.s ! n ! Ezafe ++ f.c2 ++ x.s ! ez ;
|
||||||
c = f.c3;
|
c = f.c3;
|
||||||
definitness = True;
|
definitness = True;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdjCN ap cn = cn ** {
|
AdjCN ap cn = cn ** {
|
||||||
s = \\ez,n => cn.s ! aEzafa ! n ++ ap.s ! ez ; -- check the form of adjective and also cn.s!ez!n changed from cn.s!aEzafa!n to have correct enclicitic form other wise it creats wrong enclictic form of old man
|
s = \\n,ez => cn.s! n! Ezafe ++ ap.s ! ez ; -- check the form of adjective and also cn.s!ez!n changed from cn.s!Ezafe!n to have correct enclicitic form other wise it creats wrong enclictic form of old man
|
||||||
hasAdj = True
|
hasAdj = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelCN cn rs = cn ** {
|
RelCN cn rs = cn ** {
|
||||||
s = \\ez,n => cn.s ! enClic ! n ++ rs.s ! agrP3 n ;
|
s = \\n,ez => cn.s ! n! Clitic ++ rs.s ! agrP3 n ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdvCN cn ad = cn ** {s = \\ez,n => cn.s ! aEzafa ! n ++ ad.s} ;
|
AdvCN cn ad = cn ** {s = \\n,ez => cn.s ! n ! Ezafe ++ ad.s} ;
|
||||||
|
|
||||||
SentCN cn sc = cn ** {s = \\ez,n => cn.s ! ez ! n ++ sc.s} ;
|
SentCN cn sc = cn ** {s = \\n,ez => cn.s ! n ! ez ++ sc.s} ;
|
||||||
|
|
||||||
ApposCN cn np = cn ** {s = \\ez,n => cn.s ! ez ! n ++ np.s ! NPC aEzafa ; definitness = True} ; -- ezafa form of city to be used
|
ApposCN cn np = cn ** {s = \\n,ez => cn.s ! n ! ez ++ np.s ! Ezafe ; definitness = True} ; -- ezafa form of city to be used
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,26 +17,24 @@ resource ParadigmsPes = open
|
|||||||
|
|
||||||
oper
|
oper
|
||||||
Animacy : Type ; -- Argument to mkN
|
Animacy : Type ; -- Argument to mkN
|
||||||
animate : Animacy ;
|
animate : Animacy ; -- e.g. /mkN "خواهر" animate/ to get the plural خواهران.
|
||||||
inanimate : Animacy ;
|
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
|
Number : Type ; -- Argument to mkDet and mkConj
|
||||||
singular : Number ;
|
singular : Number ; -- e.g. mkConj "یا" singular
|
||||||
plural : Number ;
|
plural : Number ; -- e.g. mkConj "و" plural
|
||||||
|
|
||||||
|
|
||||||
--2 Nouns
|
--2 Nouns
|
||||||
|
|
||||||
mkN = overload {
|
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 ;
|
= \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 {
|
= \sg,ani -> case ani of {
|
||||||
Inanimate => mkN01 sg ani ;
|
Inanimate => mkN01 sg ani ;
|
||||||
Animate => mkN02 sg ani } ;
|
Animate => mkN02 sg ani } ;
|
||||||
-- mkN : (sg,pl : Str) -> N -- Takes singular and plural form, returns an inanimate noun
|
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 -> 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.
|
|
||||||
= \sg,pl,ani -> M.mkN sg pl ani
|
= \sg,pl,ani -> M.mkN sg pl ani
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -93,9 +91,10 @@ oper
|
|||||||
= \s1, s2 -> lin V (mkVerb s1 s2)
|
= \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.
|
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.
|
||||||
beVerb : V = lin V M.beVerb ; -- The verb "be", to be used for light verb constructions: e.g. compoundV "عاشق" beVerb.
|
= 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 : overload {
|
||||||
mkV2 : Str -> V2 ; -- Predictable V2 out of string. No preposition, را for direct object.
|
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.
|
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}) ;
|
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}) ;
|
mkV2V v s1 s2 b = lin V2V (v ** {isAux = b ; c1 = s1 ; c2 = s2}) ;
|
||||||
|
|
||||||
-- compund verbs
|
-- compund verbs
|
||||||
@@ -114,11 +113,12 @@ oper
|
|||||||
compoundV : Str -> V -> V -- Invariable prefix to a verb, e.g. compoundV "دوست" haveVerb
|
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} ;
|
= \s -> lin V {s = \\_ => s} ;
|
||||||
|
|
||||||
----2 Adverbs
|
----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
|
----2 Prepositions
|
||||||
|
|
||||||
@@ -171,7 +171,9 @@ oper
|
|||||||
|
|
||||||
mkN01 : (sg : Str) -> Animacy -> Noun ; -- Takes singular form and animacy, forms plural with ها
|
mkN01 : (sg : Str) -> Animacy -> Noun ; -- Takes singular form and animacy, forms plural with ها
|
||||||
mkN01 sg ani =
|
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 ;
|
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 ان
|
mkN02 : (sg : Str) -> Animacy -> Noun ; -- Takes singular form and animacy, pattern matches singular and forms plural with either گان, یان or ان
|
||||||
@@ -195,8 +197,8 @@ oper
|
|||||||
|
|
||||||
|
|
||||||
-- Personal Pronouns
|
-- Personal Pronouns
|
||||||
personalPN : Str -> Number -> Person -> Pron -- Hidden from public API, confusing naming. /IL
|
personalPron : (nom:Str) -> (poss:Str) -> Number -> Person -> Pron -- Hidden from public API, confusing naming. /IL
|
||||||
= \str,nn,p -> lin Pron {s = str ; a = Ag nn p ; ps = str};
|
= \nom,poss,nn,p -> lin Pron {s = nom ; a = Ag nn p ; ps = poss};
|
||||||
{-
|
{-
|
||||||
-- Demonstrative Pronouns
|
-- Demonstrative Pronouns
|
||||||
demoPN : Str -> Str -> Str -> Quant =
|
demoPN : Str -> Str -> Str -> Quant =
|
||||||
|
|||||||
@@ -11,17 +11,17 @@ concrete PhrasePes of Phrase = CatPes ** open Prelude, ResPes in {
|
|||||||
|
|
||||||
UttIP ip = {s = ip.s } ; --- Acc also
|
UttIP ip = {s = ip.s } ; --- Acc also
|
||||||
UttIAdv iadv = iadv ;
|
UttIAdv iadv = iadv ;
|
||||||
UttNP np = {s = np.s ! NPC bEzafa} ;
|
UttNP np = {s = np.s ! Bare} ;
|
||||||
UttVP vp = {s = vp.ad ++ vp.comp ! Ag Sg P3 ++ vp.obj.s ++ vp.inf ++ vp.vComp ! Ag Sg P3 ++ vp.embComp} ;
|
UttVP vp = {s = vp.ad ++ vp.comp ! Ag Sg P3 ++ vp.obj.s ++ vp.inf ++ vp.vComp ! Ag Sg P3 ++ vp.embComp} ;
|
||||||
UttAdv adv = {s = adv.s } ;
|
UttAdv adv = {s = adv.s } ;
|
||||||
UttCN cn = {s = cn.s ! bEzafa ! Sg };
|
UttCN cn = {s = cn.s ! Sg ! Bare };
|
||||||
UttCard n = n ;
|
UttCard n = n ;
|
||||||
UttAP ap = {s = ap.s ! bEzafa} ;
|
UttAP ap = {s = ap.s ! Bare} ;
|
||||||
|
|
||||||
NoPConj = {s = []} ;
|
NoPConj = {s = []} ;
|
||||||
PConjConj conj = {s = conj.s2} ; ---
|
PConjConj conj = {s = conj.s2} ; ---
|
||||||
|
|
||||||
NoVoc = {s = []} ;
|
NoVoc = {s = []} ;
|
||||||
VocNP np = {s = np.s ! NPC bEzafa} ;
|
VocNP np = {s = np.s ! Bare} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ concrete QuestionPes of Question = CatPes ** open ResPes, Prelude in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
QuestIComp icomp np =
|
QuestIComp icomp np =
|
||||||
let cl = mkSClause (np.s ! NPC bEzafa ++ icomp.s) np.a (predAux auxBe);
|
let cl = mkSClause (np.s ! Bare ++ icomp.s) np.a (predAux auxBe);
|
||||||
in {
|
in {
|
||||||
s = \\t,p,qf => case qf of {
|
s = \\t,p,qf => case qf of {
|
||||||
QDir => cl.s ! t ! p ! ODir;
|
QDir => cl.s ! t ! p ! ODir;
|
||||||
@@ -48,7 +48,9 @@ concrete QuestionPes of Question = CatPes ** open ResPes, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
IdetCN idet cn = {
|
IdetCN idet cn = {
|
||||||
s = case idet.isNum of {False => idet.s ++ cn.s ! bEzafa ! idet.n ; True => idet.s ++ cn.s ! bEzafa ! Sg} ;
|
s = case idet.isNum of {
|
||||||
|
False => idet.s ++ cn.s ! idet.n ! Bare ;
|
||||||
|
True => idet.s ++ cn.s ! Sg ! Bare} ;
|
||||||
n = idet.n;
|
n = idet.n;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -6,19 +6,19 @@ concrete RelativePes of Relative = CatPes ** open ResPes in {
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
RelCl cl = {
|
RelCl cl = {
|
||||||
s = \\t,p,o,agr => "که" ++ cl.s ! t ! p ! o ;
|
s = \\t,p,o,agr => "که" ++ cl.s ! t ! p ! o ;
|
||||||
};
|
};
|
||||||
-- RelVP and RelSlash slows the linking process a lot this is why it is commented for test purposes
|
-- RelVP and RelSlash slows the linking process a lot this is why it is commented for test purposes
|
||||||
|
|
||||||
RelVP rp vp = {
|
RelVP rp vp = {
|
||||||
s = \\t,p,o,ag =>
|
s = \\t,p,o,ag =>
|
||||||
let
|
let
|
||||||
agr = case rp.a of {
|
agr = case rp.a of {
|
||||||
RNoAg => ag ;
|
RNoAg => ag ;
|
||||||
RAg a => a
|
RAg a => a
|
||||||
} ;
|
} ;
|
||||||
cl = mkSClause (rp.s) agr vp;
|
cl = mkSClause (rp.s) agr vp;
|
||||||
|
|
||||||
-- cl = case t of {
|
-- cl = case t of {
|
||||||
-- VPImpPast => mkSClause (rp.s ! (giveNumber agr) ! Obl) agr vp;
|
-- VPImpPast => mkSClause (rp.s ! (giveNumber agr) ! Obl) agr vp;
|
||||||
-- _ => mkSClause (rp.s ! (giveNumber agr) ! Dir) agr vp
|
-- _ => mkSClause (rp.s ! (giveNumber agr) ! Dir) agr vp
|
||||||
@@ -27,22 +27,22 @@ concrete RelativePes of Relative = CatPes ** open ResPes in {
|
|||||||
cl.s ! t ! p ! ODir ;
|
cl.s ! t ! p ! ODir ;
|
||||||
-- c = Dir
|
-- c = Dir
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
---- Pied piping: "ت wهعه we رe لْْکنگ". Stranding and empty
|
---- Pied piping: "ت wهعه we رe لْْکنگ". Stranding and empty
|
||||||
---- relative are defined in $ExtraHin.gf$ ("تهت we رe لْْکنگ ت",
|
---- relative are defined in $ExtraHin.gf$ ("تهت we رe لْْکنگ ت",
|
||||||
---- "we رe لْْکنگ ت").
|
---- "we رe لْْکنگ ت").
|
||||||
--
|
--
|
||||||
RelSlash rp slash = {
|
RelSlash rp slash = {
|
||||||
s = \\t,p,o,agr => rp.s ++ slash.c2.s ++ slash.subj ++ slash.vp ! t ! p ! o ;--case t of { ---- AR 18/8/2017 is this the right place of subj?
|
s = \\t,p,o,agr => rp.s ++ slash.c2.s ++ slash.subj ++ slash.vp ! t ! p ! o ;--case t of { ---- AR 18/8/2017 is this the right place of subj?
|
||||||
-- VPImpPast => rp.s ! (giveNumber agr) Obl ++ slash.c2.s ++ slash.s ! t ! p ! o ;
|
-- VPImpPast => rp.s ! (giveNumber agr) Obl ++ slash.c2.s ++ slash.s ! t ! p ! o ;
|
||||||
-- _ => rp.s ! (giveNumber agr) Dir ++ slash.c2.s ++ slash.s ! t ! p ! o
|
-- _ => rp.s ! (giveNumber agr) Dir ++ slash.c2.s ++ slash.s ! t ! p ! o
|
||||||
-- };
|
-- };
|
||||||
-- c = Dir
|
-- c = Dir
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
FunRP p np rp = {
|
FunRP p np rp = {
|
||||||
s = np.s ! NPC enClic ++ rp.s ++ p.s ++ getPron np.animacy (fromAgr np.a).n ; -- need to make a special form of relative np by addY
|
s = np.s ! Clitic ++ rp.s ++ p.s ++ getPron np.animacy (fromAgr np.a).n ; -- need to make a special form of relative np by addY
|
||||||
a = RAg np.a
|
a = RAg np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -50,5 +50,5 @@ concrete RelativePes of Relative = CatPes ** open ResPes in {
|
|||||||
s = "که" ;
|
s = "که" ;
|
||||||
a = RNoAg
|
a = RNoAg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
|
|||||||
Order = ODir | OQuest ;
|
Order = ODir | OQuest ;
|
||||||
PMood = Del | Imper | PCond ;
|
PMood = Del | Imper | PCond ;
|
||||||
|
|
||||||
NPCase = NPC Ezafa ;
|
|
||||||
CardOrd = NCard | NOrd ;
|
CardOrd = NCard | NOrd ;
|
||||||
RAgr = RNoAg | RAg Agr ;
|
RAgr = RNoAg | RAg Agr ;
|
||||||
-- RCase = RC Number Case ;
|
-- RCase = RC Number Case ;
|
||||||
@@ -26,7 +25,7 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
|
|||||||
|
|
||||||
Compl : Type = {s : Str ; ra : Str ; c : VType} ;
|
Compl : Type = {s : Str ; ra : Str ; c : VType} ;
|
||||||
CN : Type = Noun ** {hasAdj : Bool} ; -- for getting the right form when NP/CN is a predicate
|
CN : Type = Noun ** {hasAdj : Bool} ; -- for getting the right form when NP/CN is a predicate
|
||||||
NP : Type = {s : NPCase => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool} ;
|
NP : Type = {s : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool} ;
|
||||||
VPHSlash : Type = VPH ** {c2 : Compl} ;
|
VPHSlash : Type = VPH ** {c2 : Compl} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
@@ -191,8 +190,8 @@ oper
|
|||||||
|
|
||||||
conjThat : Str = "که" ;
|
conjThat : Str = "که" ;
|
||||||
{- checkPron : NP -> Str -> Str = \np,str -> case (np.isPron) of {
|
{- checkPron : NP -> Str -> Str = \np,str -> case (np.isPron) of {
|
||||||
True => np.s ! NPC Obl;
|
True => np.s ! Obl;
|
||||||
False => np.s ! NPC Obl ++ str} ;
|
False => np.s ! Obl ++ str} ;
|
||||||
|
|
||||||
insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> vp ** {
|
insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> vp ** {
|
||||||
embComp = vp.embComp ++ emb;
|
embComp = vp.embComp ++ emb;
|
||||||
@@ -248,7 +247,7 @@ oper
|
|||||||
quest = table
|
quest = table
|
||||||
{ ODir => [];
|
{ ODir => [];
|
||||||
OQuest => "آیا" } ;
|
OQuest => "آیا" } ;
|
||||||
subj = np.s ! NPC bEzafa ;
|
subj = np.s ! Bare ;
|
||||||
vp = \\vt,b,ord =>
|
vp = \\vt,b,ord =>
|
||||||
let vps = clTable vp ! np.a ! vt ! b
|
let vps = clTable vp ! np.a ! vt ! b
|
||||||
in vp.ad ++ vp.comp ! np.a ++ vp.obj.s ++ vps ++ vp.vComp ! np.a ++ vp.embComp
|
in vp.ad ++ vp.comp ! np.a ++ vp.obj.s ++ vps ++ vp.vComp ! np.a ++ vp.embComp
|
||||||
@@ -361,8 +360,8 @@ taryn = "ترین" ;
|
|||||||
-----------------------------
|
-----------------------------
|
||||||
-- Noun Phrase
|
-- Noun Phrase
|
||||||
-----------------------------
|
-----------------------------
|
||||||
{-toNP : Str -> Str = \pn, npc -> case npc of {
|
{-toNP : Str -> Str = \pn, -> case of {
|
||||||
NPC c => pn ! c ;
|
c => pn ! c ;
|
||||||
NPObj => pn ! Dir ;
|
NPObj => pn ! Dir ;
|
||||||
NPErg => pn ! Obl
|
NPErg => pn ! Obl
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
-- first_Ord = {s = "اولین" ; n = Sg} ; --DEPRECATED
|
-- first_Ord = {s = "اولین" ; n = Sg} ; --DEPRECATED
|
||||||
for_Prep = ss "برای" ;
|
for_Prep = ss "برای" ;
|
||||||
from_Prep = ss "از" ;
|
from_Prep = ss "از" ;
|
||||||
he_Pron = personalPN "او" Sg P3 ;
|
he_Pron = personalPron "او" "ش" Sg P3 ;
|
||||||
here_Adv = ss "اینجا" ;
|
here_Adv = ss "اینجا" ;
|
||||||
here7to_Adv = ss "اینجا" ;
|
here7to_Adv = ss "اینجا" ;
|
||||||
here7from_Adv = ss "اینجا" ;
|
here7from_Adv = ss "اینجا" ;
|
||||||
@@ -41,9 +41,9 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
how8much_IAdv = ss "چقدر" ;
|
how8much_IAdv = ss "چقدر" ;
|
||||||
if_Subj = ss "اگر" ;
|
if_Subj = ss "اگر" ;
|
||||||
in8front_Prep = ss "جلوی" ;
|
in8front_Prep = ss "جلوی" ;
|
||||||
i_Pron = personalPN "من" Sg P1;
|
i_Pron = personalPron "من" "م" Sg P1;
|
||||||
in_Prep = ss "در" ;
|
in_Prep = ss "در" ;
|
||||||
it_Pron = personalPN "آن" Sg P3;
|
it_Pron = personalPron "آن" "ش" Sg P3;
|
||||||
less_CAdv = {s = "کمتر" ; p = ""} ;
|
less_CAdv = {s = "کمتر" ; p = ""} ;
|
||||||
many_Det = mkDet ["تعداد زیادی"] Pl True; -- check
|
many_Det = mkDet ["تعداد زیادی"] Pl True; -- check
|
||||||
more_CAdv = {s = "بیشتر" ; p = "" } ;
|
more_CAdv = {s = "بیشتر" ; p = "" } ;
|
||||||
@@ -75,7 +75,7 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
please_Voc = ss "لطفاً" ;
|
please_Voc = ss "لطفاً" ;
|
||||||
possess_Prep = ss "" ; -- will be handeled in Ezafeh
|
possess_Prep = ss "" ; -- will be handeled in Ezafeh
|
||||||
quite_Adv = ss "کاملاً" ;
|
quite_Adv = ss "کاملاً" ;
|
||||||
she_Pron = personalPN "او" Sg P3 ;
|
she_Pron = personalPron "او" "ش" Sg P3 ;
|
||||||
so_AdA = ss "بسیار" ;
|
so_AdA = ss "بسیار" ;
|
||||||
-- somebody_NP = MassNP (UseN (MorphoPnb.mkN11 "کwی" ));
|
-- somebody_NP = MassNP (UseN (MorphoPnb.mkN11 "کwی" ));
|
||||||
someSg_Det = mkDet "مقداری" Sg True ;
|
someSg_Det = mkDet "مقداری" Sg True ;
|
||||||
@@ -88,7 +88,7 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
there7to_Adv = ss "آنجا" ;
|
there7to_Adv = ss "آنجا" ;
|
||||||
there7from_Adv = ss "آنجا" ;
|
there7from_Adv = ss "آنجا" ;
|
||||||
therefore_PConj = ss ["به همین دلیل"] ;
|
therefore_PConj = ss ["به همین دلیل"] ;
|
||||||
they_Pron = personalPN ["آن ها"] Pl P3 ;
|
they_Pron = personalPron "آن ها" "شان" Pl P3 ;
|
||||||
this_Quant = mkQuant "این" "این" ;
|
this_Quant = mkQuant "این" "این" ;
|
||||||
through_Prep = ss ["از طریق"] ;
|
through_Prep = ss ["از طریق"] ;
|
||||||
too_AdA = ss "خیلی" ;
|
too_AdA = ss "خیلی" ;
|
||||||
@@ -96,7 +96,7 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
under_Prep = ss "زیر" ** {lock_Prep = <>};
|
under_Prep = ss "زیر" ** {lock_Prep = <>};
|
||||||
very_AdA = ss "خیلی" ;
|
very_AdA = ss "خیلی" ;
|
||||||
want_VV = mkV "خواستن" "خواه" ** { isAux = False} ;
|
want_VV = mkV "خواستن" "خواه" ** { isAux = False} ;
|
||||||
we_Pron = personalPN "ما" Pl P1 ;
|
we_Pron = personalPron "ما" "مان" Pl P1 ;
|
||||||
whatSg_IP = {s = ["چه چیزی"] ; n = Sg } ;
|
whatSg_IP = {s = ["چه چیزی"] ; n = Sg } ;
|
||||||
whatPl_IP = {s = ["چه چیزهایی"] ; n = Pl } ;
|
whatPl_IP = {s = ["چه چیزهایی"] ; n = Pl } ;
|
||||||
when_IAdv = ss "کی" ;
|
when_IAdv = ss "کی" ;
|
||||||
@@ -112,9 +112,9 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
with_Prep = ss "با";
|
with_Prep = ss "با";
|
||||||
-- yes_Phr = ss "بله" ;
|
-- yes_Phr = ss "بله" ;
|
||||||
yes_Utt = ss "بله" ;
|
yes_Utt = ss "بله" ;
|
||||||
youSg_Pron = personalPN "تو" Sg P2 ;
|
youSg_Pron = personalPron "تو" "ت" Sg P2 ;
|
||||||
youPl_Pron = personalPN "شما" Pl P2 ;
|
youPl_Pron = personalPron "شما" "تان" Pl P2 ;
|
||||||
youPol_Pron = personalPN "شما" Pl P2 ;
|
youPol_Pron = personalPron "شما" "تان" Pl P2 ;
|
||||||
-- no_Quant = demoPN "هیچ" ;
|
-- no_Quant = demoPN "هیچ" ;
|
||||||
not_Predet = {s="نه"} ;
|
not_Predet = {s="نه"} ;
|
||||||
if_then_Conj = sd2 "اگر" "آنگاه" ** {n = Sg} ;
|
if_then_Conj = sd2 "اگر" "آنگاه" ** {n = Sg} ;
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ 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 ! aEzafa ! Sg ++ i.s ;
|
s = \\ez => cn.s ! Sg ! Ezafe ++ i.s ;
|
||||||
a = agrP3 Sg
|
a = agrP3 Sg
|
||||||
} ;
|
} ;
|
||||||
CNSymbNP det cn xs = cn ** {
|
CNSymbNP det cn xs = cn ** {
|
||||||
s = \\ez => det.s ++ cn.s ! aEzafa ! det.n ++ xs.s ;
|
s = \\ez => det.s ++ cn.s ! det.n ! Ezafe ++ xs.s ;
|
||||||
a = agrP3 det.n
|
a = agrP3 det.n
|
||||||
} ;
|
} ;
|
||||||
CNNumNP cn i = cn ** {
|
CNNumNP cn i = cn ** {
|
||||||
s = \\ez => cn.s ! aEzafa ! Sg ++ i.s ;
|
s = \\ez => cn.s ! Sg ! Ezafe ++ i.s ;
|
||||||
a = agrP3 Sg
|
a = agrP3 Sg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -7,28 +7,28 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
|
|||||||
UseV v = predV v ;
|
UseV v = predV v ;
|
||||||
SlashV2a v = predV v ** {c2 = {s = v.c2.s ; ra = v.c2.ra ; c = VTrans}} ;
|
SlashV2a v = predV v ** {c2 = {s = v.c2.s ; ra = v.c2.ra ; c = VTrans}} ;
|
||||||
Slash2V3 v np =
|
Slash2V3 v np =
|
||||||
insertObjc (\\_ => np.s ! NPC bEzafa ++ v.c2 ) (predV v ** {c2 = {s = [] ; ra = v.c3 ; c = VTrans}}) ;
|
insertObjc (\\_ => np.s ! Bare ++ v.c2 ) (predV v ** {c2 = {s = [] ; ra = v.c3 ; c = VTrans}}) ;
|
||||||
|
|
||||||
Slash3V3 v np =
|
Slash3V3 v np =
|
||||||
insertObjc (\\_ => v.c3 ++ np.s ! NPC bEzafa) (predV v ** {c2 = {s = [] ; ra = v.c2 ; c = VTrans}}) ;
|
insertObjc (\\_ => v.c3 ++ np.s ! Bare) (predV v ** {c2 = {s = [] ; ra = v.c2 ; c = VTrans}}) ;
|
||||||
|
|
||||||
ComplVV v vp = insertVV (infVV v.isAux vp).s (predV v) ;
|
ComplVV v vp = insertVV (infVV v.isAux vp).s (predV v) ;
|
||||||
ComplVS v s = insertObj2 (conjThat ++ s.s) (predV v) ;
|
ComplVS v s = insertObj2 (conjThat ++ s.s) (predV v) ;
|
||||||
ComplVQ v q = insertObj2 (conjThat ++ q.s ! QIndir) (predV v) ;
|
ComplVQ v q = insertObj2 (conjThat ++ q.s ! QIndir) (predV v) ;
|
||||||
ComplVA v ap = insertObj (\\_ => ap.s ! bEzafa) (predV v) ; -- check form of adjective
|
ComplVA v ap = insertObj (\\_ => ap.s ! Bare) (predV v) ; -- check form of adjective
|
||||||
SlashV2V v vp = insertVV (infVV v.isAux vp).s (predV v) **{c2 = {s = v.c1 ; ra = [] ; c = VTransPost}} ;
|
SlashV2V v vp = insertVV (infVV v.isAux vp).s (predV v) **{c2 = {s = v.c1 ; ra = [] ; c = VTransPost}} ;
|
||||||
|
|
||||||
SlashV2S v s = insertObjc2 (conjThat ++ s.s) (predV v ** {c2 = {s = v.c2.s ;ra = [] ; c = VTransPost}}) ;
|
SlashV2S v s = insertObjc2 (conjThat ++ s.s) (predV v ** {c2 = {s = v.c2.s ;ra = [] ; c = VTransPost}}) ;
|
||||||
SlashV2Q v q = insertObjc2 ( q.s ! QIndir) (predV v ** {c2 = {s = v.c2.s ; ra = [] ;c = VTransPost}}) ;
|
SlashV2Q v q = insertObjc2 ( q.s ! QIndir) (predV v ** {c2 = {s = v.c2.s ; ra = [] ;c = VTransPost}}) ;
|
||||||
SlashV2A v ap = insertObjc3 ( ap.s ! bEzafa) (predV v ** {c2 = {s = [] ; ra = v.c2.ra ;c = VTransPost}}) ; ---- paint it red , check form of adjective
|
SlashV2A v ap = insertObjc3 ( ap.s ! Bare) (predV v ** {c2 = {s = [] ; ra = v.c2.ra ;c = VTransPost}}) ; ---- paint it red , check form of adjective
|
||||||
|
|
||||||
ComplSlash vp np = insertObjPre (\\_ => np.s ! NPC bEzafa ) vp ;
|
ComplSlash vp np = insertObjPre (\\_ => np.s ! Bare ) vp ;
|
||||||
SlashVV vv vp =
|
SlashVV vv vp =
|
||||||
-- insertObj (infVV vv.isAux vp).s (predV vv) **
|
-- insertObj (infVV vv.isAux vp).s (predV vv) **
|
||||||
insertVV (infVV vv.isAux vp).s (predV vv) **
|
insertVV (infVV vv.isAux vp).s (predV vv) **
|
||||||
{c2 = vp.c2} ;
|
{c2 = vp.c2} ;
|
||||||
SlashV2VNP vv np vp =
|
SlashV2VNP vv np vp =
|
||||||
insertObjPre (\\_ => np.s ! NPC bEzafa )
|
insertObjPre (\\_ => np.s ! Bare )
|
||||||
-- (insertObjc (infVV vv.isAux vp).s (predVc vv)) **
|
-- (insertObjc (infVV vv.isAux vp).s (predVc vv)) **
|
||||||
(insertVVc (infVV vv.isAux vp).s (predVc vv)) **
|
(insertVVc (infVV vv.isAux vp).s (predVc vv)) **
|
||||||
{c2 = vp.c2} ;
|
{c2 = vp.c2} ;
|
||||||
@@ -40,21 +40,22 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
|
|||||||
AdVVP adv vp = insertAdV adv.s vp ;
|
AdVVP adv vp = insertAdV adv.s vp ;
|
||||||
ReflVP v = insertObjPre (\\a => reflPron ! a) v ;
|
ReflVP v = insertObjPre (\\a => reflPron ! a) v ;
|
||||||
PassV2 v = predV v ; -- need to be fixed
|
PassV2 v = predV v ; -- need to be fixed
|
||||||
CompAP ap ={s = \\_ => ap.s ! bEzafa} ; -- check form of adjective
|
CompAP ap ={s = \\_ => ap.s ! Bare} ; -- check form of adjective
|
||||||
CompAdv adv = {s = \\_ => adv.s } ;
|
CompAdv adv = {s = \\_ => adv.s } ;
|
||||||
|
|
||||||
-- see https://sites.la.utexas.edu/persian_online_resources/nouns/noun-in-a-predicative-position/
|
-- see https://sites.la.utexas.edu/persian_online_resources/nouns/noun-in-a-predicative-position/
|
||||||
CompCN cn = {
|
CompCN cn = {
|
||||||
s = \\a => cn.s ! case cn.hasAdj of {
|
s = \\a => cn.s ! giveNumber a
|
||||||
False => bEzafa ;
|
! case cn.hasAdj of {
|
||||||
True => enClic }
|
False => Bare ;
|
||||||
! giveNumber a
|
True => Clitic }
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
CompNP np = {
|
CompNP np = {
|
||||||
s = \\a => np.s ! case np.hasAdj of {
|
s = \\a => np.s ! case np.hasAdj of {
|
||||||
False => NPC bEzafa ;
|
False => Bare ;
|
||||||
True => NPC enClic }
|
True => Clitic }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ concrete AdjectivePes of Adjective = CatPes ** open ResPes, Prelude in {
|
|||||||
UseComparA a = a;
|
UseComparA a = a;
|
||||||
|
|
||||||
ComparA a np = {
|
ComparA a np = {
|
||||||
s =\\ez => a.s ! ez ++ "tr" ++ "Az" ++ np.s ! NPC bEzafa ;
|
s =\\ez => a.s ! ez ++ "tr" ++ "Az" ++ np.s ! Bare ;
|
||||||
adv = a.adv
|
adv = a.adv
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---- $SuperlA$ belongs to determiner syntax in $Noun$.
|
---- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||||
|
|
||||||
ComplA2 a np = {
|
ComplA2 a np = {
|
||||||
s =\\ez => np.s ! NPC bEzafa ++ a.c2 ++ a.s ! ez ;
|
s =\\ez => np.s ! Bare ++ a.c2 ++ a.s ! ez ;
|
||||||
adv = a.adv
|
adv = a.adv
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ concrete AdjectivePes of Adjective = CatPes ** open ResPes, Prelude in {
|
|||||||
UseA2 a = a ;
|
UseA2 a = a ;
|
||||||
|
|
||||||
CAdvAP cadv ap np = {
|
CAdvAP cadv ap np = {
|
||||||
s =\\ez => cadv.s ++ np.s ! NPC bEzafa ++ ap.s ! ez ;
|
s =\\ez => cadv.s ++ np.s ! Bare ++ ap.s ! ez ;
|
||||||
adv = ap.adv
|
adv = ap.adv
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ concrete AdverbPes of Adverb = CatPes ** open ResPes, Prelude in {
|
|||||||
|
|
||||||
flags coding = utf8;
|
flags coding = utf8;
|
||||||
lin
|
lin
|
||||||
-- PositAdvAdj a = {s = a.s ! bEzafa } ;
|
-- PositAdvAdj a = {s = a.s ! Bare } ;
|
||||||
PositAdvAdj a = {s = a.adv } ;
|
PositAdvAdj a = {s = a.adv } ;
|
||||||
ComparAdvAdj cadv a np = {
|
ComparAdvAdj cadv a np = {
|
||||||
s = a.adv ++ cadv.p ++ cadv.s ++ np.s ! NPC bEzafa ;
|
s = a.adv ++ cadv.p ++ cadv.s ++ np.s ! Bare ;
|
||||||
} ;
|
} ;
|
||||||
ComparAdvAdjS cadv a s = {
|
ComparAdvAdjS cadv a s = {
|
||||||
s = a.adv ++ cadv.p ++ cadv.s ++ s.s;
|
s = a.adv ++ cadv.p ++ cadv.s ++ s.s;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PrepNP prep np = {s = prep.s ++ np.s ! NPC bEzafa } ;
|
PrepNP prep np = {s = prep.s ++ np.s ! Bare } ;
|
||||||
|
|
||||||
AdAdv ada adv = { s = ada.s ++ adv.s} ;
|
AdAdv ada adv = { s = ada.s ++ adv.s} ;
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ concrete IdiomPes of Idiom = CatPes ** open Prelude,Predef, ResPes in {
|
|||||||
GenericCl vp = mkSClause "A:dm" (agrPesP3 Sg) vp ;
|
GenericCl vp = mkSClause "A:dm" (agrPesP3 Sg) vp ;
|
||||||
|
|
||||||
CleftNP np rs =
|
CleftNP np rs =
|
||||||
let cl = mkSClause (np.s ! NPC bEzafa) (np.a) (predAux auxBe);
|
let cl = mkSClause (np.s ! Bare) (np.a) (predAux auxBe);
|
||||||
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,7 @@ concrete IdiomPes of Idiom = CatPes ** open Prelude,Predef, ResPes in {
|
|||||||
|
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
mkSClause " " (agrPesP3 (fromAgr np.a).n)
|
mkSClause " " (agrPesP3 (fromAgr np.a).n)
|
||||||
(insertObj (\\_ => np.s ! NPC bEzafa) (predAux auxBe)) ;
|
(insertObj (\\_ => np.s ! Bare) (predAux auxBe)) ;
|
||||||
|
|
||||||
ExistIP ip =
|
ExistIP ip =
|
||||||
let cl = mkSClause ( ip.s ) (agrPesP3 ip.n) (predAux auxBe);
|
let cl = mkSClause ( ip.s ) (agrPesP3 ip.n) (predAux auxBe);
|
||||||
@@ -33,7 +33,7 @@ concrete IdiomPes of Idiom = CatPes ** open Prelude,Predef, ResPes in {
|
|||||||
|
|
||||||
|
|
||||||
ImpPl1 vp = {s = "byAyyd" ++ (vp.s ! VVForm (agrPesP1 Pl)).inf} ;
|
ImpPl1 vp = {s = "byAyyd" ++ (vp.s ! VVForm (agrPesP1 Pl)).inf} ;
|
||||||
ImpP3 np vp = {s = "bgWAryd" ++ np.s!NPC bEzafa ++ (vp.s ! VVForm (AgPes (fromAgr np.a).n (fromAgr np.a).p)).inf};
|
ImpP3 np vp = {s = "bgWAryd" ++ np.s!Bare ++ (vp.s ! VVForm (AgPes (fromAgr np.a).n (fromAgr np.a).p)).inf};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ oper
|
|||||||
mkN : (x1,x2 : Str) -> Animacy -> Noun =
|
mkN : (x1,x2 : Str) -> Animacy -> Noun =
|
||||||
\sg,pl,ani -> {
|
\sg,pl,ani -> {
|
||||||
s = table {
|
s = table {
|
||||||
bEzafa => table { Sg => sg ;
|
Bare => table { Sg => sg ;
|
||||||
Pl => pl
|
Pl => pl
|
||||||
} ;
|
} ;
|
||||||
aEzafa => table { Sg => mkEzafa sg ;
|
Ezafe => table { Sg => mkEzafa sg ;
|
||||||
Pl => mkEzafa pl
|
Pl => mkEzafa pl
|
||||||
} ;
|
} ;
|
||||||
enClic => table { Sg => mkEnclic sg ;
|
enClic => table { Sg => mkEnclic sg ;
|
||||||
@@ -483,23 +483,23 @@ addBh str =
|
|||||||
--Determiners
|
--Determiners
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
makeDet : Str -> Number -> Bool -> {s: Str ; n : Number ; isNum : Bool ; fromPron : Bool} =\str,n,b -> {
|
makeDet : Str -> Number -> Bool -> {s: Str ; n : Number ; isNum : Bool ; mod : Bool} =\str,n,b -> {
|
||||||
s = str;
|
s = str;
|
||||||
isNum = b;
|
isNum = b;
|
||||||
fromPron = False ;
|
mod = False ;
|
||||||
n = n
|
n = n
|
||||||
};
|
};
|
||||||
makeQuant : Str -> Str -> {s : Number => Str ; a : AgrPes ; fromPron : Bool } = \sg,pl -> {
|
makeQuant : Str -> Str -> {s : Number => Str ; a : AgrPes ; mod : Bool } = \sg,pl -> {
|
||||||
s = table {Sg => sg ; Pl => pl} ;
|
s = table {Sg => sg ; Pl => pl} ;
|
||||||
fromPron = False ;
|
mod = False ;
|
||||||
a = agrPesP3 Sg
|
a = agrPesP3 Sg
|
||||||
};
|
};
|
||||||
---------------------------
|
---------------------------
|
||||||
-- Adjectives
|
-- Adjectives
|
||||||
--------------------------
|
--------------------------
|
||||||
mkAdj : Str -> Str -> Adjective = \adj,adv -> {
|
mkAdj : Str -> Str -> Adjective = \adj,adv -> {
|
||||||
s = table { bEzafa => adj;
|
s = table { Bare => adj;
|
||||||
aEzafa => mkEzafa adj ;
|
Ezafe => mkEzafa adj ;
|
||||||
enClic => mkEnclic adj
|
enClic => mkEnclic adj
|
||||||
} ;
|
} ;
|
||||||
adv = adv
|
adv = adv
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ oper
|
|||||||
|
|
||||||
|
|
||||||
-- Personal Pronouns
|
-- Personal Pronouns
|
||||||
personalPN : Str -> Number -> PPerson -> Pron =
|
personalPron : Str -> Number -> PPerson -> Pron =
|
||||||
\str,nn,p -> {s = str ; a = AgPes nn p ; ps = str ; lock_Pron = <>};
|
\str,nn,p -> {s = str ; a = AgPes nn p ; ps = str ; lock_Pron = <>};
|
||||||
{-
|
{-
|
||||||
-- Demonstration Pronouns
|
-- Demonstration Pronouns
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ concrete RelativePes of Relative = CatPes ** open ResPes in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
FunRP p np rp = {
|
FunRP p np rp = {
|
||||||
s = np.s ! NPC enClic ++ rp.s ++ p.s ++ getPron np.animacy (fromAgr np.a).n ; -- need to make a special form of relative np by addY
|
s = np.s ! enClic ++ rp.s ++ p.s ++ getPron np.animacy (fromAgr np.a).n ; -- need to make a special form of relative np by addY
|
||||||
a = RAg np.a
|
a = RAg np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ resource ResPes = ParamX ** open Prelude,Predef in {
|
|||||||
InfrAspect = InfrPerf | InfrImperf ;
|
InfrAspect = InfrPerf | InfrImperf ;
|
||||||
|
|
||||||
AgrPes = AgPes Number PPerson;
|
AgrPes = AgPes Number PPerson;
|
||||||
Ezafa = bEzafa | aEzafa | enClic;
|
Ezafa = Bare | Ezafe | enClic;
|
||||||
NPCase = NPC Ezafa ;
|
NPCase = Ezafa ;
|
||||||
CardOrd = NCard | NOrd ;
|
CardOrd = NCard | NOrd ;
|
||||||
RAgr = RNoAg | RAg AgrPes ;
|
RAgr = RNoAg | RAg AgrPes ;
|
||||||
-- RCase = RC Number Case ;
|
-- RCase = RC Number Case ;
|
||||||
@@ -53,7 +53,7 @@ resource ResPes = ParamX ** open Prelude,Predef in {
|
|||||||
Adjective = {s:Ezafa => Str ; adv : Str} ;
|
Adjective = {s:Ezafa => Str ; adv : Str} ;
|
||||||
|
|
||||||
NP : Type = {s : NPCase => Str ; a : AgrPes ; animacy : Animacy } ;
|
NP : Type = {s : NPCase => Str ; a : AgrPes ; animacy : Animacy } ;
|
||||||
Determiner = {s : Str ; n :Number ; isNum : Bool ; fromPron : Bool} ;
|
Determiner = {s : Str ; n :Number ; isNum : Bool ; mod : Bool} ;
|
||||||
VPHSlash = VPH ** {c2 : Compl} ;
|
VPHSlash = VPH ** {c2 : Compl} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
@@ -260,8 +260,8 @@ oper
|
|||||||
|
|
||||||
conjThat : Str = "kh" ;
|
conjThat : Str = "kh" ;
|
||||||
{- checkPron : NP -> Str -> Str = \np,str -> case (np.isPron) of {
|
{- checkPron : NP -> Str -> Str = \np,str -> case (np.isPron) of {
|
||||||
True => np.s ! NPC Obl;
|
True => np.s ! Obl;
|
||||||
False => np.s ! NPC Obl ++ str} ;
|
False => np.s ! Obl ++ str} ;
|
||||||
|
|
||||||
insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> {
|
insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> {
|
||||||
s = vp.s ;
|
s = vp.s ;
|
||||||
@@ -292,7 +292,7 @@ Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
|
|||||||
mkClause : NP -> VPH -> Clause = \np,vp -> {
|
mkClause : NP -> VPH -> Clause = \np,vp -> {
|
||||||
s = \\vt,b,ord =>
|
s = \\vt,b,ord =>
|
||||||
let
|
let
|
||||||
subj = np.s ! NPC bEzafa;
|
subj = np.s ! Bare;
|
||||||
agr = np.a ;
|
agr = np.a ;
|
||||||
n = (fromAgr agr).n;
|
n = (fromAgr agr).n;
|
||||||
p = (fromAgr agr).p;
|
p = (fromAgr agr).p;
|
||||||
@@ -795,7 +795,7 @@ addBh2 str1 =
|
|||||||
-- Noun Phrase
|
-- Noun Phrase
|
||||||
-----------------------------
|
-----------------------------
|
||||||
{-toNP : Str -> Str = \pn, npc -> case npc of {
|
{-toNP : Str -> Str = \pn, npc -> case npc of {
|
||||||
NPC c => pn ! c ;
|
c => pn ! c ;
|
||||||
NPObj => pn ! Dir ;
|
NPObj => pn ! Dir ;
|
||||||
NPErg => pn ! Obl
|
NPErg => pn ! Obl
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
-- first_Ord = {s = "Avlyn" ; n = Sg} ; --DEPRECATED
|
-- first_Ord = {s = "Avlyn" ; n = Sg} ; --DEPRECATED
|
||||||
for_Prep = ss "brAy" ;
|
for_Prep = ss "brAy" ;
|
||||||
from_Prep = ss "Az" ;
|
from_Prep = ss "Az" ;
|
||||||
he_Pron = personalPN "Av" Sg PPers3 ;
|
he_Pron = personalPron "Av" Sg PPers3 ;
|
||||||
here_Adv = ss "AynjA" ;
|
here_Adv = ss "AynjA" ;
|
||||||
here7to_Adv = ss "AynjA" ;
|
here7to_Adv = ss "AynjA" ;
|
||||||
here7from_Adv = ss "AynjA" ;
|
here7from_Adv = ss "AynjA" ;
|
||||||
@@ -40,9 +40,9 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
how8much_IAdv = ss "c^qdr" ;
|
how8much_IAdv = ss "c^qdr" ;
|
||||||
if_Subj = ss "Agr" ;
|
if_Subj = ss "Agr" ;
|
||||||
in8front_Prep = ss "jlvy" ;
|
in8front_Prep = ss "jlvy" ;
|
||||||
i_Pron = personalPN "mn" Sg PPers1;
|
i_Pron = personalPron "mn" Sg PPers1;
|
||||||
in_Prep = ss "dr" ;
|
in_Prep = ss "dr" ;
|
||||||
it_Pron = personalPN "A:n" Sg PPers3;
|
it_Pron = personalPron "A:n" Sg PPers3;
|
||||||
less_CAdv = {s = "kmtr" ; p = ""} ;
|
less_CAdv = {s = "kmtr" ; p = ""} ;
|
||||||
many_Det = mkDet ["tcdAd zyAdy"] Pl True; -- check
|
many_Det = mkDet ["tcdAd zyAdy"] Pl True; -- check
|
||||||
more_CAdv = {s = "byCtr" ; p = "" } ;
|
more_CAdv = {s = "byCtr" ; p = "" } ;
|
||||||
@@ -73,7 +73,7 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
please_Voc = ss "lTfAa." ;
|
please_Voc = ss "lTfAa." ;
|
||||||
possess_Prep = ss "" ; -- will be handeled in Ezafeh
|
possess_Prep = ss "" ; -- will be handeled in Ezafeh
|
||||||
quite_Adv = ss "kAmlAa." ;
|
quite_Adv = ss "kAmlAa." ;
|
||||||
she_Pron = personalPN "Av" Sg PPers3 ;
|
she_Pron = personalPron "Av" Sg PPers3 ;
|
||||||
so_AdA = ss "bsyAr" ;
|
so_AdA = ss "bsyAr" ;
|
||||||
-- somebody_NP = MassNP (UseN (MorphoPnb.mkN11 "kwy" ));
|
-- somebody_NP = MassNP (UseN (MorphoPnb.mkN11 "kwy" ));
|
||||||
someSg_Det = mkDet "mqdAry" Sg True ;
|
someSg_Det = mkDet "mqdAry" Sg True ;
|
||||||
@@ -86,7 +86,7 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
there7to_Adv = ss "A:njA" ;
|
there7to_Adv = ss "A:njA" ;
|
||||||
there7from_Adv = ss "A:njA" ;
|
there7from_Adv = ss "A:njA" ;
|
||||||
therefore_PConj = ss ["bh hmyn dlyl"] ;
|
therefore_PConj = ss ["bh hmyn dlyl"] ;
|
||||||
they_Pron = personalPN ["A:n hA"] Pl PPers3 ;
|
they_Pron = personalPron ["A:n hA"] Pl PPers3 ;
|
||||||
this_Quant = mkQuant "Ayn" "Ayn" ;
|
this_Quant = mkQuant "Ayn" "Ayn" ;
|
||||||
through_Prep = ss ["Az Tryq"] ;
|
through_Prep = ss ["Az Tryq"] ;
|
||||||
too_AdA = ss "Kyly" ;
|
too_AdA = ss "Kyly" ;
|
||||||
@@ -94,7 +94,7 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
under_Prep = ss "zyr" ** {lock_Prep = <>};
|
under_Prep = ss "zyr" ** {lock_Prep = <>};
|
||||||
very_AdA = ss "Kyly" ;
|
very_AdA = ss "Kyly" ;
|
||||||
want_VV = mkV "KvAstn" "KvAh" ** { isAux = False} ;
|
want_VV = mkV "KvAstn" "KvAh" ** { isAux = False} ;
|
||||||
we_Pron = personalPN "mA" Pl PPers1 ;
|
we_Pron = personalPron "mA" Pl PPers1 ;
|
||||||
whatSg_IP = {s = ["c^h c^yzy"] ; n = Sg } ;
|
whatSg_IP = {s = ["c^h c^yzy"] ; n = Sg } ;
|
||||||
whatPl_IP = {s = ["c^h c^yzhAyy"] ; n = Pl } ;
|
whatPl_IP = {s = ["c^h c^yzhAyy"] ; n = Pl } ;
|
||||||
when_IAdv = ss "ky" ;
|
when_IAdv = ss "ky" ;
|
||||||
@@ -110,9 +110,9 @@ concrete StructuralPes of Structural = CatPes **
|
|||||||
with_Prep = ss "bA";
|
with_Prep = ss "bA";
|
||||||
-- yes_Phr = ss "blh" ;
|
-- yes_Phr = ss "blh" ;
|
||||||
yes_Utt = ss "blh" ;
|
yes_Utt = ss "blh" ;
|
||||||
youSg_Pron = personalPN "tv" Sg PPers2 ;
|
youSg_Pron = personalPron "tv" Sg PPers2 ;
|
||||||
youPl_Pron = personalPN "CmA" Pl PPers2 ;
|
youPl_Pron = personalPron "CmA" Pl PPers2 ;
|
||||||
youPol_Pron = personalPN "CmA" Pl PPers2 ;
|
youPol_Pron = personalPron "CmA" Pl PPers2 ;
|
||||||
-- no_Quant = demoPN "hyc^" ;
|
-- no_Quant = demoPN "hyc^" ;
|
||||||
not_Predet = {s="nh"} ;
|
not_Predet = {s="nh"} ;
|
||||||
if_then_Conj = sd2 "Agr" "A:ngAh" ** {n = Sg} ;
|
if_then_Conj = sd2 "Agr" "A:ngAh" ** {n = Sg} ;
|
||||||
|
|||||||
42601
src/spanish/DictSpa.gf
Normal file
42601
src/spanish/DictSpa.gf
Normal file
File diff suppressed because it is too large
Load Diff
42561
src/spanish/DictSpaAbs.gf
Normal file
42561
src/spanish/DictSpaAbs.gf
Normal file
File diff suppressed because it is too large
Load Diff
102
src/spanish/README.md
Normal file
102
src/spanish/README.md
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
# Spanish
|
||||||
|
|
||||||
|
## Language information
|
||||||
|
* English name: Spanish
|
||||||
|
* Autonym: español
|
||||||
|
* ISO code: Spa
|
||||||
|
|
||||||
|
## Authors
|
||||||
|
|
||||||
|
* Aarne Ranta
|
||||||
|
|
||||||
|
With contributions from Inger Andersson, Bruno Cuconato, Inari Listenmaa, and Therese Söderberg.
|
||||||
|
|
||||||
|
## Implementation information
|
||||||
|
The Spanish Resource Grammar is built using the Romance functor at
|
||||||
|
[romance](../romance/), and it mostly follows Spanish spoken in Spain.
|
||||||
|
|
||||||
|
Romance instantiations differ mostly in their morphological modules
|
||||||
|
and in the constructions defined in the =Diff*= modules. Some relevant features:
|
||||||
|
|
||||||
|
* two copulas, ser and estar
|
||||||
|
* prepositions that contract with articles are *de* and *a*, called `genitive` and `dative` respectively. When forming new prepositions, e.g. *después de* use `mkPrep "después" genitive` to get correct contractions.
|
||||||
|
* no inversion in question clauses, except for `QuestIComp` and `QuestIAdv`.
|
||||||
|
|
||||||
|
### Known issues
|
||||||
|
|
||||||
|
* Verbs with dative subject don't actually have it. Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
Lang> p "I like grammars" | l
|
||||||
|
I like grammars
|
||||||
|
yo gusto gramáticas
|
||||||
|
```
|
||||||
|
|
||||||
|
This is not a massive problem per se, the application grammarian just needs to know this is the case. If your application grammar has a function like the following:
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
fun Like : NP -> NP -> Cl ;
|
||||||
|
```
|
||||||
|
|
||||||
|
then you just need to linearise it as follows:
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
lin Like subj obj = mkCl obj like_V2 subj ;
|
||||||
|
```
|
||||||
|
|
||||||
|
(Why don't we have it? Verbs like *gustar* inflect according to the logical *object* of the sentence; this would mean we'd need 2-dimensional inflection tables for verbs, and while that's a cool thing, it's also expensive and not needed for anything else.)
|
||||||
|
|
||||||
|
* Contractions with *con* and pronouns: *con* + *mí*/*ti*/… should be *conmigo*/*contigo*/…, but the contraction is not implemented.
|
||||||
|
|
||||||
|
* Clitic pronouns and their combinations:
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
-- PredVP (UsePron i_Pron) (ComplSlash (SlashVV want_VV (Slash2V3 give_V3 (UsePron he_Pron))) (UsePron it_Pron))
|
||||||
|
LangEng: i want to give him it
|
||||||
|
LangSpa: yo lo quiero dar &+ le -- should be dárselo
|
||||||
|
-- PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (Slash3V3 give_V3 (UsePron it_Pron)) (UsePron he_Pron)))
|
||||||
|
LangEng: i want to give him it
|
||||||
|
LangSpa: yo quiero dar &+ lo le -- should be dárselo
|
||||||
|
```
|
||||||
|
|
||||||
|
* Accents in imperatives and infinitives with clitics
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
--ImpVP (ComplSlash (Slash2V3 give_V3 (UsePron i_Pron)) (UsePron it_Pron))
|
||||||
|
LangEng: give me it
|
||||||
|
LangSpa: da &+ lo me
|
||||||
|
```
|
||||||
|
|
||||||
|
Ignoring the clitic combination (should be *dámelo*), the verb form *da* should get an accent *dá* to show the correct syllable stress.
|
||||||
|
|
||||||
|
## Data
|
||||||
|
|
||||||
|
### Besch & Irreg
|
||||||
|
The [BeschSpa](BeschSpa.gf) and [IrregSpa](IrregSpa.gf) modules contain the complete inflection tables for all different
|
||||||
|
Spanish verb types. Based on the Functional Morphology [implementation](http://www.cse.chalmers.se/alumni/markus/FM/download/FM_SPA_1.1.tgz) by Inger Andersson and Therese Söderberg.
|
||||||
|
|
||||||
|
|
||||||
|
### DictSpa
|
||||||
|
This module contains nouns, adjectives and verbs taken from
|
||||||
|
[Open Multilingual Wordnet](http://compling.hss.ntu.edu.sg/omw/) and [DictionarySpa](https://github.com/GrammaticalFramework/wide-coverage/blob/master/translator/DictionarySpa.gf) (mostly from Wiktionary).
|
||||||
|
|
||||||
|
#### Multiwords
|
||||||
|
Some thousands of multiwords are manually checked. As of February 2019, around 4000 are unchecked. Those are marked in [DictSpa](DictSpa.gf) with `-- to-check segmentation`.
|
||||||
|
|
||||||
|
#### Morphology
|
||||||
|
WIP.
|
||||||
|
* Where there was a non-1-arg paradigm in the old resources, that is retained.
|
||||||
|
* All verbs that overlap with IrregSpa use the IrregSpa definition.
|
||||||
|
* Most of the manually checked multiwords are also checked for morphology, but naturally, errors do occur.
|
||||||
|
|
||||||
|
## History and applications
|
||||||
|
|
||||||
|
Some applications include:
|
||||||
|
|
||||||
|
* [MOLTO phrasebook](http://www.molto-project.eu/sites/default/files/everyday.pdf)
|
||||||
|
* GF Mathematical Grammar Library ([paper](http://www.molto-project.eu/sites/default/files/gf-mgl.pdf), [demo](http://cloud.grammaticalframework.org/minibar/minibar.html))
|
||||||
|
* GF [Wide-Coverage translator](http://cloud.grammaticalframework.org/wc.html)
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
Inari Listenmaa ([@inariksit](https://github.com/inariksit))
|
||||||
|
Bruno Cuconato ([@odanoburu](https://github.com/odanoburu))
|
||||||
Reference in New Issue
Block a user