1
0
forked from GitHub/gf-rgl

Merge pull request #80 from inariksit/arabic

Arabic
This commit is contained in:
Inari Listenmaa
2018-11-20 16:04:32 +01:00
committed by GitHub
9 changed files with 156 additions and 74 deletions

View File

@@ -44,4 +44,6 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
s = \\h,g,n,d,c => a.s ! AComp d c s = \\h,g,n,d,c => a.s ! AComp d c
}; };
-- : Ord -> AP ; -- warmest
AdjOrd ord = {s = \\h,g,n,s,c => ord.s ! g ! s ! c} ;
} }

View File

@@ -79,9 +79,10 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
V, VS, VQ, VA = ResAra.Verb ; -- = {s : VForm => Str} ; V, VS, VQ, VA = ResAra.Verb ; -- = {s : VForm => Str} ;
V2, V2A = ResAra.Verb2 ; V2, V2A = ResAra.Verb2 ;
VV = ResAra.Verb2 ** {sc : Preposition} ; VV = ResAra.Verb2 ** {sc : Preposition} ; -- c2 is for verb
V2S, V2Q = ResAra.Verb2 ; V2S, V2Q = ResAra.Verb2 ;
V2V, V3 = ResAra.Verb3 ; V3 = ResAra.Verb3 ;
V2V = ResAra.Verb3 ** {sc : Preposition} ; -- c3 is for verb, c2 is for dir.obj
A = ResAra.Adj ; A = ResAra.Adj ;
A2 = ResAra.Adj2 ; A2 = ResAra.Adj2 ;

View File

@@ -3,11 +3,8 @@ resource MissingAra = open GrammarAra, Prelude in {
-- temporary definitions to enable the compilation of RGL API -- temporary definitions to enable the compilation of RGL API
oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ; oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ;
oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ; oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ;
oper AdjOrd : Ord -> AP = notYet "AdjOrd" ;
oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ; oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ;
oper AdvCN : CN -> Adv -> CN = notYet "AdvCN" ;
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ; oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
oper AdvS : Adv -> S -> S = notYet "AdvS" ;
oper BaseRS : RS -> RS -> ListRS = notYet "BaseRS" ; oper BaseRS : RS -> RS -> ListRS = notYet "BaseRS" ;
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ; oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ; oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
@@ -36,8 +33,6 @@ oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ;
oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ; oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ;
oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ; oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ;
oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ; oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ;
oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ;
oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ;
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ; oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ; oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
oper VocNP : NP -> Voc = notYet "VocNP" ; oper VocNP : NP -> Voc = notYet "VocNP" ;

View File

@@ -114,7 +114,7 @@ resource ParadigmsAra = open
mkN2 : overload { mkN2 : overload {
mkN2 : N -> Preposition -> N2 ; -- ready-made preposition mkN2 : N -> Preposition -> N2 ; -- ready-made preposition
mkN2 : (mother : N) -> (of_ : Str) -> N2 ; -- preposition given as a string mkN2 : N -> Str -> N2 ; -- preposition given as a string
mkN2 : N -> N2 ; -- no preposition mkN2 : N -> N2 ; -- no preposition
mkN2 : Str -> N2 ; -- no preposition, predictable inflection mkN2 : Str -> N2 ; -- no preposition, predictable inflection
} ; } ;
@@ -195,21 +195,21 @@ resource ParadigmsAra = open
reflV : V -> V ; -- نَفْس in the proper case and with possessive suffix, e.g. نَفْسَكِ reflV : V -> V ; -- نَفْس in the proper case and with possessive suffix, e.g. نَفْسَكِ
v1 : Str -> Vowel -> Vowel -> V ; --Verb Form I : fa`ala, fa`ila, fa`ula v1 : Str -> Vowel -> Vowel -> V ; -- Verb Form I : fa`ala, fa`ila, fa`ula
v2 : Str -> V ; --Verb Form II : fa``ala v2 : Str -> V ; -- Verb Form II : fa``ala
v3 : Str -> V ; --Verb Form III : faa`ala v3 : Str -> V ; -- Verb Form III : faa`ala
v4 : Str -> V ; --Verb Form IV : 'af`ala v4 : Str -> V ; -- Verb Form IV : 'af`ala
v5 : Str -> V ; --Verb Form V : tafa``ala v5 : Str -> V ; -- Verb Form V : tafa``ala
v6 : Str -> V ; --Verb Form VI : tafaa`ala v6 : Str -> V ; -- Verb Form VI : tafaa`ala
v7 : Str -> V ; --Verb Form VII : infa`ala v7 : Str -> V ; -- Verb Form VII : infa`ala
v8 : Str -> V ; --Verb Form VIII ifta`ala v8 : Str -> V ; -- Verb Form VIII ifta`ala
v10 : Str -> V ; -- Verb Form X 'istaf`ala v10 : Str -> V ; -- Verb Form X 'istaf`ala
@@ -419,6 +419,7 @@ resource ParadigmsAra = open
let root : Root3 = mkRoot3 rootStr ; let root : Root3 = mkRoot3 rootStr ;
verb : Verb = case rootStr of { verb : Verb = case rootStr of {
? + #hamza + #weak => v4doubleweak root ; ? + #hamza + #weak => v4doubleweak root ;
? + #weak + ? => v4hollow root ;
_ + #weak => v4defective root ; _ + #weak => v4defective root ;
_ => v4sound root } ; _ => v4sound root } ;
in lin V verb ; in lin V verb ;
@@ -475,9 +476,10 @@ resource ParadigmsAra = open
\rootStr -> \rootStr ->
let { let {
rbT = mkRoot3 rootStr ; rbT = mkRoot3 rootStr ;
v10fun = case rbT.c of { v10fun : Root3 -> Verb = case rootStr of {
("و"|"ي") => v10hollow ; ? + #weak + ? => v10hollow ;
_ => v10sound } ? + ? + #weak => v10defective ;
_ => v10sound }
} in lin V (v10fun rbT) ; } in lin V (v10fun rbT) ;
reflV v = lin V (ResAra.reflV v) ; reflV v = lin V (ResAra.reflV v) ;
@@ -686,9 +688,9 @@ resource ParadigmsAra = open
mkV2S v p = lin V2S (prepV2 v (mkPreposition p)) ; mkV2S v p = lin V2S (prepV2 v (mkPreposition p)) ;
mkV2V = overload { mkV2V = overload {
mkV2V : V -> Str -> Str -> V2V = \v,p,q -> mkV2V : V -> Str -> Str -> V2V = \v,p,q ->
lin V2V (prepV3 v (mkPreposition p) (mkPreposition q)) ; lin V2V (prepV3 v (mkPreposition p) (mkPreposition q) ** {sc = noPrep}) ;
mkV2V : V -> Preposition -> Preposition -> V2V = \v,p,q -> mkV2V : V -> Preposition -> Preposition -> V2V = \v,p,q ->
lin V2V (prepV3 v p q) ; lin V2V (prepV3 v p q ** {sc = noPrep}) ;
mkV2V : VV -> Preposition -> V2V = \vv,p -> mkV2V : VV -> Preposition -> V2V = \vv,p ->
lin V2V (vv ** {c2 = p ; c3 = vv.c2}) ; lin V2V (vv ** {c2 = p ; c3 = vv.c2}) ;
} ; } ;

View File

@@ -35,9 +35,13 @@ flags coding=utf8 ;
fuci = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ِ" } ; fuci = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ِ" } ;
fucu = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ُ" } ; fucu = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ُ" } ;
fUc = { h = "" ; m1 = "ُو"; m2 = ""; t = "" } ; fUc = { h = "" ; m1 = "ُو"; m2 = ""; t = "" } ;
ufAc = { h = "ُ" ; m1 = "َا"; m2 = ""; t = "" } ;
ufca = { h = "ُ" ; m1 = "ْ" ; m2 = ""; t = "َ" } ; ufca = { h = "ُ" ; m1 = "ْ" ; m2 = ""; t = "َ" } ;
eafAc = fAc ** { h = "أَ" } ;
eafac = fac ** { h = "أَ" } ;
eafIc = fIc ** { h = "أَ" } ;
eafic = fic ** { h = "أَ" } ;
eafAcil = { h = "أَ"; m1 = "َا" ; m2 = "ِ" ; t = "" } ; eafAcil = { h = "أَ"; m1 = "َا" ; m2 = "ِ" ; t = "" } ;
eafAcIl = { h = "أَ"; m1 = "َا" ; m2 = "ِي" ; t = "" } ; eafAcIl = { h = "أَ"; m1 = "َا" ; m2 = "ِي" ; t = "" } ;
eafcilp = { h = "أَ"; m1 = "ْ" ; m2 = "ِ" ; t = "َة" } ; eafcilp = { h = "أَ"; m1 = "ْ" ; m2 = "ِ" ; t = "َة" } ;
@@ -47,6 +51,12 @@ flags coding=utf8 ;
eafcul = { h = "أَ"; m1 = "ْ" ; m2 = "ُ" ; t = "" } ; eafcul = { h = "أَ"; m1 = "ْ" ; m2 = "ُ" ; t = "" } ;
eiftacal = { h = "إِ"; m1 = "ْتَ" ; m2 = "َ" ; t = "" } ; eiftacal = { h = "إِ"; m1 = "ْتَ" ; m2 = "َ" ; t = "" } ;
eufcil = { h = "أُ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ; eufcil = { h = "أُ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ;
eufic = fic ** { h = "أُ" } ;
eufIc = fIc ** { h = "أُ" } ;
ufic = fic ** { h = "ُ" } ;
ufIc = fIc ** { h = "ُ" } ;
ufac = fac ** { h = "ُ" } ;
ufAc = fAc ** { h = "ُ" } ;
euftucil = { h = "أُ"; m1 = "ْتُ" ; m2 = "ِ" ; t = "" } ; euftucil = { h = "أُ"; m1 = "ْتُ" ; m2 = "ِ" ; t = "" } ;
euttucil = euftucil ** { h = "اُتُّ" ; m1 = "ِ" } ; ---- IL assimilated VIII euttucil = euftucil ** { h = "اُتُّ" ; m1 = "ِ" } ; ---- IL assimilated VIII
afcul = { h = "َ" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ; afcul = { h = "َ" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ;

View File

@@ -112,10 +112,10 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
emptyNTable : NTable = \\n,s,c => [] ; emptyNTable : NTable = \\n,s,c => [] ;
Preposition : Type = {s : Str ; c : Case} ; Preposition : Type = {s : Str ; c : Case} ;
Noun : Type = { Noun : Type = {
s,s2 : NTable ; s,s2 : NTable ;
g : Gender ; g : Gender ;
h : Species ; h : Species ;
isDual : Bool -- whether it takes dual instead of plural: eyes, twins, ... isDual : Bool -- whether it takes dual instead of plural: eyes, twins, ...
} ; } ;
Noun2 : Type = Noun ** {c2 : Preposition} ; Noun2 : Type = Noun ** {c2 : Preposition} ;
@@ -649,6 +649,28 @@ v4sound : Root3 -> Verb =
} in } in
verb eaqnac euqnic uqnic uqnac eaqnic muqnac; verb eaqnac euqnic uqnic uqnac eaqnic muqnac;
v4hollow : Root3 -> Verb =
\rwd ->
let {
earad = mkHollow eafac rwd ; -- VPerf Act (Per3 Fem Pl) etc.
earAd = mkHollow eafAc rwd ; -- VPerf Act
eurid = mkHollow eufic rwd ; -- VPerf Pas (Per3 Fem Pl) etc.
eurId = mkHollow eufIc rwd ; -- VPerf Pas
urid = mkHollow ufic rwd ; -- VImpf Act (Per2/Per3 Fem Pl)
urId = mkHollow ufIc rwd ; -- VImpf Act
urad = mkHollow ufac rwd ; -- VImpf Pas (Per2/Per3 Fem Pl)
urAd = mkHollow ufAc rwd ; -- VImpf Pas
earid = mkHollow eafic rwd ; -- VImp (Sg Masc / Pl Fem)
earId = mkHollow eafIc rwd ; -- VImp (Pl Masc / Sg Fem)
ppart = "م" + urAd ;
} in verbHollow (toDefForms
earAd earad eurId eurid
urId urid urAd urad
earId earid ppart) ;
v4DefForms : Root3 -> DefForms = \cTy -> v4DefForms : Root3 -> DefForms = \cTy ->
let { let {
@@ -749,7 +771,7 @@ v8assimilated : Root3 -> Verb = --- IL 8a1
muttafaq = "م" + uttafaq muttafaq = "م" + uttafaq
} in verb eittafaq euttufiq attafiq uttafaq eittafiq muttafaq; } in verb eittafaq euttufiq attafiq uttafaq eittafiq muttafaq;
v8hollow : Root3 -> Verb = -- IL v8hollow : Root3 -> Verb = -- IL
\Hwj -> \Hwj ->
let { let {
_Htaj = mkHollow ftacal Hwj ; _Htaj = mkHollow ftacal Hwj ;
@@ -771,7 +793,7 @@ v8hollow : Root3 -> Verb = -- IL
} in verbHollow (toDefForms } in verbHollow (toDefForms
iHtAj iHtaj uHtIj uHtij aHtAj aHtaj iHtAj iHtaj uHtIj uHtij aHtAj aHtaj
uHtAj uHtaj iHtAj iHtaj ppart) ; uHtAj uHtaj iHtAj iHtaj ppart) ;
v10sound : Root3 -> Verb = ---- IL 10s -- to be checked v10sound : Root3 -> Verb = -- IL 10s -- to be checked
\qtl -> \qtl ->
let { let {
_staqtal = "ستَ" + mkStrong fcal qtl ; _staqtal = "ستَ" + mkStrong fcal qtl ;
@@ -785,7 +807,7 @@ v10sound : Root3 -> Verb = ---- IL 10s -- to be checked
} in } in
verb istaqtal ustuqtil astaqtil astaqtal istaqtil mustaqtal ; verb istaqtal ustuqtil astaqtil astaqtal istaqtil mustaqtal ;
v10hollow : Root3 -> Verb = ---- IL 10h -- to be checked v10hollow : Root3 -> Verb = -- IL 10h -- to be checked
\xwf -> \xwf ->
let { let {
_staxaf = "سْتَ" + mkHollow fac xwf ; _staxaf = "سْتَ" + mkHollow fac xwf ;
@@ -804,10 +826,33 @@ v10hollow : Root3 -> Verb = ---- IL 10h -- to be checked
ustaxAf = "ُ" + _staxAf ; -- VImpf Pas _ ustaxAf = "ُ" + _staxAf ; -- VImpf Pas _
ppart = "مُ" + _staxIf -- PPart ("weird anomalies" here too?) ppart = "مُ" + _staxIf -- PPart ("weird anomalies" here too?)
} in verbHollow (toDefForms } in verbHollow (toDefForms
istaxAf istaxaf ustuxIf ustuxif astaxIf astaxif istaxAf istaxaf ustuxIf ustuxif astaxIf astaxif
ustaxAf ustaxaf istaxif istaxIf ppart) ; ustaxAf ustaxaf istaxif istaxIf ppart) ;
v10defective : Root3 -> Verb = -- IL
\lqy ->
let {
_stalqa = "سْتَ" + mkDefective fca lqy ;
_stalqu = "سْتَ" + mkDefective fcu lqy ;
_stalqi = "سْتَ" + mkDefective fci lqy ;
_stulqi = "سْتُ" + mkDefective fci lqy ;
istalqa = "اِ" + _stalqa ; -- VPerf Act (Per3 Masc Sg)
istalqay = "اِسْتَ" + mkStrong fcal lqy ; -- VPerf Act (Per3 Fem Pl)
ustulqi = "اُ" + _stulqi; -- VPerf Pas (Per3 _ _)
astalqu = "َ" + _stalqu ; -- VImpf Act (Per2/3 Masc Pl)
astalqi = "َ" + _stalqi ; -- VImpf Act _
ustalqa = "ُ" + _stalqa ; -- VImpf Pas _
istalqi = "اِ" + _stalqi; -- VImp (Masc Sg / Fem _)
istalqu = "اِ" + _stalqu; -- VImp Masc Pl
mustalqin = "مُ" + _stalqi + "ت" ;
} in verbDef (toDefForms
istalqa istalqay ustulqi ustulqi ustulqi
astalqi astalqu ustalqa istalqi istalqu mustalqin) i ;
patV1Perf : Vowel => Pattern = patV1Perf : Vowel => Pattern =
table { table {
a => facal ; --katab a => facal ; --katab
@@ -1034,7 +1079,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
}; };
-- if a word ends in ء or ة, don't add alif for indef acc. -- if a word ends in ء or ة, don't add alif for indef acc.
dec1sgNoDoubleAlif : State => Case => Str = \\s,c => dec1sgNoDoubleAlif : State => Case => Str = \\s,c =>
case <s,c> of { case <s,c> of {
<Indef,Acc> => "ً" ; <Indef,Acc> => "ً" ;
@@ -1229,7 +1274,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
} }
}; };
gn2pgn : {g : Gender; n : Number} -> PerGenNum = \gn -> gn2pgn : {g : Gender; n : Number} -> PerGenNum = \gn ->
case gn of { {g = gn; n = nm} => Per3 gn nm } ; case gn of { {g = gn; n = nm} => Per3 gn nm } ;
-- these are chosen in many places, trying to be consistent -- these are chosen in many places, trying to be consistent
@@ -1304,33 +1349,36 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
empty = [] empty = []
}; };
proDrop : NP -> NP = \np -> proDrop : NP -> NP = \np ->
case np.a.isPron of { case np.a.isPron of {
True => np ** {s = table {Nom => [] ; x => np.s ! x}}; True => np ** {s = table {Nom => [] ; x => np.s ! x}};
_ => np _ => np
} ; } ;
emptyNP : NP = { emptyNP : NP = {
s = \\_ => [] ; s = \\_ => [] ;
a = {pgn = Per3 Masc Sg ; isPron = False} ; a = {pgn = Per3 Masc Sg ; isPron = False} ;
empty = [] } ; empty = [] } ;
agrNP : Agr -> NP = \agr -> emptyNP ** {a = agr} ; agrNP : Agr -> NP = \agr -> emptyNP ** {a = agr} ;
i_Pron : NP = mkPron "أَنَا" "نِي" "ي" (Per1 Sing) ; i_Pron : NP = mkPron "أَنَا" "نِي" "ي" (Per1 Sing) ;
youSgMasc_Pron : NP = mkPron "أَنتَ" "كَ" "كَ" (Per2 Masc Sg) ;
youSgFem_Pron : NP = mkPron "أَنتِ" "كِ" "كِ" (Per2 Fem Sg) ;
youDlMasc_Pron : NP = mkPron "أَنتُمَا" "كُمَا" "كُمَا" (Per2 Masc Dl) ;
youDlFem_Pron : NP = mkPron "أَنتُمَا" "كُمَا" "كُمَا" (Per2 Fem Dl) ;
he_Pron : NP = mkPron "هُوَ" "هُ" "هُ" (Per3 Masc Sg) ;
she_Pron : NP = mkPron "هِيَ" "ها" "ها" (Per3 Fem Sg) ;
we_Pron : NP = mkPron "نَحنُ" "نا" "نا" (Per1 Plur) ; we_Pron : NP = mkPron "نَحنُ" "نا" "نا" (Per1 Plur) ;
youPlMasc_Pron : NP = mkPron "أَنتُمْ" "كُمْ" "كُمْ" (Per2 Masc Sg) ;
youPlFem_Pron : NP = mkPron "أَنتُنَّ" "كُنَّ" "كُنَّ" (Per2 Fem Sg) ; youSgMasc_Pron : NP = mkPron "أَنتَ" "كَ" "كَ" (Per2 Masc Sg) ;
theyMasc_Pron : NP = mkPron "هُمْ" "هُمْ" "هُمْ" (Per3 Masc Pl) ; youSgFem_Pron : NP = mkPron "أَنتِ" "كِ" "كِ" (Per2 Fem Sg) ;
theyFem_Pron : NP = mkPron "هُنَّ" "هُنَّ" "هُنَّ" (Per3 Fem Pl) ; youDlMasc_Pron : NP = mkPron "أَنتُمَا" "كُمَا" "كُمَا" (Per2 Masc Dl) ;
youDlFem_Pron : NP = mkPron "أَنتُمَا" "كُمَا" "كُمَا" (Per2 Fem Dl) ;
youPlMasc_Pron : NP = mkPron "أَنتُمْ" "كُمْ" "كُمْ" (Per2 Masc Pl) ;
youPlFem_Pron : NP = mkPron "أَنتُنَّ" "كُنَّ" "كُنَّ" (Per2 Fem Pl) ;
he_Pron : NP = mkPron "هُوَ" "هُ" "هُ" (Per3 Masc Sg) ;
she_Pron : NP = mkPron "هِيَ" "ها" "ها" (Per3 Fem Sg) ;
theyDlMasc_Pron : NP = mkPron "هُمَا" "هُمَا" "هُمَا" (Per3 Masc Dl) ; theyDlMasc_Pron : NP = mkPron "هُمَا" "هُمَا" "هُمَا" (Per3 Masc Dl) ;
theyDlFem_Pron : NP = mkPron "هُمَا" "هُمَا" "هُمَا" (Per3 Fem Dl) ; theyDlFem_Pron : NP = mkPron "هُمَا" "هُمَا" "هُمَا" (Per3 Fem Dl) ;
theyMasc_Pron : NP = mkPron "هُمْ" "هُمْ" "هُمْ" (Per3 Masc Pl) ;
theyFem_Pron : NP = mkPron "هُنَّ" "هُنَّ" "هُنَّ" (Per3 Fem Pl) ;
-- Used e.g. to encode the subject as an object clitic -- Used e.g. to encode the subject as an object clitic
-- or to find a possessive suffix corresponding to the NP. -- or to find a possessive suffix corresponding to the NP.
@@ -1340,7 +1388,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
False => pgn2pron np.a.pgn False => pgn2pron np.a.pgn
} ; } ;
pgn2pron : PerGenNum -> NP = \pgn -> pgn2pron : PerGenNum -> NP = \pgn ->
case pgn of { case pgn of {
Per1 Sing => i_Pron ; Per1 Sing => i_Pron ;
Per1 Plur => we_Pron ; Per1 Plur => we_Pron ;
@@ -1355,7 +1403,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
Per3 Fem Dl => theyDlFem_Pron ; Per3 Fem Dl => theyDlFem_Pron ;
Per3 Masc Dl => theyDlMasc_Pron ; Per3 Masc Dl => theyDlMasc_Pron ;
Per3 Fem Pl => theyFem_Pron ; Per3 Fem Pl => theyFem_Pron ;
Per3 Masc Pl => theyMasc_Pron Per3 Masc Pl => theyMasc_Pron
} ; } ;
pron2np : NP -> NP = \np -> np ** { pron2np : NP -> NP = \np -> np ** {
@@ -1385,25 +1433,25 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
a : Agr -- can be both subject and object of a QCl, needs full agr. info (stupid given that s depends on gender but meh) a : Agr -- can be both subject and object of a QCl, needs full agr. info (stupid given that s depends on gender but meh)
} ; } ;
mkIP = overload { mkIP = overload {
mkIP : Str -> Number -> IP = \maa,n -> { mkIP : Str -> Number -> IP = \maa,n -> {
s = \\_p,_g,_s,_c => maa ; s = \\_p,_g,_s,_c => maa ;
a = { pgn = agrP3 NoHum Masc n ; isPron = False } a = { pgn = agrP3 NoHum Masc n ; isPron = False }
} ; } ;
mkIP : (_,_ : Str) -> Number -> IP = \maa,maadhaa,n -> { mkIP : (_,_ : Str) -> Number -> IP = \maa,maadhaa,n -> {
s = table { True => \\_g,_s,_c => maa ; s = table { True => \\_g,_s,_c => maa ;
False => \\_g,_s,_c => maadhaa } ; False => \\_g,_s,_c => maadhaa } ;
a = { pgn = agrP3 NoHum Masc n ; isPron = False } a = { pgn = agrP3 NoHum Masc n ; isPron = False }
} }
} ; } ;
ip2np : IP -> Bool -> NP = \ip,isPred -> ip ** { s = ip.s ! isPred ! Masc ! Def ; empty = [] } ; ip2np : IP -> Bool -> NP = \ip,isPred -> ip ** { s = ip.s ! isPred ! Masc ! Def ; empty = [] } ;
np2ip : NP -> IP = \np -> np ** {s = \\_,_,_ => np.s} ; np2ip : NP -> IP = \np -> np ** {s = \\_,_,_ => np.s} ;
IDet : Type = { IDet : Type = {
s : Gender -- IdetCN needs to choose the gender of the CN s : Gender -- IdetCN needs to choose the gender of the CN
=> State -- Needs to be retained variable for IP; PrepIP chooses the state of IP => State -- Needs to be retained variable for IP; PrepIP chooses the state of IP
=> Case => Str ; => Case => Str ;
n : Number ; n : Number ;
d : State -- in IdetCN, chooses the state of the CN d : State -- in IdetCN, chooses the state of the CN
} ; } ;
@@ -1438,7 +1486,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
}; };
uttVP : VP -> (Gender=>Str) = \vp -> uttVP : VP -> (Gender=>Str) = \vp ->
\\g => vp.s ! Per3 g Sg ! VPPerf \\g => vp.s ! Per3 g Sg ! VPPerf
++ vp.obj.s ++ vp.pred.s ! {n = Sg ; g = g} ! Nom ++ vp.obj.s ++ vp.pred.s ! {n = Sg ; g = g} ! Nom
++ vp.s2 ; ++ vp.s2 ;
@@ -1458,7 +1506,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
}; };
passPredV : Verb -> VP = \v -> passPredV : Verb -> VP = \v ->
let actVP = predV v in actVP ** { let actVP = predV v in actVP ** {
s = \\pgn,vf => s = \\pgn,vf =>
case vf of { case vf of {
VPPerf => v.s ! (VPerf Pas pgn) ; VPPerf => v.s ! (VPerf Pas pgn) ;
@@ -1498,7 +1546,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
_ => vp.pred.s ! gn ! Acc --xabar kaana wa laysa manSoob _ => vp.pred.s ! gn ! Acc --xabar kaana wa laysa manSoob
}; };
sc : Preposition = case o of {Subord => {s=[]; c=Acc} ; Dir => vp.sc} ; sc : Preposition = case o of {Subord => {s=[]; c=Acc} ; Dir => vp.sc} ;
subj = np.empty ++ sc.s subj = np.empty ++ sc.s
++ case vp.isPred of { ++ case vp.isPred of {
False => (proDrop np).s ! sc.c ; -- prodrop if it's not predicative False => (proDrop np).s ! sc.c ; -- prodrop if it's not predicative
True => np.s ! sc.c True => np.s ! sc.c
@@ -1507,11 +1555,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
} in } in
case o of { case o of {
Verbal => vStr t p ++ case vp.obj.a.isPron of { Verbal => vStr t p ++ case vp.obj.a.isPron of {
True => vp.obj.s ++ subj ; -- obj. clitic attaches directly to the verb True => vp.obj.s ++ subj ; -- obj. clitic attaches directly to the verb
False => subj ++ vp.obj.s } False => subj ++ vp.obj.s }
++ vp.s2 ++ pred t p ; ++ vp.s2 ++ pred t p ;
VOS => vStr t p ++ vp.obj.s ++ vp.s2 ++ pred t p ++ subj ; VOS => vStr t p ++ vp.obj.s ++ vp.s2 ++ pred t p ++ subj ;
Nominal|Subord => subj ++ vStr t p ++ vp.obj.s ++ vp.s2 ++ pred t p Nominal|Subord => subj ++ vStr t p ++ vp.obj.s ++ vp.s2 ++ pred t p
} }
} ; } ;
@@ -1538,7 +1586,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
emptyObj : Obj = emptyNP ** {s=[]} ; emptyObj : Obj = emptyNP ** {s=[]} ;
insertObj : NP -> VPSlash -> VP = \np,vp -> vp ** insertObj : NP -> VPSlash -> VP = \np,vp -> vp **
{ obj = {s = vp.obj.s ++ vp.c2.s ++ np.s ! vp.c2.c ; a = np.a} }; { obj = {s = vp.obj.s -- old object, if there was one
++ vp.c2.s ++ np.s ! vp.c2.c -- new object
++ vp.agrObj ! np.a.pgn ; -- only used for SlashV2V
a = np.a} };
insertPred : Comp -> VP -> VP = \p,vp -> vp ** insertPred : Comp -> VP -> VP = \p,vp -> vp **
{ pred = p; { pred = p;
@@ -1556,11 +1607,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Slash categories -- Slash categories
VPSlash : Type = VP ** {c2 : Preposition} ; VPSlash : Type = VP ** {c2 : Preposition ; agrObj : PerGenNum => Str} ;
ClSlash : Type = VPSlash ** {subj : NP} ; ClSlash : Type = VPSlash ** {subj : NP} ;
slashV2 : Verb2 -> VPSlash = \v -> slashV2 : Verb2 -> VPSlash = \v ->
predV v ** {c2 = v.c2} ; predV v ** {c2 = v.c2 ; agrObj = \\_ => []} ;
-- Add subject string, fix agreement to the subject, -- Add subject string, fix agreement to the subject,
-- but keep the structure as VP, because later on -- but keep the structure as VP, because later on
@@ -1568,11 +1619,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
predVPSlash : NP -> VPSlash -> ClSlash = \np,v -> v ** { predVPSlash : NP -> VPSlash -> ClSlash = \np,v -> v ** {
subj = np subj = np
} ; } ;
complClSlash = overload { complClSlash = overload {
complClSlash : NP -> ClSlash -> Cl = \obj,cls -> complClSlash : NP -> ClSlash -> Cl = \obj,cls ->
predVP cls.subj (insertObj obj cls) ; predVP cls.subj (insertObj obj cls) ;
complClSlash : ClSlash -> Cl = \cls -> complClSlash : ClSlash -> Cl = \cls ->
predVP cls.subj (insertObj emptyNP cls) -- Empty subject and object predVP cls.subj (insertObj emptyNP cls) -- Empty subject and object
} ; } ;
@@ -1582,7 +1633,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Relative -- Relative
param param
RAgr = RSg Gender | RPl Gender | RDl Gender Case ; RAgr = RSg Gender | RPl Gender | RDl Gender Case ;
oper oper
@@ -1627,7 +1678,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
\wAhid,awwal,Ula -> \wAhid,awwal,Ula ->
let wAhida : Str = case wAhid of { let wAhida : Str = case wAhid of {
x + "ة" => mkAt wAhid ; x + "ة" => mkAt wAhid ;
_ => wAhid + "َة" } _ => wAhid + "َة" }
in in
{ s= table { { s= table {
unit => table { unit => table {

View File

@@ -86,4 +86,6 @@ concrete SentenceAra of Sentence = CatAra ** open
UseRCl t p cl = {s = \\agr,c => t.s ++ p.s ++ cl.s ! t.t ! p.p ! agr ! c} ; UseRCl t p cl = {s = \\agr,c => t.s ++ p.s ++ cl.s ! t.t ! p.p ! agr ! c} ;
UseSlash t p cl = UseCl t p (complClSlash cl) ; UseSlash t p cl = UseCl t p (complClSlash cl) ;
AdvS adv s = s ** {s = \\o => adv.s ++ s.s ! o} ;
} }

View File

@@ -120,7 +120,7 @@ concrete StructuralAra of Structural = CatAra **
yes_Utt = {s = \\_ => "نَعَم"} ; yes_Utt = {s = \\_ => "نَعَم"} ;
youSg_Pron = youSgMasc_Pron ; youSg_Pron = youSgMasc_Pron ;
youPl_Pron = youPlMasc_Pron ; youPl_Pron = youPlMasc_Pron ;
youPol_Pron = youSgFem_Pron ; -- arbitrary? youPol_Pron = youPlFem_Pron ; -- arbitrary?
have_V2 = dirV2 (regV "يَملِك") ; have_V2 = dirV2 (regV "يَملِك") ;

View File

@@ -7,12 +7,31 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
SlashVV vv vps = vps ** predV vv ; ----IL SlashVV vv vps = vps ** predV vv ; ----IL
-- TODO: --c3 is for verb, c2 is for dir.obj -- : V2V -> VP -> VPSlash ; -- beg (her) to go
--SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go SlashV2V v2v vp = let v2vVP = predV v2v in -- IL
--SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy vp ** {
s = v2vVP.s ;
agrObj = \\pgn => v2v.c3.s -- أَنْ
++ vp.s ! pgn ! VPImpf Cnj ;
isPred = False ;
c2 = v2v.c2 ; -- for the direct object
sc = v2v.sc
} ;
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
SlashV2VNP v2v np vps = let v2vVP = predV v2v in -- IL
vps ** {
s = \\pgn,vpf => v2vVP.s ! pgn ! vpf
++ v2v.c2.s ++ np.s ! v2v.c2.c
++ v2v.c3.s -- أَنْ
++ vps.s ! pgn ! VPImpf Cnj ;
isPred = False ;
-- preposition for the direct object comes from VP
sc = v2v.sc
} ;
SlashV2a = slashV2 ; SlashV2a = slashV2 ;
Slash3V3 v np = insertObj np (slashV2 v) ** {c2 = v.c3}; Slash3V3 v np = insertObj np (slashV2 v) ** {c2 = v.c3 ; agrObj = \\_ => []};
ComplSlash vp np = insertObj np vp ; ComplSlash vp np = insertObj np vp ;