mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Pes) Add Mod to Prep + update appComp. Constructors with Mod for Det.
This commit is contained in:
@@ -28,6 +28,10 @@ oper
|
||||
subjunctive : VVForm ; -- The verbal complement of VV is in subjunctive
|
||||
indicative : VVForm ; -- The verbal complement of VV is in indicative
|
||||
|
||||
Mod : Type ; -- Argument to mkDet and mkPrep
|
||||
ezafe : Mod ; -- e.g. mkPrep "برای" ezafe
|
||||
-- poss : Mod ; -- TODO is this needed?
|
||||
--clitic : Mod ; -- TODO is this needed?
|
||||
--2 Nouns
|
||||
|
||||
mkN : overload {
|
||||
@@ -66,9 +70,11 @@ oper
|
||||
|
||||
mkDet = overload {
|
||||
mkDet : Str -> Number -> Det -- Takes a string, number (sg/pl) and returns a det which is not a numeral
|
||||
= \s1,n -> lin Det (makeDet s1 n False);
|
||||
mkDet : Str -> Number -> Bool -> Det -- Takes a string, number (sg/pl) and a Boolean for whether the det is a numeral
|
||||
= \s1,n,b -> lin Det (makeDet s1 n b)
|
||||
= \s,n -> lin Det (makeDet s n False);
|
||||
mkDet : Str -> Number -> Bool -> Det -- As above + a Boolean for whether the det is a numeral
|
||||
= \s,n,b -> lin Det (makeDet s n b) ;
|
||||
mkDet : Str -> Number -> Bool -> Mod -> Det -- As above + Mod for which form the determiner expects its argument to be (default bare)
|
||||
= \s,n,b,m -> lin Det (makeDet s n b ** {mod=m})
|
||||
};
|
||||
|
||||
{-
|
||||
@@ -173,8 +179,13 @@ oper
|
||||
|
||||
----2 Prepositions
|
||||
|
||||
mkPrep : Str -> Prep ; -- Takes a string, returns a preposition.
|
||||
mkPrep str = lin Prep {s = str ; ra = []} ;
|
||||
mkPrep = overload {
|
||||
mkPrep : Str -> Prep -- Takes a string, returns a preposition.
|
||||
= \str -> lin Prep {s = str ; ra = [] ; mod = Bare} ;
|
||||
mkPrep : Str -> Mod -> Prep -- Takes a string and Mod (so far only option is ezafe), returns a preposition.
|
||||
= \str,m -> lin Prep {s = str ; ra = [] ; mod=m}
|
||||
} ;
|
||||
|
||||
{-
|
||||
--3 Determiners and quantifiers
|
||||
|
||||
@@ -224,6 +235,9 @@ oper
|
||||
subjunctive = ResPes.Subj ;
|
||||
indicative = Indic ;
|
||||
|
||||
Mod = ResPes.Mod ;
|
||||
ezafe = ResPes.Ezafe ;
|
||||
|
||||
-- Removed mkV_1, mkV_2, mkN01 and mkN02 from public API, still available for
|
||||
-- any applications that open ParadigmsPes. /IL 2019-02-08
|
||||
mkV_1 : Str -> V
|
||||
@@ -329,15 +343,15 @@ oper
|
||||
mkV2 : V -> Str -> V2
|
||||
= \v,ra -> lin V2 (v ** {c2 = prepOrRa ra}) ;
|
||||
mkV2 : V -> Str -> Bool -> V2
|
||||
= \v,p,b -> lin V2 (v ** {c2 = {ra = [] ; s = p}}) ;
|
||||
= \v,p,b -> lin V2 (v ** {c2 = {ra = [] ; s = p ; mod=Bare}}) ;
|
||||
} ;
|
||||
|
||||
prepOrRa : Str -> Compl = \s -> case s of {
|
||||
"را" => {s = [] ; ra = "را"} ;
|
||||
prep => {s = prep ; ra = []}
|
||||
"را" => {s = [] ; ra = "را" ; mod=Bare} ;
|
||||
prep => {s = prep ; ra = []; mod=Bare}
|
||||
} ;
|
||||
|
||||
mkPost : Str -> Prep = \s -> lin Prep {s=[] ; ra=s} ;
|
||||
mkPost : Str -> Prep = \s -> lin Prep {s=[] ; ra=s ; mod=Bare} ;
|
||||
|
||||
mkN2 = overload {
|
||||
mkN2 : Str -> N2 -- Predictable N2 without complement
|
||||
|
||||
@@ -102,7 +102,7 @@ oper
|
||||
vp.comp ! agr ++ vp.prefix ++ vp.s ! vf -- vp.ad is missing on purpose! we add it in insertVV.
|
||||
++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vp.embComp ;
|
||||
|
||||
Compl : Type = {s : Str ; ra : Str} ;
|
||||
Compl : Type = {s : Str ; ra : Str ; mod : Mod} ;
|
||||
|
||||
VPHSlash : Type = VPH ** {
|
||||
c2 : Compl ; -- prep or ra for the complement
|
||||
@@ -126,14 +126,14 @@ oper
|
||||
---------------------
|
||||
-- VP complementation
|
||||
---------------------
|
||||
appComp : Compl -> Str -> Str = \c2,obj ->
|
||||
c2.s ++ obj ++ c2.ra ;
|
||||
appComp : Compl -> (Mod=>Str) -> Str = \c2,obj ->
|
||||
c2.s ++ obj ! c2.mod ++ c2.ra ;
|
||||
|
||||
insertComp : (Agr => Str) -> VPH -> VPH = \obj,vp -> vp ** {
|
||||
comp = \\a => vp.comp ! a ++ obj ! a
|
||||
} ;
|
||||
|
||||
insertCompPre : (Agr=>Str) -> VPHSlash -> VPH = \obj,vp -> vp ** {
|
||||
insertCompPre : (Agr=>Mod=>Str) -> VPHSlash -> VPH = \obj,vp -> vp ** {
|
||||
comp = \\a => appComp vp.c2 (obj ! a) ++ vp.comp ! a
|
||||
} ;
|
||||
|
||||
@@ -152,8 +152,7 @@ oper
|
||||
} ;
|
||||
|
||||
complSlash : VPHSlash -> NP -> VPH = \vp,np -> vp ** {
|
||||
comp = \\a => appComp vp.c2 (np.s ! Bare)
|
||||
++ np.compl ++ vp.comp ! a ;
|
||||
comp = \\a => appComp vp.c2 np.s ++ vp.comp ! a ;
|
||||
obj = vp.obj ++ vp.agrObj ! np.a -- "beg her to buy", buy agrees with her
|
||||
} ;
|
||||
|
||||
@@ -264,14 +263,13 @@ oper
|
||||
-- Reflexive pronouns
|
||||
-----------------------------------
|
||||
|
||||
reflPron : Agr => Str = table {
|
||||
Ag Sg P1 => "خودم" ;
|
||||
Ag Sg P2 => "خودت" ;
|
||||
Ag Sg P3 => "خودش" ;
|
||||
Ag Pl P1 => "خودمان" ;
|
||||
Ag Pl P2 => "خودتان" ;
|
||||
Ag Pl P3 => "خودشان"
|
||||
|
||||
reflPron : Agr => Mod => Str = table {
|
||||
Ag Sg P1 => modTable "خودم" ;
|
||||
Ag Sg P2 => modTable "خودت" ;
|
||||
Ag Sg P3 => modTable "خودش" ;
|
||||
Ag Pl P1 => modTable "خودمان" ;
|
||||
Ag Pl P2 => modTable "خودتان" ;
|
||||
Ag Pl P3 => modTable "خودشان"
|
||||
} ;
|
||||
|
||||
getPron : Animacy -> Number -> Str = \ani,number ->
|
||||
|
||||
@@ -29,7 +29,7 @@ concrete StructuralPes of Structural = CatPes **
|
||||
-- everything_NP = R.indeclNP ["هر XE"]));
|
||||
everywhere_Adv = ss ["هر جا"] ;
|
||||
few_Det = mkDet ["تعداد کمی"] Pl True; -- check
|
||||
for_Prep = mkPrep "برای" ;
|
||||
for_Prep = mkPrep "برای" Ezafe ;
|
||||
from_Prep = mkPrep "از" ;
|
||||
he_Pron = R.agr2pron ! Ag Sg P3 ;
|
||||
here_Adv = ss "اینجا" ;
|
||||
@@ -44,7 +44,7 @@ concrete StructuralPes of Structural = CatPes **
|
||||
in_Prep = mkPrep "در" ;
|
||||
it_Pron = R.agr2pron ! Ag Sg P3;
|
||||
less_CAdv = {s = "کمتر" ; p = ""} ;
|
||||
many_Det = mkDet ["تعداد زیادی"] Pl True; -- check
|
||||
many_Det = mkDet "بسیار" Pl False Ezafe ;
|
||||
more_CAdv = {s = "بیشتر" ; p = "" } ;
|
||||
most_Predet = ss "اکثر";
|
||||
much_Det = mkDet ["مقدار زیادی"] Pl ;
|
||||
@@ -133,9 +133,6 @@ have_V2 = haveVerb ** {
|
||||
VSubj _ (Ag Pl P2) => "داشته باشید" ;
|
||||
VSubj _ (Ag Pl P3) => "داشته باشند" ;
|
||||
x => haveVerb.s ! x } ;
|
||||
c2 = {
|
||||
s = [] ;
|
||||
ra = [] --- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky
|
||||
}
|
||||
c2 = prepOrRa [] -- "را" ; ---- AR 18/9/2017: usually no ra acc. to Nasrin, but this is tricky
|
||||
} ;
|
||||
}
|
||||
|
||||
@@ -15,12 +15,12 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
|
||||
ComplVV = insertVV ;
|
||||
ComplVS v s = embComp (conjThat ++ s.s ! Indic) (predV v) ;
|
||||
ComplVQ v q = embComp (conjThat ++ q.s) (predV v) ;
|
||||
ComplVA v ap = insertObj (appComp v.c2 (ap.s ! Bare)) (predV v) ; -- check form of adjective
|
||||
ComplVA v ap = insertObj (appComp v.c2 ap.s) (predV v) ; -- check form of adjective
|
||||
|
||||
SlashVV vv vps = vps ** ComplVV vv vps ;
|
||||
SlashV2S v s = predVc v ** embComp (conjThat ++ s.s ! Indic) (predV v) ;
|
||||
SlashV2Q v q = predVc v ** embComp q.s (predV v) ;
|
||||
SlashV2A v ap = predVc v ** insertObj (appComp v.c2 (ap.s ! Bare)) (predV v) ; ---- paint it red , check form of adjective
|
||||
SlashV2A v ap = predVc v ** insertObj (appComp v.c2 ap.s) (predV v) ; ---- paint it red , check form of adjective
|
||||
|
||||
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
|
||||
SlashV2V v2v vp = predVc v2v ** {
|
||||
@@ -36,7 +36,7 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
|
||||
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
|
||||
SlashV2VNP v2v np vps = predVc v2v ** {
|
||||
comp = \\a => if_then_Str v2v.isAux conjThat [] -- that
|
||||
++ appComp v2v.c2 (np.s ! Bare) ; -- I
|
||||
++ appComp v2v.c2 np.s ; -- I
|
||||
-- ∅ is placed in comp
|
||||
vComp = \\_,_ => showVPH (case v2v.compl of { -- buy
|
||||
Subj => VSubj Pos np.a ;
|
||||
|
||||
Reference in New Issue
Block a user