forked from GitHub/gf-rgl
@@ -8,7 +8,7 @@ concrete AdverbPes of Adverb = CatPes ** open ResPes, Prelude in {
|
||||
s = a.adv ++ cadv.p ++ cadv.s ++ np.s ! Bare ;
|
||||
} ;
|
||||
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 } ;
|
||||
@@ -16,7 +16,7 @@ concrete AdverbPes of Adverb = CatPes ** open ResPes, Prelude in {
|
||||
AdAdv ada adv = { s = ada.s ++ adv.s} ;
|
||||
|
||||
-- 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 ++ "از"} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in {
|
||||
lincat
|
||||
------ Tensed/Untensed
|
||||
|
||||
S = {s : Str} ;
|
||||
S = {s : VVForm => Str} ; -- as a complement to Subj
|
||||
QS = {s : QForm => Str} ;
|
||||
RS = {s : Agr => Str } ; -- c for it clefts
|
||||
SSlash = {s : Str ; c2 : ResPes.Compl} ;
|
||||
SSlash = {s : VVForm => Str ; c2 : ResPes.Compl} ;
|
||||
|
||||
---- Sentence
|
||||
|
||||
@@ -75,7 +75,7 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in {
|
||||
Conj = {s1,s2 : Str ; n : Number} ;
|
||||
-----b Conj = {s : Str ; n : Number} ;
|
||||
-----b DConj = {s1,s2 : Str ; n : Number} ;
|
||||
Subj = {s : Str} ;
|
||||
Subj = {s : Str ; compl : VVForm} ; -- subjunctive or indicative
|
||||
Prep = {s : Str};
|
||||
---- Open lexical classes, e.g. Lexicon
|
||||
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} ;
|
||||
V3 = ResPes.Verb ** {c2, c3 : Compl} ;
|
||||
VV = ResPes.VV ;
|
||||
V2V = ResPes.VV ** {c1 : Str ; c2 : Str} ;
|
||||
V2V = ResPes.VV ** {c2 : Compl} ;
|
||||
A = ResPes.Adjective ;
|
||||
A2 = ResPes.Adjective ** {c2 : Str} ;
|
||||
|
||||
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} ;
|
||||
PN = {s : Str ; animacy : Animacy} ;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ concrete ConjunctionPes of Conjunction =
|
||||
|
||||
lin
|
||||
|
||||
ConjS = conjunctDistrSS ;
|
||||
ConjS = conjunctDistrTable VVForm ;
|
||||
|
||||
ConjAdv = conjunctDistrSS ;
|
||||
-- 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.
|
||||
|
||||
BaseS = twoSS ;
|
||||
ConsS = consrSS comma ;
|
||||
BaseS = twoTable VVForm ;
|
||||
ConsS = consrTable VVForm comma ;
|
||||
|
||||
BaseAdv = twoSS ;
|
||||
-- BaseAdv x y = twoTable Gender x y ;
|
||||
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
|
||||
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} ;
|
||||
@@ -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} ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Str} ;
|
||||
[S] = {s1,s2 : VVForm => Str} ;
|
||||
[Adv] = {s1,s2 : Str} ;
|
||||
[NP] = {s1,s2 : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool; compl:Str} ;
|
||||
[AP] = {s1,s2 : Mod => Str ; adv : Str} ;
|
||||
|
||||
@@ -13,7 +13,7 @@ lin
|
||||
in
|
||||
{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 =
|
||||
mkSClause " " (agrP3 (fromAgr np.a).n)
|
||||
|
||||
@@ -21,7 +21,7 @@ concrete LexiconPes of Lexicon = CatPes **
|
||||
beautiful_A = mkA "زیبا" ;
|
||||
become_VA = mkV "شدن" "شو";
|
||||
beer_N = mkN01 "آبجو" inanimate;
|
||||
beg_V2V = mkV2V (compoundV "خواهش" doVerb) "از" "" False;
|
||||
beg_V2V = mkV2V (compoundV "خواهش" doVerb) "از" False;
|
||||
big_A = mkA "بزرگ" ;
|
||||
bike_N = mkN01 "دوچرخه" inanimate;
|
||||
bird_N = mkN02 "پرنده" animate;
|
||||
|
||||
@@ -86,18 +86,18 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
|
||||
UseN2 = useN ;
|
||||
|
||||
Use2N3 n3 = useN n3 ** {
|
||||
c = n3.c2 ;
|
||||
c2 = n3.c2 ;
|
||||
compl = []
|
||||
} ;
|
||||
|
||||
Use3N3 n3 = useN n3 ** {
|
||||
c = n3.c3 ;
|
||||
c2 = n3.c3 ;
|
||||
compl = []
|
||||
} ;
|
||||
|
||||
ComplN2 n2 np = n2 ** {
|
||||
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
|
||||
};
|
||||
|
||||
|
||||
@@ -112,10 +112,37 @@ oper
|
||||
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 v p q = lin V3 (v ** {c2 = prepOrRa p ; c3 = prepOrRa q}) ;
|
||||
mkV3 = overload {
|
||||
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 : 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.
|
||||
= \v -> v ** {isAux = True ; compl = subjunctive ; isDef = False} ;
|
||||
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}
|
||||
} ;
|
||||
|
||||
mkV2V : V -> (cV, cN : Str) -> (isAux : Bool) -> V2V -- Verb, complementiser for the verb, complementiser for the noun, whether it's auxiliary.
|
||||
= \v,s1,s2,b -> let vv : VV = mkVV b subjunctive v in
|
||||
lin V2V (vv ** {c1 = s1 ; c2 = s2}) ;
|
||||
mkV2V = overload {
|
||||
mkV2V : V -> (cN : Str) -> (isAux : Bool) -> V2V -- Verb, complementiser for the noun, whether it's auxiliary.
|
||||
= \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
|
||||
@@ -158,7 +191,12 @@ oper
|
||||
= 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
|
||||
@@ -289,10 +327,14 @@ oper
|
||||
} ;
|
||||
|
||||
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
|
||||
= \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
|
||||
= \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 {
|
||||
|
||||
@@ -2,13 +2,12 @@ concrete PhrasePes of Phrase = CatPes ** open Prelude, ResPes in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = {s = s.s ! Indic} ;
|
||||
UttQS qs = {s = qs.s ! QDir} ;
|
||||
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} ;
|
||||
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ;
|
||||
|
||||
UttS,
|
||||
UttIP, --- Acc also
|
||||
UttAdv,
|
||||
UttIAdv,
|
||||
|
||||
@@ -40,6 +40,8 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
|
||||
animacy = Inanimate ;
|
||||
compl = []
|
||||
} ;
|
||||
indeclNP : Str -> NP = \s ->
|
||||
emptyNP ** {s = \\m => s} ;
|
||||
|
||||
useN : Noun -> CN = \n -> n ** {
|
||||
hasAdj = False ;
|
||||
@@ -56,8 +58,10 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
|
||||
--- Verb Phrase
|
||||
-----------------------
|
||||
param
|
||||
VVType = NoVV | FullVV | DefVV ;
|
||||
VVForm = Indic | Subj ;
|
||||
VVTense = VVPres | VVPerf | VVPast ; -- VVPast Anteriority ???
|
||||
TAnt = TA Tense Anteriority ;
|
||||
|
||||
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"
|
||||
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")
|
||||
subj : VType ;
|
||||
ad : Str ;
|
||||
embComp : Str ; -- when a declarative or interrogative sentence is used as a complement of a verb.
|
||||
isVV : Bool ; -- whether a VV has been added
|
||||
isDef : Bool ; -- whether a the VV is defective
|
||||
vvtype : VVType ; -- no VV, fully inflecting VV or defective VV
|
||||
} ;
|
||||
|
||||
showVPH = overload {
|
||||
@@ -98,19 +100,12 @@ oper
|
||||
|
||||
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 ** {
|
||||
subj = VIntrans ;
|
||||
ad,
|
||||
obj,
|
||||
embComp = [];
|
||||
isDef,isVV = False ;
|
||||
vvtype = NoVV ;
|
||||
comp = \\_ => [] ;
|
||||
vComp = \\_,_ => [] } ;
|
||||
|
||||
@@ -133,8 +128,7 @@ oper
|
||||
|
||||
insertVV : VV -> VPH -> VPH = \vv,vp -> predV vv ** {
|
||||
vComp = \\a,t => vp.vComp ! a ! t ++ complVV vv vp ! a ! t ;
|
||||
isVV = True ;
|
||||
isDef = vv.isDef ;
|
||||
vvType = case vv.isDef of {True => DefVV ; _ => FullVV} ;
|
||||
} ;
|
||||
|
||||
embComp : Str -> VPH -> VPH = \str,vp -> vp ** {
|
||||
@@ -153,16 +147,16 @@ oper
|
||||
---- but don't know yet how False should be affect
|
||||
complVV : VV -> VPH -> (Agr => VVTense => Str) = \vv,vp ->
|
||||
\\agr,ant => if_then_Str vv.isAux conjThat [] ++
|
||||
case <ant,vv.compl,vv.isDef> of {
|
||||
-- Auxiliaries with full inflection: complement in subjunctive
|
||||
<_,_,False> => showVPH (VSubj Pos agr) agr vp ; --
|
||||
|
||||
case <ant,vv.isDef,vv.compl> of {
|
||||
-- Auxiliaries with defective inflection: complement inflects in tense
|
||||
<VVPres,Subj,True> => showVPH (VSubj Pos agr) agr vp ;
|
||||
<VVPres,Indic,True> => showVPH (VAor Pos agr) agr vp ;
|
||||
<VVPast,_,True> => showVPH (VPast 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?
|
||||
<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 ?
|
||||
} ;
|
||||
|
||||
@@ -186,24 +180,24 @@ oper
|
||||
TA Pres Anter => vp.s ! VPerf pol agr ;
|
||||
TA Past Simul => vp.s ! VPast pol agr ;
|
||||
TA Past Anter =>
|
||||
case vp.isDef of {
|
||||
True => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ;
|
||||
False => vp.s ! PerfStem ++ pluperfAux pol agr } ;
|
||||
case vp.vvtype of {
|
||||
DefVV => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ;
|
||||
_ => vp.s ! PerfStem ++ pluperfAux pol agr } ;
|
||||
TA Fut Simul =>
|
||||
case vp.isDef of {
|
||||
True => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ;
|
||||
False => futAux pol agr ++ vp.s ! PastStem
|
||||
case vp.vvtype of {
|
||||
DefVV => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ;
|
||||
_ => futAux pol agr ++ vp.s ! PastStem
|
||||
} ; -- PastStem is, despite the name, used for future too. /IL
|
||||
TA Fut Anter =>
|
||||
case vp.isDef of {
|
||||
True => vp.s ! VPerf pol agr ;
|
||||
False => "خواسته" ++ pluperfAux pol agr ++ vp.s ! PastStem
|
||||
case vp.vvtype of {
|
||||
DefVV => vp.s ! VPerf pol agr ;
|
||||
_ => "خواسته" ++ pluperfAux pol agr ++ vp.s ! PastStem
|
||||
} ; -- verb form need to be confirmed
|
||||
TA Cond Simul => vp.s ! VSubj pol agr ;
|
||||
TA Cond Anter =>
|
||||
case vp.isDef of {
|
||||
True => vp.s ! VSubj pol agr ;
|
||||
False => vp.s ! PerfStem ++ subjAux pol agr } -- verb form to be confirmed
|
||||
case vp.vvtype of {
|
||||
DefVV => vp.s ! VSubj pol agr ;
|
||||
_ => vp.s ! PerfStem ++ subjAux pol agr } -- verb form to be confirmed
|
||||
} ;
|
||||
|
||||
mkClause : NP -> VPH -> Clause = \np,vp ->
|
||||
@@ -214,7 +208,7 @@ oper
|
||||
quest = table
|
||||
{ ODir => [];
|
||||
OQuest => "آیا" } ;
|
||||
subj = np.s ! Bare ;
|
||||
subj = np.s ! Bare ;
|
||||
vp = \\ta,p,ord =>
|
||||
let vps = clTable vp ! np.a ! ta ! p ;
|
||||
vvt = ta2vvt ta ;
|
||||
@@ -238,7 +232,6 @@ oper
|
||||
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
|
||||
_ => verb.s ! vh } ; -- TODO more forms
|
||||
subj = VIntrans
|
||||
} ;
|
||||
|
||||
IndefArticle : Str ;
|
||||
|
||||
@@ -13,9 +13,9 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in {
|
||||
s = \\pol,n =>
|
||||
let agr = Ag (numImp n) P2 ;
|
||||
vps = vp.prefix ++ vp.s ! VImp pol (numImp n)
|
||||
in case vp.isVV of {
|
||||
True => vps ++ vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vp.embComp ;
|
||||
False => vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vps ++ vp.embComp }
|
||||
in case vp.vvtype of {
|
||||
NoVV => 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 =
|
||||
@@ -32,17 +32,19 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in {
|
||||
} ;
|
||||
|
||||
SlashVS np vs slash =
|
||||
mkSlClause np
|
||||
(embComp (conjThat ++ slash.s) (predV vs)) **
|
||||
mkSlClause np
|
||||
(embComp (conjThat ++ slash.s ! Indic) (predV vs)) **
|
||||
{c2 = slash.c2} ;
|
||||
|
||||
EmbedS s = {s = conjThat ++ s.s} ;
|
||||
EmbedS s = {s = conjThat ++ s.s ! Indic} ;
|
||||
EmbedQS qs = {s = qs.s ! QIndir} ;
|
||||
EmbedVP vp = {s = showVPH Inf defaultAgr vp} ; --- agr
|
||||
|
||||
|
||||
UseCl temp p cl = let vt = TA temp.t temp.a in {
|
||||
s = temp.s ++ p.s ++ cl.s ! vt ! p.p ! ODir
|
||||
UseCl temp p cl = {
|
||||
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 {
|
||||
@@ -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
|
||||
} ;
|
||||
|
||||
UseSlash temp p cls = let vt = TA temp.t temp.a in cls ** {
|
||||
s = temp.s ++ p.s ++ cls.subj ++ cls.vp ! vt ! p.p ! ODir
|
||||
UseSlash temp p cls = cls ** {
|
||||
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} ;
|
||||
SSubjS s1 sj s2 = { s = s1.s ++ sj.s ++ s2.s};
|
||||
RelS s r = {s = \\vvf => s.s ! vvf ++ r.s ! agrP3 Sg} ;
|
||||
SSubjS s1 sj s2 = {s = \\vvf => s1.s ! vvf ++ sj.s ++ s2.s ! sj.compl};
|
||||
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@ concrete StructuralPes of Structural = CatPes **
|
||||
after_Prep = ss ["بعد از"] ;
|
||||
all_Predet = ss ["همه ی"] ;
|
||||
almost_AdA, almost_AdN = ss "تقریباً" ;
|
||||
although_Subj = ss ["با وجود این"] ;
|
||||
although_Subj = mkSubj "با وجود این" ;
|
||||
always_AdV = ss "همیشه" ;
|
||||
and_Conj = sd2 [] "و" ** {n = Pl} ;
|
||||
because_Subj = ss ["برای این"] ;
|
||||
because_Subj = mkSubj "برای این" ;
|
||||
before_Prep = ss ["قبل از"] ;
|
||||
behind_Prep = ss "پشت" ;
|
||||
between_Prep = ss "بین" ;
|
||||
@@ -24,12 +24,11 @@ concrete StructuralPes of Structural = CatPes **
|
||||
can_VV = mkVV (mkV_1 "توانستن") ; ---- AR
|
||||
during_Prep = ss ["در طول"] ;
|
||||
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 ;
|
||||
-- everything_NP = MassNP (UseN (MorphoPnb.mkN11 ["هر XE"]));
|
||||
-- everything_NP = R.indeclNP ["هر XE"]));
|
||||
everywhere_Adv = ss ["هر جا"] ;
|
||||
few_Det = mkDet ["تعداد کمی"] Pl True; -- check
|
||||
-- first_Ord = {s = "اولین" ; n = Sg} ; --DEPRECATED
|
||||
for_Prep = ss "برای" ;
|
||||
from_Prep = ss "از" ;
|
||||
he_Pron = personalPron "او" "ش" Sg P3 ;
|
||||
@@ -39,7 +38,7 @@ concrete StructuralPes of Structural = CatPes **
|
||||
how_IAdv = ss "چطور" ;
|
||||
how8many_IDet = {s = "چند" ; n = Pl ; isNum = True} ;
|
||||
how8much_IAdv = ss "چقدر" ;
|
||||
if_Subj = ss "اگر" ;
|
||||
if_Subj = mkSubj subjunctive "اگر" ;
|
||||
in8front_Prep = ss "جلوی" ;
|
||||
i_Pron = personalPron "من" "م" Sg P1;
|
||||
in_Prep = ss "در" ;
|
||||
@@ -64,13 +63,13 @@ concrete StructuralPes of Structural = CatPes **
|
||||
quite_Adv = ss "کاملاً" ;
|
||||
she_Pron = personalPron "او" "ش" Sg P3 ;
|
||||
so_AdA = ss "بسیار" ;
|
||||
-- somebody_NP = MassNP (UseN (MorphoPnb.mkN11 "کwی" ));
|
||||
somebody_NP = R.indeclNP "کwی" ;
|
||||
someSg_Det = mkDet "مقداری" Sg True ;
|
||||
somePl_Det = mkDet "چند" Pl True ;
|
||||
-- something_NP = MassNP (UseN (MorphoPnb.mkN11 "چیزی"));
|
||||
something_NP = R.indeclNP "چیزی" ;
|
||||
somewhere_Adv = ss "جایی" ;
|
||||
that_Quant = mkQuant "آن" "آن";
|
||||
that_Subj = ss "آن";
|
||||
that_Subj = mkSubj "آن";
|
||||
there_Adv = ss "آنجا" ;
|
||||
there7to_Adv = ss "آنجا" ;
|
||||
there7from_Adv = ss "آنجا" ;
|
||||
@@ -87,7 +86,7 @@ concrete StructuralPes of Structural = CatPes **
|
||||
whatSg_IP = {s = ["چه چیزی"] ; n = Sg } ;
|
||||
whatPl_IP = {s = ["چه چیزهایی"] ; n = Pl } ;
|
||||
when_IAdv = ss "کی" ;
|
||||
when_Subj = ss "وقتی" ;
|
||||
when_Subj = mkSubj "وقتی" ;
|
||||
where_IAdv = ss "کجا" ;
|
||||
which_IQuant = {s = "کدام" ; n = Sg} ;
|
||||
whichPl_IDet = {s = "کدام" ; n = Pl ; isNum = False} ;
|
||||
@@ -107,9 +106,9 @@ concrete StructuralPes of Structural = CatPes **
|
||||
if_then_Conj = sd2 "اگر" "آنگاه" ** {n = Sg} ;
|
||||
at_least_AdN = ss "حداقل" ;
|
||||
at_most_AdN = ss "حداکثر";
|
||||
-- nothing_NP = MassNP (UseN (MorphoPnb.mkN11 "هیچ چیز" ));
|
||||
nothing_NP = R.indeclNP "هیچ" ;
|
||||
except_Prep = ss ["به جز"] ;
|
||||
-- nobody_NP = MassNP (UseN (MorphoPnb.mkN11 "هیچ کس"));
|
||||
nobody_NP = R.indeclNP "هیچ کس";
|
||||
|
||||
as_CAdv = {s = ["به اندازه ی"] ; p = ""} ;
|
||||
|
||||
@@ -136,8 +135,7 @@ have_V2 = haveVerb ** {
|
||||
x => haveVerb.s ! x } ;
|
||||
c2 = {
|
||||
s = [] ;
|
||||
ra = [] ; --- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky
|
||||
c = R.VTrans
|
||||
ra = [] --- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky
|
||||
}
|
||||
} ;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ concrete SymbolPes of Symbol = CatPes ** open Prelude, ResPes in {
|
||||
compl = cn.compl ! Sg
|
||||
} ;
|
||||
|
||||
SymbS sy = sy ;
|
||||
SymbS sy = {s = \\_ => sy.s} ;
|
||||
SymbNum sy = { s = sy.s ; n = Pl } ;
|
||||
SymbOrd sy = { s = sy.s ++ "wN" ; n = Pl; isNum=False} ;
|
||||
|
||||
|
||||
@@ -13,18 +13,18 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
|
||||
ComplSlash = complSlash ;
|
||||
|
||||
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) ;
|
||||
ComplVA v ap = insertObj (ap.s ! Bare) (predV v) ; -- check form of adjective
|
||||
|
||||
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) ;
|
||||
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 =
|
||||
let vvVP : VPH = 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
|
||||
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
|
||||
in complSlash vvVPS np ** {c2 = vps.c2} ;
|
||||
|
||||
AdvVP vp adv = insertAdV adv.s vp ;
|
||||
|
||||
Reference in New Issue
Block a user