Merge pull request #190 from inariksit/persian

(Pes) VVs etc.
This commit is contained in:
Inari Listenmaa
2019-03-01 15:48:19 +01:00
committed by GitHub
13 changed files with 132 additions and 96 deletions

View File

@@ -8,7 +8,7 @@ concrete AdverbPes of Adverb = CatPes ** open ResPes, Prelude in {
s = a.adv ++ cadv.p ++ cadv.s ++ np.s ! Bare ; 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 ! Indic;
} ; } ;
PrepNP prep np = {s = prep.s ++ np.s ! Bare } ; PrepNP prep np = {s = prep.s ++ np.s ! Bare } ;
@@ -16,7 +16,7 @@ concrete AdverbPes of Adverb = CatPes ** open ResPes, Prelude in {
AdAdv ada adv = { s = ada.s ++ adv.s} ; AdAdv ada adv = { s = ada.s ++ adv.s} ;
-- SubjS = cc2 ; -- SubjS = cc2 ;
SubjS sub snt = {s = sub.s ++ "که" ++ snt.s } ; SubjS sub snt = {s = sub.s ++ "که" ++ snt.s ! sub.compl} ;
AdnCAdv cadv = {s = cadv.s ++ "از"} ; AdnCAdv cadv = {s = cadv.s ++ "از"} ;
} }

View File

@@ -5,10 +5,10 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in {
lincat lincat
------ Tensed/Untensed ------ Tensed/Untensed
S = {s : Str} ; S = {s : VVForm => Str} ; -- as a complement to Subj
QS = {s : QForm => Str} ; QS = {s : QForm => Str} ;
RS = {s : Agr => Str } ; -- c for it clefts RS = {s : Agr => Str } ; -- c for it clefts
SSlash = {s : Str ; c2 : ResPes.Compl} ; SSlash = {s : VVForm => Str ; c2 : ResPes.Compl} ;
---- Sentence ---- Sentence
@@ -75,7 +75,7 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in {
Conj = {s1,s2 : Str ; n : Number} ; Conj = {s1,s2 : Str ; n : Number} ;
-----b Conj = {s : Str ; n : Number} ; -----b Conj = {s : Str ; n : Number} ;
-----b DConj = {s1,s2 : Str ; n : Number} ; -----b DConj = {s1,s2 : Str ; n : Number} ;
Subj = {s : Str} ; Subj = {s : Str ; compl : VVForm} ; -- subjunctive or indicative
Prep = {s : Str}; Prep = {s : Str};
---- Open lexical classes, e.g. Lexicon ---- Open lexical classes, e.g. Lexicon
V, VS, VQ, VA = ResPes.Verb ; V, VS, VQ, VA = ResPes.Verb ;
@@ -83,13 +83,13 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in {
V2, V2A, V2Q, V2S = ResPes.Verb ** {c2 : Compl} ; V2, V2A, V2Q, V2S = ResPes.Verb ** {c2 : Compl} ;
V3 = ResPes.Verb ** {c2, c3 : Compl} ; V3 = ResPes.Verb ** {c2, c3 : Compl} ;
VV = ResPes.VV ; VV = ResPes.VV ;
V2V = ResPes.VV ** {c1 : Str ; c2 : Str} ; V2V = ResPes.VV ** {c2 : Compl} ;
A = ResPes.Adjective ; A = ResPes.Adjective ;
A2 = ResPes.Adjective ** {c2 : Str} ; A2 = ResPes.Adjective ** {c2 : Str} ;
N = ResPes.Noun ; N = ResPes.Noun ;
N2 = ResPes.Noun ** {c : Str ; compl : Str}; -- when N3 is made to N2, need to retain compl N2 = ResPes.Noun ** {c2 : Str ; compl : Str}; -- when N3 is made to N2, need to retain compl
N3 = ResPes.Noun ** {c2 : Str ; c3 : Str} ; N3 = ResPes.Noun ** {c2 : Str ; c3 : Str} ;
PN = {s : Str ; animacy : Animacy} ; PN = {s : Str ; animacy : Animacy} ;

View File

@@ -7,7 +7,7 @@ concrete ConjunctionPes of Conjunction =
lin lin
ConjS = conjunctDistrSS ; ConjS = conjunctDistrTable VVForm ;
ConjAdv = conjunctDistrSS ; ConjAdv = conjunctDistrSS ;
-- ConjAdv conj advs = conjunctDistrTable Gender conj advs ; -- ConjAdv conj advs = conjunctDistrTable Gender conj advs ;
@@ -22,12 +22,12 @@ concrete ConjunctionPes of Conjunction =
---- These fun's are generated from the list cat's. ---- These fun's are generated from the list cat's.
BaseS = twoSS ; BaseS = twoTable VVForm ;
ConsS = consrSS comma ; ConsS = consrTable VVForm comma ;
BaseAdv = twoSS ; BaseAdv = twoSS ;
-- BaseAdv x y = twoTable Gender x y ;
ConsAdv = consrSS comma ; ConsAdv = consrSS comma ;
-- ConsAdv xs x = consrTable Gender comma xs x ;
BaseNP x y = y ** twoTable Mod 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 Mod 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} ;
@@ -37,7 +37,7 @@ concrete ConjunctionPes of Conjunction =
ConsAP xs x = consrTable Mod 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 : 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; compl:Str} ;
[AP] = {s1,s2 : Mod => Str ; adv : Str} ; [AP] = {s1,s2 : Mod => Str ; adv : Str} ;

View File

@@ -13,7 +13,7 @@ lin
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 };
CleftAdv ad ss = { s = \\t,b,o => ad.s ++ ss.s}; CleftAdv ad ss = { s = \\t,b,o => ad.s ++ ss.s ! Indic};
ExistNP np = ExistNP np =
mkSClause " " (agrP3 (fromAgr np.a).n) mkSClause " " (agrP3 (fromAgr np.a).n)

View File

@@ -21,7 +21,7 @@ concrete LexiconPes of Lexicon = CatPes **
beautiful_A = mkA "زیبا" ; beautiful_A = mkA "زیبا" ;
become_VA = mkV "شدن" "شو"; become_VA = mkV "شدن" "شو";
beer_N = mkN01 "آبجو" inanimate; beer_N = mkN01 "آبجو" inanimate;
beg_V2V = mkV2V (compoundV "خواهش" doVerb) "از" "" False; beg_V2V = mkV2V (compoundV "خواهش" doVerb) "از" False;
big_A = mkA "بزرگ" ; big_A = mkA "بزرگ" ;
bike_N = mkN01 "دوچرخه" inanimate; bike_N = mkN01 "دوچرخه" inanimate;
bird_N = mkN02 "پرنده" animate; bird_N = mkN02 "پرنده" animate;

View File

@@ -86,18 +86,18 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
UseN2 = useN ; UseN2 = useN ;
Use2N3 n3 = useN n3 ** { Use2N3 n3 = useN n3 ** {
c = n3.c2 ; c2 = n3.c2 ;
compl = [] compl = []
} ; } ;
Use3N3 n3 = useN n3 ** { Use3N3 n3 = useN n3 ** {
c = n3.c3 ; c2 = n3.c3 ;
compl = [] compl = []
} ; } ;
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.c ++ np.s ! Bare ; compl = \\_ => n2.compl ++ n2.c2 ++ np.s ! Bare ;
hasAdj = False hasAdj = False
}; };

View File

@@ -112,10 +112,37 @@ oper
mkV2 : (listen : V) -> (to : Prep) -> V2 -- V2 out of V. Use given preposition, no را for direct object. mkV2 : (listen : V) -> (to : Prep) -> V2 -- V2 out of V. Use given preposition, no را for direct object.
} ; } ;
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 = overload {
mkV3 v p q = lin V3 (v ** {c2 = prepOrRa p ; c3 = prepOrRa q}) ; mkV3 : Str -> V3 -- Predictable V3, را for direct object, no prepositions.
= \s -> lin V3 (regV s ** {c2 = prepOrRa "را" ; c3 = prepOrRa []}) ;
mkV3 : V -> (dir,indir : Str) -> V3 -- Takes a verb and two prepositions or را as strings (can be empty).
= \v,p,q -> lin V3 (v ** {c2 = prepOrRa p ; c3 = prepOrRa q})
} ;
mkVQ = overload {
mkVQ : Str -> VQ -- predictable verb with question complement
= \s -> lin VQ (regV s) ;
mkVQ : V -> VQ -- VQ out of a verb
= \v -> lin VQ v
} ;
mkVA = overload {
mkVA : Str -> VA -- predictable verb with adjective complement
= \s -> lin VA (regV s) ;
mkVA : V -> VA -- VA out of a verb
= \v -> lin VA v
} ;
mkVS = overload {
mkVS : Str -> VS -- predictable verb with sentence complement
= \s -> lin VS (regV s) ;
mkVS : V -> VS -- VS out of a verb
= \v -> lin VS v
} ;
mkVV = overload { mkVV = overload {
mkVV : Str -> VV -- Predictable VV, subjunctive complement, is auxiliary.
= \s -> lin VV (regV s ** {isAux = True ; compl = subjunctive ; isDef = False}) ;
mkVV : V -> VV -- takes its VP complement in subjunctive. Is auxiliary. mkVV : V -> VV -- takes its VP complement in subjunctive. Is auxiliary.
= \v -> v ** {isAux = True ; compl = subjunctive ; isDef = False} ; = \v -> v ** {isAux = True ; compl = subjunctive ; isDef = False} ;
mkVV : VVForm -> V -> VV -- takes its VP complement in the given VVForm mkVV : VVForm -> V -> VV -- takes its VP complement in the given VVForm
@@ -124,9 +151,15 @@ oper
= \isAux,vvf,v -> v ** {isAux = isAux ; compl = vvf ; isDef = False} = \isAux,vvf,v -> v ** {isAux = isAux ; compl = vvf ; isDef = False}
} ; } ;
mkV2V : V -> (cV, cN : Str) -> (isAux : Bool) -> V2V -- Verb, complementiser for the verb, complementiser for the noun, whether it's auxiliary. mkV2V = overload {
= \v,s1,s2,b -> let vv : VV = mkVV b subjunctive v in mkV2V : V -> (cN : Str) -> (isAux : Bool) -> V2V -- Verb, complementiser for the noun, whether it's auxiliary.
lin V2V (vv ** {c1 = s1 ; c2 = s2}) ; = \v,s,b -> let vv : VV = mkVV b subjunctive v in
lin V2V (vv ** {c2 = prepOrRa s}) ;
mV2V : VV -> (cN : Str) -> V2V -- V2V out of VV + complementiser for the noun
= \vv,s -> lin V2V (vv ** {c2 = prepOrRa s}) ;
mV2V : VV -> V2V -- V2V out of VV, را for direct object
= \vv -> lin V2V (vv ** {c2 = prepOrRa "را"})
} ;
----2 Adverbs ----2 Adverbs
@@ -158,7 +191,12 @@ oper
= mk2Conj = mk2Conj
} ; } ;
mkSubj = overload {
mkSubj : Str -> Subj -- Takes its verbal complement in indicative.
= \s -> lin Subj {s=s ; compl=indicative} ;
mkSubj : VVForm -> Str -> Subj -- Specify whether it takes complement in subjunctive or indicative.
= \vvf,s -> lin Subj {s=s ; compl=vvf}
} ;
--. --.
--2 Definitions of paradigms --2 Definitions of paradigms
@@ -289,10 +327,14 @@ oper
} ; } ;
mkN2 = overload { mkN2 = overload {
mkN2 : Str -> N2 -- Predictable N2 without complement
= \s -> lin N2 (mkN01 s inanimate ** {c2,compl = []}) ;
mkN2 : N -> N2 -- N2 from without complement
= \n -> lin N2 (n ** {c2,compl = []}) ;
mkN2 : N -> Str -> N2 mkN2 : N -> Str -> N2
= \n,c -> lin N2 (n ** {c = c ; compl=[]}) ; = \n,c -> lin N2 (n ** {c2 = c ; compl = []}) ;
mkN2 : N -> Prep -> Str -> N2 -- hidden from puclic API mkN2 : N -> Prep -> Str -> N2 -- hidden from puclic API
= \n,p,c -> lin N2 (n ** {c = p.s ; c2 = c; compl=[]}) -- there is no c2 = \n,p,c -> lin N2 (n ** {c2 = p.s; compl = []})
} ; } ;
mkN3 = overload { mkN3 = overload {

View File

@@ -2,13 +2,12 @@ concrete PhrasePes of Phrase = CatPes ** open Prelude, ResPes in {
lin lin
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
UttS s = {s = s.s ! Indic} ;
UttQS qs = {s = qs.s ! QDir} ; UttQS qs = {s = qs.s ! QDir} ;
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False} ; UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False} ;
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ; UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ;
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ; UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ;
UttS,
UttIP, --- Acc also UttIP, --- Acc also
UttAdv, UttAdv,
UttIAdv, UttIAdv,

View File

@@ -40,6 +40,8 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
animacy = Inanimate ; animacy = Inanimate ;
compl = [] compl = []
} ; } ;
indeclNP : Str -> NP = \s ->
emptyNP ** {s = \\m => s} ;
useN : Noun -> CN = \n -> n ** { useN : Noun -> CN = \n -> n ** {
hasAdj = False ; hasAdj = False ;
@@ -56,8 +58,10 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
--- Verb Phrase --- Verb Phrase
----------------------- -----------------------
param param
VVType = NoVV | FullVV | DefVV ;
VVForm = Indic | Subj ; VVForm = Indic | Subj ;
VVTense = VVPres | VVPerf | VVPast ; -- VVPast Anteriority ??? VVTense = VVPres | VVPerf | VVPast ; -- VVPast Anteriority ???
TAnt = TA Tense Anteriority ;
oper oper
@@ -77,11 +81,9 @@ oper
comp : Agr => Str; -- complements of a verb, agr for ReflVP "I/you see myself/yourself" and CompCN "I am human/we are humans" comp : Agr => Str; -- complements of a verb, agr for ReflVP "I/you see myself/yourself" and CompCN "I am human/we are humans"
vComp : Agr => VVTense => Str; -- when a verb is used as a complement of an auxiliary verb. Unlike comp or obj, this type of complement follows the auxiliary verb. vComp : Agr => VVTense => Str; -- when a verb is used as a complement of an auxiliary verb. Unlike comp or obj, this type of complement follows the auxiliary verb.
obj : Str ; -- object of a verb; so far only used for A ("paint it black") obj : Str ; -- object of a verb; so far only used for A ("paint it black")
subj : VType ;
ad : Str ; ad : Str ;
embComp : Str ; -- when a declarative or interrogative sentence is used as a complement of a verb. embComp : Str ; -- when a declarative or interrogative sentence is used as a complement of a verb.
isVV : Bool ; -- whether a VV has been added vvtype : VVType ; -- no VV, fully inflecting VV or defective VV
isDef : Bool ; -- whether a the VV is defective
} ; } ;
showVPH = overload { showVPH = overload {
@@ -98,19 +100,12 @@ oper
VPHSlash : Type = VPH ** {c2 : Compl} ; VPHSlash : Type = VPH ** {c2 : Compl} ;
param
TAnt = TA Tense Anteriority ;
VType = VIntrans | VTrans | VTransPost ; -- TODO: find out if needed
oper
predV : Verb -> VPH = \verb -> verb ** { predV : Verb -> VPH = \verb -> verb ** {
subj = VIntrans ;
ad, ad,
obj, obj,
embComp = []; embComp = [];
isDef,isVV = False ; vvtype = NoVV ;
comp = \\_ => [] ; comp = \\_ => [] ;
vComp = \\_,_ => [] } ; vComp = \\_,_ => [] } ;
@@ -133,8 +128,7 @@ oper
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 ;
isVV = True ; vvType = case vv.isDef of {True => DefVV ; _ => FullVV} ;
isDef = vv.isDef ;
} ; } ;
embComp : Str -> VPH -> VPH = \str,vp -> vp ** { embComp : Str -> VPH -> VPH = \str,vp -> vp ** {
@@ -153,16 +147,16 @@ oper
---- but don't know yet how False should be affect ---- but don't know yet how False should be affect
complVV : VV -> VPH -> (Agr => VVTense => Str) = \vv,vp -> complVV : VV -> VPH -> (Agr => VVTense => Str) = \vv,vp ->
\\agr,ant => if_then_Str vv.isAux conjThat [] ++ \\agr,ant => if_then_Str vv.isAux conjThat [] ++
case <ant,vv.compl,vv.isDef> of { case <ant,vv.isDef,vv.compl> of {
-- Auxiliaries with full inflection: complement in subjunctive
<_,_,False> => showVPH (VSubj Pos agr) agr vp ; --
-- Auxiliaries with defective inflection: complement inflects in tense -- Auxiliaries with defective inflection: complement inflects in tense
<VVPres,Subj,True> => showVPH (VSubj Pos agr) agr vp ; <VVPast,True,_> => showVPH (VPast Pos agr) agr vp ;
<VVPres,Indic,True> => showVPH (VAor Pos agr) agr vp ;
<VVPast,_,True> => showVPH (VPast Pos agr) agr vp ;
-- <VVPast Anter> => showVPH PerfStem agr vp ++ pluperfAux Pos agr ; -- TODO do we need this? -- <VVPast Anter> => showVPH PerfStem agr vp ++ pluperfAux Pos agr ; -- TODO do we need this?
<VVPerf,_,True> => showVPH PerfStem agr vp ++ subjAux Pos agr ; <VVPerf,True,_> => showVPH PerfStem agr vp ++ subjAux Pos agr ;
-- Auxiliaries that take indicative (full or defective inflection)
<VVPres,_,Indic> => showVPH (VAor Pos agr) agr vp ;
-- Default: complement in subjunctive
_ => showVPH (VSubj Pos agr) agr vp ---- TODO more forms ? _ => showVPH (VSubj Pos agr) agr vp ---- TODO more forms ?
} ; } ;
@@ -186,24 +180,24 @@ oper
TA Pres Anter => vp.s ! VPerf pol agr ; TA Pres Anter => vp.s ! VPerf pol agr ;
TA Past Simul => vp.s ! VPast pol agr ; TA Past Simul => vp.s ! VPast pol agr ;
TA Past Anter => TA Past Anter =>
case vp.isDef of { case vp.vvtype of {
True => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ; DefVV => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ;
False => vp.s ! PerfStem ++ pluperfAux pol agr } ; _ => vp.s ! PerfStem ++ pluperfAux pol agr } ;
TA Fut Simul => TA Fut Simul =>
case vp.isDef of { case vp.vvtype of {
True => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ; DefVV => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ;
False => futAux pol agr ++ vp.s ! PastStem _ => futAux pol agr ++ vp.s ! PastStem
} ; -- PastStem is, despite the name, used for future too. /IL } ; -- PastStem is, despite the name, used for future too. /IL
TA Fut Anter => TA Fut Anter =>
case vp.isDef of { case vp.vvtype of {
True => vp.s ! VPerf pol agr ; DefVV => vp.s ! VPerf pol agr ;
False => "خواسته" ++ pluperfAux pol agr ++ vp.s ! PastStem _ => "خواسته" ++ pluperfAux pol agr ++ vp.s ! PastStem
} ; -- verb form need to be confirmed } ; -- verb form need to be confirmed
TA Cond Simul => vp.s ! VSubj pol agr ; TA Cond Simul => vp.s ! VSubj pol agr ;
TA Cond Anter => TA Cond Anter =>
case vp.isDef of { case vp.vvtype of {
True => vp.s ! VSubj pol agr ; DefVV => vp.s ! VSubj pol agr ;
False => vp.s ! PerfStem ++ subjAux pol agr } -- verb form to be confirmed _ => vp.s ! PerfStem ++ subjAux pol agr } -- verb form to be confirmed
} ; } ;
mkClause : NP -> VPH -> Clause = \np,vp -> mkClause : NP -> VPH -> Clause = \np,vp ->
@@ -238,7 +232,6 @@ oper
VAor p a => haveVerb.s ! VAor Pos a ++ verb.s ! ImpPrefix p ++ verb.s ! VAor Pos a ; VAor p a => haveVerb.s ! VAor Pos a ++ verb.s ! ImpPrefix p ++ verb.s ! VAor Pos a ;
VPast p a => haveVerb.s ! VPast Pos a ++ verb.s ! ImpPrefix p ++ verb.s ! VPast Pos a ; -- negation in ImpPrefix VPast p a => haveVerb.s ! VPast Pos a ++ verb.s ! ImpPrefix p ++ verb.s ! VPast Pos a ; -- negation in ImpPrefix
_ => verb.s ! vh } ; -- TODO more forms _ => verb.s ! vh } ; -- TODO more forms
subj = VIntrans
} ; } ;
IndefArticle : Str ; IndefArticle : Str ;

View File

@@ -13,9 +13,9 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in {
s = \\pol,n => s = \\pol,n =>
let agr = Ag (numImp n) P2 ; let agr = Ag (numImp n) P2 ;
vps = vp.prefix ++ vp.s ! VImp pol (numImp n) vps = vp.prefix ++ vp.s ! VImp pol (numImp n)
in case vp.isVV of { in case vp.vvtype of {
True => vps ++ vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vp.embComp ; NoVV => vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vps ++ vp.embComp ;
False => vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vps ++ vp.embComp } _ => vps ++ vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vp.embComp }
} ; } ;
SlashVP np vp = SlashVP np vp =
@@ -33,16 +33,18 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in {
SlashVS np vs slash = SlashVS np vs slash =
mkSlClause np mkSlClause np
(embComp (conjThat ++ slash.s) (predV vs)) ** (embComp (conjThat ++ slash.s ! Indic) (predV vs)) **
{c2 = slash.c2} ; {c2 = slash.c2} ;
EmbedS s = {s = conjThat ++ s.s} ; EmbedS s = {s = conjThat ++ s.s ! Indic} ;
EmbedQS qs = {s = qs.s ! QIndir} ; EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = showVPH Inf defaultAgr vp} ; --- agr EmbedVP vp = {s = showVPH Inf defaultAgr vp} ; --- agr
UseCl temp p cl = let vt = TA temp.t temp.a in { UseCl temp p cl = {
s = temp.s ++ p.s ++ cl.s ! vt ! p.p ! ODir s = \\vvf => temp.s ++ p.s ++ case vvf of {
Indic => cl.s ! TA temp.t temp.a ! p.p ! ODir ;
Subj => cl.s ! TA Cond temp.a ! p.p ! ODir }
} ; } ;
UseQCl temp p qcl = let vt = TA temp.t temp.a in { UseQCl temp p qcl = let vt = TA temp.t temp.a in {
@@ -53,13 +55,15 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in {
s = \\q => temp.s ++ p.s ++ rcl.s ! vt ! p.p ! ODir ! q s = \\q => temp.s ++ p.s ++ rcl.s ! vt ! p.p ! ODir ! q
} ; } ;
UseSlash temp p cls = let vt = TA temp.t temp.a in cls ** { UseSlash temp p cls = cls ** {
s = temp.s ++ p.s ++ cls.subj ++ cls.vp ! vt ! p.p ! ODir s = \\vvf => temp.s ++ p.s ++ cls.subj ++ case vvf of {
Indic => cls.vp ! TA temp.t temp.a ! p.p ! ODir ;
Subj => cls.vp ! TA Cond temp.a ! p.p ! ODir }
} ; } ;
AdvS a s = {s = a.s ++ s.s} ; AdvS a s = {s = \\vvf => a.s ++ s.s ! vvf} ;
RelS s r = {s = s.s ++ r.s ! agrP3 Sg} ; RelS s r = {s = \\vvf => s.s ! vvf ++ r.s ! agrP3 Sg} ;
SSubjS s1 sj s2 = { s = s1.s ++ sj.s ++ s2.s}; SSubjS s1 sj s2 = {s = \\vvf => s1.s ! vvf ++ sj.s ++ s2.s ! sj.compl};
} }

View File

@@ -9,10 +9,10 @@ concrete StructuralPes of Structural = CatPes **
after_Prep = ss ["بعد از"] ; after_Prep = ss ["بعد از"] ;
all_Predet = ss ["همه ی"] ; all_Predet = ss ["همه ی"] ;
almost_AdA, almost_AdN = ss "تقریباً" ; almost_AdA, almost_AdN = ss "تقریباً" ;
although_Subj = ss ["با وجود این"] ; although_Subj = mkSubj "با وجود این" ;
always_AdV = ss "همیشه" ; always_AdV = ss "همیشه" ;
and_Conj = sd2 [] "و" ** {n = Pl} ; and_Conj = sd2 [] "و" ** {n = Pl} ;
because_Subj = ss ["برای این"] ; because_Subj = mkSubj "برای این" ;
before_Prep = ss ["قبل از"] ; before_Prep = ss ["قبل از"] ;
behind_Prep = ss "پشت" ; behind_Prep = ss "پشت" ;
between_Prep = ss "بین" ; between_Prep = ss "بین" ;
@@ -24,12 +24,11 @@ concrete StructuralPes of Structural = CatPes **
can_VV = mkVV (mkV_1 "توانستن") ; ---- AR can_VV = mkVV (mkV_1 "توانستن") ; ---- AR
during_Prep = ss ["در طول"] ; during_Prep = ss ["در طول"] ;
either7or_DConj = sd2 "یا" "یا" ** {n = Sg} ; either7or_DConj = sd2 "یا" "یا" ** {n = Sg} ;
-- everybody_NP = MassNP (UseN (MorphoPnb.mkN11 ["هر کwی"])); -- not a good way coz need to include NounPnb -- everybody_NP = R.indeclNP "هر کwی";
every_Det = mkDet "هر" Sg ; every_Det = mkDet "هر" Sg ;
-- everything_NP = MassNP (UseN (MorphoPnb.mkN11 ["هر XE"])); -- everything_NP = R.indeclNP ["هر XE"]));
everywhere_Adv = ss ["هر جا"] ; everywhere_Adv = ss ["هر جا"] ;
few_Det = mkDet ["تعداد کمی"] Pl True; -- check few_Det = mkDet ["تعداد کمی"] Pl True; -- check
-- first_Ord = {s = "اولین" ; n = Sg} ; --DEPRECATED
for_Prep = ss "برای" ; for_Prep = ss "برای" ;
from_Prep = ss "از" ; from_Prep = ss "از" ;
he_Pron = personalPron "او" "ش" Sg P3 ; he_Pron = personalPron "او" "ش" Sg P3 ;
@@ -39,7 +38,7 @@ concrete StructuralPes of Structural = CatPes **
how_IAdv = ss "چطور" ; how_IAdv = ss "چطور" ;
how8many_IDet = {s = "چند" ; n = Pl ; isNum = True} ; how8many_IDet = {s = "چند" ; n = Pl ; isNum = True} ;
how8much_IAdv = ss "چقدر" ; how8much_IAdv = ss "چقدر" ;
if_Subj = ss "اگر" ; if_Subj = mkSubj subjunctive "اگر" ;
in8front_Prep = ss "جلوی" ; in8front_Prep = ss "جلوی" ;
i_Pron = personalPron "من" "م" Sg P1; i_Pron = personalPron "من" "م" Sg P1;
in_Prep = ss "در" ; in_Prep = ss "در" ;
@@ -64,13 +63,13 @@ concrete StructuralPes of Structural = CatPes **
quite_Adv = ss "کاملاً" ; quite_Adv = ss "کاملاً" ;
she_Pron = personalPron "او" "ش" Sg P3 ; she_Pron = personalPron "او" "ش" Sg P3 ;
so_AdA = ss "بسیار" ; so_AdA = ss "بسیار" ;
-- somebody_NP = MassNP (UseN (MorphoPnb.mkN11 "کwی" )); somebody_NP = R.indeclNP "کwی" ;
someSg_Det = mkDet "مقداری" Sg True ; someSg_Det = mkDet "مقداری" Sg True ;
somePl_Det = mkDet "چند" Pl True ; somePl_Det = mkDet "چند" Pl True ;
-- something_NP = MassNP (UseN (MorphoPnb.mkN11 "چیزی")); something_NP = R.indeclNP "چیزی" ;
somewhere_Adv = ss "جایی" ; somewhere_Adv = ss "جایی" ;
that_Quant = mkQuant "آن" "آن"; that_Quant = mkQuant "آن" "آن";
that_Subj = ss "آن"; that_Subj = mkSubj "آن";
there_Adv = ss "آنجا" ; there_Adv = ss "آنجا" ;
there7to_Adv = ss "آنجا" ; there7to_Adv = ss "آنجا" ;
there7from_Adv = ss "آنجا" ; there7from_Adv = ss "آنجا" ;
@@ -87,7 +86,7 @@ concrete StructuralPes of Structural = CatPes **
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 "کی" ;
when_Subj = ss "وقتی" ; when_Subj = mkSubj "وقتی" ;
where_IAdv = ss "کجا" ; where_IAdv = ss "کجا" ;
which_IQuant = {s = "کدام" ; n = Sg} ; which_IQuant = {s = "کدام" ; n = Sg} ;
whichPl_IDet = {s = "کدام" ; n = Pl ; isNum = False} ; whichPl_IDet = {s = "کدام" ; n = Pl ; isNum = False} ;
@@ -107,9 +106,9 @@ concrete StructuralPes of Structural = CatPes **
if_then_Conj = sd2 "اگر" "آنگاه" ** {n = Sg} ; if_then_Conj = sd2 "اگر" "آنگاه" ** {n = Sg} ;
at_least_AdN = ss "حداقل" ; at_least_AdN = ss "حداقل" ;
at_most_AdN = ss "حداکثر"; at_most_AdN = ss "حداکثر";
-- nothing_NP = MassNP (UseN (MorphoPnb.mkN11 "هیچ چیز" )); nothing_NP = R.indeclNP "هیچ" ;
except_Prep = ss ["به جز"] ; except_Prep = ss ["به جز"] ;
-- nobody_NP = MassNP (UseN (MorphoPnb.mkN11 "هیچ کس")); nobody_NP = R.indeclNP "هیچ کس";
as_CAdv = {s = ["به اندازه ی"] ; p = ""} ; as_CAdv = {s = ["به اندازه ی"] ; p = ""} ;
@@ -136,8 +135,7 @@ have_V2 = haveVerb ** {
x => haveVerb.s ! x } ; x => haveVerb.s ! x } ;
c2 = { c2 = {
s = [] ; s = [] ;
ra = [] ; --- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky ra = [] --- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky
c = R.VTrans
} }
} ; } ;
} }

View File

@@ -26,7 +26,7 @@ concrete SymbolPes of Symbol = CatPes ** open Prelude, ResPes in {
compl = cn.compl ! Sg compl = cn.compl ! Sg
} ; } ;
SymbS sy = sy ; SymbS sy = {s = \\_ => sy.s} ;
SymbNum sy = { s = sy.s ; n = Pl } ; SymbNum sy = { s = sy.s ; n = Pl } ;
SymbOrd sy = { s = sy.s ++ "wN" ; n = Pl; isNum=False} ; SymbOrd sy = { s = sy.s ++ "wN" ; n = Pl; isNum=False} ;

View File

@@ -13,18 +13,18 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
ComplSlash = complSlash ; ComplSlash = complSlash ;
ComplVV = insertVV ; ComplVV = insertVV ;
ComplVS v s = embComp (conjThat ++ s.s) (predV v) ; ComplVS v s = embComp (conjThat ++ s.s ! Indic) (predV v) ;
ComplVQ v q = embComp (conjThat ++ q.s ! QIndir) (predV v) ; ComplVQ v q = embComp (conjThat ++ q.s ! QIndir) (predV v) ;
ComplVA v ap = insertObj (ap.s ! Bare) (predV v) ; -- check form of adjective ComplVA v ap = insertObj (ap.s ! Bare) (predV v) ; -- check form of adjective
SlashVV vv vps = vps ** insertVV vv vps ; SlashVV vv vps = vps ** insertVV vv vps ;
SlashV2S v s = v ** embComp (conjThat ++ s.s) (predV v) ; SlashV2S v s = v ** embComp (conjThat ++ s.s ! Indic) (predV v) ;
SlashV2Q v q = v ** embComp (q.s ! QIndir) (predV v) ; SlashV2Q v q = v ** embComp (q.s ! QIndir) (predV v) ;
SlashV2A v ap = v ** insertObj (ap.s ! Bare) (predV v) ; ---- paint it red , check form of adjective SlashV2A v ap = v ** insertObj (ap.s ! Bare) (predV v) ; ---- paint it red , check form of adjective
SlashV2V v vp = insertVV v vp ** {c2 = {s = v.c1 ; ra = []}} ; SlashV2V v vp = v ** insertVV v vp ; -- ** {c2 = {s = v.c1 ; ra = []}} ;
SlashV2VNP v2v np vps = SlashV2VNP v2v np vps =
let vvVP : VPH = insertVV v2v vps ; let vvVPS : VPHSlash = vps ** insertVV v2v vps ;
vvVPS = vvVP ** {c2={s=v2v.c1 ; ra=v2v.c2}} ; -- TODO find out if it's a general rule; only one V2V in the lexicon /IL -- vvVPS = vvVP ** {c2={s=v2v.c1 ; ra=v2v.c2}} ; -- TODO find out if it's a general rule; only one V2V in the lexicon /IL
in complSlash vvVPS np ** {c2 = vps.c2} ; in complSlash vvVPS np ** {c2 = vps.c2} ;
AdvVP vp adv = insertAdV adv.s vp ; AdvVP vp adv = insertAdV adv.s vp ;