mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 09:28:54 -06:00
@@ -13,7 +13,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
||||
SSlash,
|
||||
S = {s : Str} ;
|
||||
QS = {s : QForm => Str} ;
|
||||
RS = {s : Agr => Case => Str} ;
|
||||
RS = {s : Agr => Case => Str} ; -- case because the relative pronoun inflects in case
|
||||
|
||||
-- Sentence
|
||||
|
||||
@@ -79,7 +79,8 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
||||
|
||||
V, VS, VQ, VA = ResAra.Verb ; -- = {s : VForm => Str} ;
|
||||
V2, V2A = ResAra.Verb2 ;
|
||||
VV, V2S, V2Q = ResAra.Verb2 ;
|
||||
VV = ResAra.Verb2 ** {sc : Preposition} ;
|
||||
V2S, V2Q = ResAra.Verb2 ;
|
||||
V2V, V3 = ResAra.Verb3 ;
|
||||
|
||||
A = ResAra.Adj ;
|
||||
|
||||
@@ -18,6 +18,8 @@ concrete IdiomAra of Idiom = CatAra ** open
|
||||
-- : NP -> RS -> Cl ; -- it is I who did it
|
||||
--CleftNP np rs =
|
||||
|
||||
-- TODO: check page 61 for existentials and clefts /IL
|
||||
|
||||
-- : Adv -> S -> Cl ; -- it is here she slept
|
||||
CleftAdv adv s =
|
||||
let comp : Comp = {s = \\_,_ => adv.s ++ s.s} in ----
|
||||
@@ -31,7 +33,7 @@ concrete IdiomAra of Idiom = CatAra ** open
|
||||
|
||||
-- 7/12/2012 generalizations of these
|
||||
|
||||
-- : NP -> Adv -> Cl ; -- there is a house in Paris
|
||||
-- : NP -> Adv -> Cl ; -- there is a house in Paris
|
||||
ExistNPAdv np adv =
|
||||
predVP emptyNP (insertStr adv.s (insertObj np (predV copula ** {c2=noPrep}))) ;
|
||||
|
||||
|
||||
@@ -13,22 +13,20 @@ lin
|
||||
cn.s ! number
|
||||
! nounState det.d number
|
||||
! nounCase c det.n det.d ;
|
||||
adj : NTable -> Case -> Str = \ntable,c ->
|
||||
ntable ! number
|
||||
! (definite ! det.d) -- Indef remains Indef, rest become Def
|
||||
! c
|
||||
adj : Case -> Str = \c ->
|
||||
cn.s2 ! number
|
||||
! (definite ! det.d) -- Indef remains Indef, rest become Def
|
||||
! c
|
||||
} in {
|
||||
s = \\c =>
|
||||
case cnB4det det.isPron det.isNum det.n det.d of {
|
||||
False => determiner c
|
||||
++ noun c
|
||||
++ adj cn.s2 c
|
||||
++ adj cn.adj c
|
||||
++ adj c
|
||||
++ cn.np ! c ;
|
||||
True => noun (cas c) -- deal with possessive suffix
|
||||
++ determiner c
|
||||
++ adj cn.s2 c
|
||||
++ adj cn.adj c
|
||||
++ adj c
|
||||
++ cn.np ! c
|
||||
};
|
||||
a = { pgn = agrP3 cn.h cn.g number;
|
||||
@@ -170,10 +168,7 @@ lin
|
||||
} ;
|
||||
|
||||
MassNP cn =
|
||||
{s = \\c => cn.s ! Sg ! Indef ! c
|
||||
++ cn.s2 ! Sg ! Indef ! c
|
||||
++ cn.np ! c
|
||||
++ cn.adj ! Sg ! Indef ! c ;
|
||||
{s = \\c => cn2str cn Sg Indef c ;
|
||||
a = {pgn = Per3 cn.g Sg ; isPron = False} ;
|
||||
empty = []} ;
|
||||
|
||||
@@ -190,20 +185,23 @@ lin
|
||||
ComplN3 n3 np = ComplN2 n3 np ** {c2 = n3.c3} ;
|
||||
|
||||
AdjCN ap cn = cn ** {
|
||||
adj = \\n,d,c => cn.adj ! n ! d ! c ++ ap.s ! cn.h ! cn.g ! n ! (definite ! d) ! c
|
||||
s2 = \\n,d,c => cn.s2 ! n ! d ! c ++ ap.s ! cn.h ! cn.g ! n ! (definite ! d) ! c
|
||||
};
|
||||
|
||||
RelCN cn rs = cn ** {s = \\n,s,c => cn.s ! n ! s ! c ++ rs.s ! {pgn=Per3 cn.g n ; isPron=False} ! c};
|
||||
RelCN cn rs = cn ** {
|
||||
s2 = \\n,s,c => cn.s2 ! n ! s ! c ++ rs.s ! {pgn=Per3 cn.g n ; isPron=False} ! c};
|
||||
|
||||
RelNP np rs = np ** {s = \\c => np.s ! c ++ rs.s ! np.a ! c} ;
|
||||
-- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
|
||||
--
|
||||
-- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;
|
||||
|
||||
AdvCN,
|
||||
SentCN = \cn,ss -> cn ** {s2 = \\n,d,c => cn.s2 ! n ! d ! c ++ ss.s} ;
|
||||
|
||||
ApposCN cn np = cn ** { np = \\c => cn.np ! c ++ np.s ! c } ;
|
||||
|
||||
-- : CN -> NP -> CN ; -- house of Paris, house of mine
|
||||
PossNP cn np = cn ** {
|
||||
s = \\n,_d,c => cn.s ! n ! Const ! c ;
|
||||
s = \\n,_d,c => cn.s ! n ! Const ! c ;
|
||||
s2 = \\n,_d,c => cn.s2 ! n ! Const ! c ;
|
||||
np = \\c => cn.np ! c ++ np.s ! Gen
|
||||
};
|
||||
|
||||
|
||||
@@ -218,7 +218,11 @@ resource ParadigmsAra = open
|
||||
|
||||
v6 : Str -> V ;
|
||||
|
||||
--Verb Form VIII 'ifta`ala
|
||||
--Verb Form VII : tafaa`ala
|
||||
|
||||
v7 : Str -> V ;
|
||||
|
||||
--Verb Form VIII infa`ala
|
||||
|
||||
v8 : Str -> V ;
|
||||
|
||||
@@ -266,7 +270,8 @@ resource ParadigmsAra = open
|
||||
mkVV = overload {
|
||||
mkVV : V -> VV = regVV ;
|
||||
mkVV : V -> Str -> VV = c2VV ;
|
||||
mkVV : V -> Preposition -> VV = prepVV
|
||||
mkVV : V -> Preposition -> VV = prepVV ;
|
||||
mkVV : V -> Preposition -> Preposition -> VV = prep2VV
|
||||
} ;
|
||||
mkV2V : overload {
|
||||
mkV2V : V -> Str -> Str -> V2V ;
|
||||
@@ -463,6 +468,13 @@ resource ParadigmsAra = open
|
||||
lock_V = <>
|
||||
};
|
||||
|
||||
v7 =
|
||||
\rootStr ->
|
||||
let {
|
||||
fcl = mkRoot3 rootStr ;
|
||||
v7fun = v7geminate ; -- TODO add rest
|
||||
} in lin V (v7fun fcl) ;
|
||||
|
||||
v8 =
|
||||
\rootStr ->
|
||||
let {
|
||||
@@ -667,10 +679,10 @@ resource ParadigmsAra = open
|
||||
mkVS v = v ** {lock_VS = <>} ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
|
||||
regVV : V -> VV = \v -> lin VV v ** {c2 = mkPreposition "أَنْ"} ;
|
||||
c2VV : V -> Str -> VV = \v,prep -> regVV v ** {c2 = mkPreposition prep} ;
|
||||
prepVV : V -> Preposition -> VV = \v,prep -> regVV v ** {c2=prep} ;
|
||||
|
||||
regVV : V -> VV = \v -> lin VV v ** {c2 = mkPreposition "أَنْ" ; sc = noPrep} ;
|
||||
c2VV : V -> Str -> VV = \v,prep -> regVV v ** {c2 = mkPreposition prep ; sc = noPrep} ;
|
||||
prepVV : V -> Preposition -> VV = \v,prep -> regVV v ** {c2=prep; sc=noPrep} ;
|
||||
prep2VV : V -> (_,_ : Preposition) -> VV = \v,p1,p2 -> regVV v ** {c2=p1; sc=p2} ;
|
||||
V0 : Type = V ;
|
||||
---- V2S, V2V, V2Q, V2A : Type = V2 ;
|
||||
AS, A2S, AV : Type = A ;
|
||||
@@ -715,12 +727,12 @@ formV : (root : Str) -> VerbForm -> V = \s,f -> case f of {
|
||||
FormIV => v4 s ;
|
||||
FormV => v5 s ;
|
||||
FormVI => v6 s ;
|
||||
--- FormVII => v7 s ;
|
||||
FormVII => v7 s ;
|
||||
FormVIII => v8 s ;
|
||||
FormX => v10 s
|
||||
} ;
|
||||
|
||||
param VerbForm =
|
||||
FormI | FormII | FormIII | FormIV | FormV | FormVI | FormVIII | FormX ;
|
||||
FormI | FormII | FormIII | FormIV | FormV | FormVI | FormVII | FormVIII | FormX ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -71,7 +71,7 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
|
||||
IdetCN idet cn = {
|
||||
s = \\isPred,g,s,c
|
||||
=> idet.s ! cn.g ! s ! c ++
|
||||
cn.s ! idet.n ! Indef ! Gen ; --idaafa
|
||||
cn2str cn idet.n Indef Gen ; --idaafa
|
||||
a = { pgn = agrP3 NoHum cn.g idet.n ; isPron = False }
|
||||
} ;
|
||||
|
||||
|
||||
@@ -137,14 +137,18 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
|
||||
uttAP : AP -> (Gender => Str) ;
|
||||
uttAP ap = \\g => ap.s ! NoHum ! g ! Sg ! Def ! Nom ; ----IL
|
||||
|
||||
CN : Type = Noun ** {adj : NTable ; np : Case => Str};
|
||||
CN : Type = Noun ** {np : Case => Str};
|
||||
|
||||
useN : Noun -> CN = \n -> n ** {adj = \\_,_,_ => []; np = \\_ => []} ;
|
||||
-- All fields of NP
|
||||
cn2str : CN -> Number -> State -> Case -> Str = \cn,n,s,c ->
|
||||
cn.s ! n ! s ! c ++
|
||||
cn.s2 ! n ! s ! c ++
|
||||
cn.np ! c ;
|
||||
|
||||
useN : Noun -> CN = \n -> n ** {np = \\_ => []} ;
|
||||
|
||||
uttCN : CN -> (Gender => Str) ;
|
||||
uttCN cn = \\_ => cn.s ! Sg ! Indef ! Bare ++
|
||||
cn.s2 ! Sg ! Indef ! Bare ++
|
||||
cn.adj ! Sg ! Indef ! Bare ;
|
||||
uttCN cn = \\_ => cn2str cn Sg Indef Bare ;
|
||||
|
||||
NumOrdCard : Type = {
|
||||
s : Gender => State => Case => Str ;
|
||||
@@ -689,6 +693,33 @@ v6sound : Root3 -> Verb =
|
||||
mutafAqam = "م" + utafAqam
|
||||
} in verb tafAqam tufUqim atafAqam utafAqam tafAqam mutafAqam;
|
||||
|
||||
-- v7sound : Root3 -> Verb = -- TODO 7s
|
||||
-- \fcl ->
|
||||
-- let {
|
||||
-- _facal = mkStrong facal fcl ;
|
||||
-- _facil = mkStrong facil fcl;
|
||||
-- infacal = "اِنْ" + _facal ; -- VPerf Act
|
||||
-- ; -- VPerf Pas
|
||||
-- anfacil = "َنْ" + _facil ; -- VImpf _ Act
|
||||
-- ; -- VImpf _ Pas
|
||||
-- ; -- VImp
|
||||
-- -- VPPart
|
||||
-- } in
|
||||
-- verb ;
|
||||
|
||||
v7geminate : Root3 -> Verb = -- IL 7g -- very likely wrong
|
||||
\fcl ->
|
||||
let {
|
||||
_nfacc = "نْ" + mkHollow facc fcl ;
|
||||
infacal = "اِنْ" + mkStrong facal fcl ; -- VPerf Act -- TODO use another constructor, this is wrong for 3rd person
|
||||
unfucc = "اُنْ" + mkHollow fucc fcl ; -- VPerf Pas
|
||||
anfacc = "َ" + _nfacc ; -- VImpf _ Act
|
||||
unfacc = "ُ" + _nfacc ; -- VImpf _ Pas
|
||||
infacc = "اِ" + _nfacc ; -- VImp
|
||||
munfacc = "مُ" +_nfacc -- VPPart
|
||||
} in
|
||||
verb infacal unfucc anfacc unfacc infacc munfacc ;
|
||||
|
||||
v8sound : Root3 -> Verb =
|
||||
\rbT ->
|
||||
let {
|
||||
@@ -740,8 +771,8 @@ v8hollow : Root3 -> Verb = -- IL
|
||||
v10sound : Root3 -> Verb = ---- IL 10s -- to be checked
|
||||
\qtl ->
|
||||
let {
|
||||
_staqtal = "َستَ" + mkStrong fcal qtl ;
|
||||
_staqtil = "َستَ" + mkStrong fcil qtl;
|
||||
_staqtal = "ستَ" + mkStrong fcal qtl ;
|
||||
_staqtil = "ستَ" + mkStrong fcil qtl;
|
||||
istaqtal = "اِ" + _staqtal ; -- VPerf Act
|
||||
ustuqtil = "اُسْتُ" + mkStrong fcil qtl; -- VPerf Pas
|
||||
astaqtil = "َ" + _staqtil ; -- VImpf _ Act
|
||||
@@ -1363,6 +1394,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
|
||||
VP : Type = {
|
||||
s : PerGenNum => VPForm => Str ;
|
||||
sc : Preposition ; -- subject case: e.g. يُمْكِنُ *لِ*Xِ
|
||||
obj : Obj;
|
||||
pred : Comp;
|
||||
isPred : Bool; --indicates if there is a predicate (xabar)
|
||||
@@ -1382,6 +1414,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
VPImpf m => v.s ! (VImpf m Act pgn);
|
||||
VPImp => v.s ! (VImp gn.g gn.n)
|
||||
};
|
||||
sc = noPrep ;
|
||||
obj = emptyObj ;
|
||||
s2 = [];
|
||||
pred = {s = \\_,_ => []} ;
|
||||
@@ -1431,7 +1464,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
subj = np.empty
|
||||
++ case <vp.isPred,np.a.isPron> of {
|
||||
<False,True> => [] ; -- prodrop if it's not predicative
|
||||
_ => np.s ! Nom
|
||||
_ => vp.sc.s ++ np.s ! vp.sc.c
|
||||
} ;
|
||||
|
||||
} in
|
||||
|
||||
@@ -45,7 +45,7 @@ concrete StructuralAra of Structural = CatAra **
|
||||
in8front_Prep = mkPrep "مُقَابِلَ" ;
|
||||
i_Pron = ResAra.i_Pron ;
|
||||
in_Prep = mkPrep "فِي" ;
|
||||
it_Pron = he_Pron ; -- was: it_Pron = mkPron "ِت" "ِت" "ِتس" (Per3 Masc Sg);
|
||||
it_Pron = emptyNP ** {s = \\_ => "هَذَا"} ; -- was: it_Pron = mkPron "ِت" "ِت" "ِتس" (Per3 Masc Sg);
|
||||
-- less_CAdv = ss "لسّ" ;
|
||||
many_Det = mkDet "جَمِيع" Pl Const ;
|
||||
-- more_CAdv = ss "مْري" ;
|
||||
|
||||
@@ -9,18 +9,18 @@ lin
|
||||
FloatPN i = {s = \\c => i.s ; g = Masc ; h = NoHum } ; --IL
|
||||
NumPN i = {s = \\c => uttNum i ! Masc ; g = Masc ; h = NoHum } ; --IL
|
||||
-- CNIntNP cn i = {
|
||||
-- s = \\c => cn.s ! Sg ! Def ! c ++ uttNum i ! Masc ;
|
||||
-- s = \\c => cn2str cn Sg Def c ++ uttNum i ! cn.g ;
|
||||
-- a = dummyAgrP3 Sg ;
|
||||
-- } ;
|
||||
--IL TODO: check out some opers regarding state in ResAra. These are just dummy values.
|
||||
CNSymbNP det cn xs =
|
||||
let g = cn.g ; n = sizeToNumber det.n in {
|
||||
s = \\c => det.s ! NoHum ! g ! c ++ cn.s ! Sg ! Def ! c ++ cn.adj ! n ! Def ! c ++ xs.s; ----IL word order?? Seems to be nontrivial according to ResAra comments.
|
||||
s = \\c => det.s ! NoHum ! g ! c ++ cn2str cn n Def c ++ xs.s; ----IL word order?? Seems to be nontrivial according to ResAra comments.
|
||||
a = dummyAgrP3 n ;
|
||||
empty = []
|
||||
} ;
|
||||
CNNumNP cn i = {
|
||||
s = \\c => cn.s ! Sg ! Def ! c ++ uttNum i ! Masc ;
|
||||
s = \\c => cn2str cn Sg Def c ++ uttNum i ! cn.g ;
|
||||
a = dummyAgrP3 Sg ;
|
||||
empty = []
|
||||
} ;
|
||||
|
||||
@@ -22,7 +22,8 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
|
||||
s = \\pgn,vpf => vvVP.s ! pgn ! vpf
|
||||
++ vv.c2.s -- أَنْ
|
||||
++ vp.s ! pgn ! VPImpf Cnj ;
|
||||
isPred = False
|
||||
isPred = False ;
|
||||
sc = vv.sc
|
||||
} ;
|
||||
|
||||
-- : VS -> S -> VP ; -- say that she runs
|
||||
@@ -63,7 +64,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
|
||||
CompAdv a = {s = \\_,_ => a.s ;
|
||||
obj = emptyObj ; isNP = False} ;
|
||||
|
||||
CompCN cn = {s = \\agr,c => cn.s ! agr.n ! Indef ! Nom ++ cn.np ! Nom ++ cn.adj ! agr.n ! Indef ! Nom ;
|
||||
CompCN cn = {s = \\agr,c => cn2str cn agr.n Indef Nom ;
|
||||
obj = emptyObj ; isNP = False} ;
|
||||
CompNP np = {s = \\_,_ => [] ; obj = np ** {s = np.s ! Nom} ; isNP = True} ;
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user