Merge pull request #150 from inariksit/arabic-misc

Arabic misc
This commit is contained in:
Inari Listenmaa
2019-01-23 17:21:51 +01:00
committed by GitHub
4 changed files with 188 additions and 179 deletions

View File

@@ -70,6 +70,8 @@ oper
_ => "لِ"
}) Dat ;
biPrep : Preposition = mkPrefix "بِ" ;
accPrep : Preposition = mkPreposition [] Acc ; -- default object case in VP
genPrep : Preposition = mkPreposition [] Gen ; -- default object case in N2
pronSuff : pattern Str = #("كَ"|"كِ"|"كُمَا"|"كُمْ"|"كُنَّ"|"هُ"|"ها"|"هُمَا"|"هُمْ"|"هُنَّ") ;
pronSuffAndOther : pattern Str = #( "كَم" ) ; -- TODO list words that begin like pron.suff. but aren't
@@ -652,136 +654,110 @@ oper
normalAlif : Root3 -> Bool = \r -> case r.l of {"و" => True ; _ => False} ;
verbDefBool : Bool -> Bool -> DefForms -> Vowel -> Verb =
\isDoubleDef,alif,vforms,vowImpf ->
let {
rama = vforms ! 0 ; -- VPerf Act (Per3 Masc Sg)
ramay = vforms ! 1 ; -- VPerf Act (Per3 Fem Pl)
rumi = vforms ! 2 ; -- VPerf Pas (Per3 _ Sg)
rumu = vforms ! 3 ; -- VPerf Pas (Per3 Masc Pl)
rumiy = vforms ! 4 ; -- VPerf Pas (Per3 Fem Pl)
armi = vforms ! 5 ; -- VImpf _ Act (Per1 _ _ | Per3 Fem _ | Per2/3 Masc Sg)
armu = vforms ! 6 ; -- VImpf _ Act (Per2/3 Masc Pl)
ad3i = vforms ! 7 ; -- VImpf _ Act (Per2 Fem)
urma = vforms ! 8 ; -- VImpf _ Pas
Irmi = vforms ! 9 ; -- VImp Masc Sg | VImp Fem _
Irmu = vforms ! 10 ; -- VImp Masc Pl
ppart = vforms ! 11 ; -- VPPart
masdar = vforms ! 12 ; -- verbal noun
\isDoubleDef,normalAlif,vforms,vowImpf -> { s = table {
VPerf v pgn => patPerf ! v ! pgn + suffixPerf v ! pgn ;
VImpf m Act pgn => prefixImpf ! pgn + patImpfAct ! pgn + suffixImpf Act ! m ! pgn ;
VImpf m Pas pgn => prefixImpf ! pgn + urma + suffixImpf Pas ! m ! pgn ;
VImp g n => patImp ! g ! n + suffixImpf Act ! Jus ! Per2 g n ;
VPPart => ppart ;
Masdar => masdar }
} where {
rama = vforms ! 0 ; -- VPerf Act (Per3 Masc Sg)
ramay = vforms ! 1 ; -- VPerf Act (Per3 Fem Pl)
rumi = vforms ! 2 ; -- VPerf Pas (Per3 _ Sg)
rumu = vforms ! 3 ; -- VPerf Pas (Per3 Masc Pl)
rumiy = vforms ! 4 ; -- VPerf Pas (Per3 Fem Pl)
armi = vforms ! 5 ; -- VImpf _ Act (Per1 _ _ | Per3 Fem _ | Per2/3 Masc Sg)
armu = vforms ! 6 ; -- VImpf _ Act (Per2/3 Masc Pl)
ad3i = vforms ! 7 ; -- VImpf _ Act (Per2 Fem)
urma = vforms ! 8 ; -- VImpf _ Pas
Irmi = vforms ! 9 ; -- VImp Masc Sg | VImp Fem _
Irmu = vforms ! 10 ; -- VImp Masc Pl
ppart = vforms ! 11 ; -- VPPart
masdar = vforms ! 12 ; -- verbal noun
patPerf = patDefPerf rama ramay rumi rumu rumiy ;
patImpfAct = patDefImpfAct armi armu ad3i ;
patImp = patDefImp Irmi Irmu ;
suffixImpf = case isDoubleDef of {True => suffixImpfDoubleDef ; _ => suffixImpfDef}
} in
{ s = table {
VPerf v pgn => patPerf ! v ! pgn + suffixPerfDef v alif ! pgn ;
VImpf m Act pgn => prefixImpf ! pgn + patImpfAct ! pgn + suffixImpf Act vowImpf ! m ! pgn ;
VImpf m Pas pgn => prefixImpf ! pgn + urma + suffixImpf Pas vowImpf ! m ! pgn ;
VImp g n => patImp ! g ! n + suffixImpf Act vowImpf ! Jus ! Per2 g n ;
VPPart => ppart ;
Masdar => masdar
}
} ;
patDefPerf : (_,_,_,_,_ :Str) -> Voice => PerGenNum => Str = \rama,ramay,rumi,rumu,rumy ->
table {
Act =>
table {
Per3 Fem Pl => ramay ;
Per3 _ _ => rama ;
_ => ramay
} ;
Pas =>
table {
Per3 Masc Pl => rumu ;
Per3 Fem Pl => rumy ;
Per3 _ _ => rumi ;
_ => rumy
}
patPerf : Voice => PerGenNum => Str = table {
Act => table {
Per3 Fem Pl => ramay ;
Per3 _ _ => rama ;
_ => ramay } ;
Pas => table {
Per3 Masc Pl => rumu ;
Per3 Fem Pl => rumiy ;
Per3 _ _ => rumi ;
_ => rumiy }
} ;
--now includes the vowel=u case, eg "دعو" /IL 2019-01-18
patDefImpfAct : (x1,_,x3 : Str) -> PerGenNum => Str = \rmi,rmu,d3i ->
table {
Per3 Masc Pl => rmu ;
Per2 Masc Pl => rmu ;
Per2 Fem Sg => d3i ; -- for 1d3: d3i different, rmi = rmu
_ => rmi -- for others: rmu different, rmi = d3i
patImpfAct : PerGenNum => Str = table {
Per3 Masc Pl => armu ;
Per2 Masc Pl => armu ;
Per2 Fem Sg => ad3i ; -- for 1d3: d3i different, rmi = rmu
_ => armi -- for others: rmu different, rmi = d3i
} ;
patImp : Gender => Number => Str = \\g,n =>
case <g,n> of { <Masc,Pl> => Irmu ; _ => Irmi } ;
patDefImp : (_,_ : Str) -> Gender => Number => Str = \rmi, rmu ->
table {
Masc => table {Pl => rmu ; _ => rmi} ;
_ => table {_ => rmi}
} ;
suffixPerfDef : Voice -> Bool -> PerGenNum => Str = \v,normalAlif ->
let p3ms = case v of {
suffixPerf : Voice -> PerGenNum => Str = \vc ->
let p3ms = case vc of {
Act => if_then_Str normalAlif "ا" "ى" ;
Pas => "يَ" } ;
ya = case v of {
ya = case vc of {
Act => "" ;
Pas => "يَ" }
in
table {
Per3 Masc Sg => p3ms ;
Per3 Masc Dl => "يَا" ;
Per3 Masc Pl => "وْا" ;
Per3 Fem Sg => ya + "تْ" ;
Per3 Fem Dl => ya + "تَا" ;
Per3 Fem Pl => "نَ" ;
Per2 Masc Sg => "تَ" ;
Per2 _ Dl => "تُمَا" ;
Per2 Masc Pl => "تُمْ" ;
Per2 Fem Sg => "تِ" ;
Per2 Fem Pl => "تُنَّ" ;
Per1 Sing => "تُ" ;
Per1 Plur => "نَا"
} ;
in table {
Per3 Masc Sg => p3ms ;
Per3 Masc Dl => "يَا" ;
Per3 Masc Pl => "وْا" ;
Per3 Fem Sg => ya + "تْ" ;
Per3 Fem Dl => ya + "تَا" ;
Per3 Fem Pl => "نَ" ;
Per2 Masc Sg => "تَ" ;
Per2 _ Dl => "تُمَا" ;
Per2 Masc Pl => "تُمْ" ;
Per2 Fem Sg => "تِ" ;
Per2 Fem Pl => "تُنَّ" ;
Per1 Sing => "تُ" ;
Per1 Plur => "نَا"
} ;
suffixImpfDef : Voice -> Vowel -> Mood => PerGenNum => Str = \vc,vw ->
let {
default : Mood -> Str = \m ->
case vc of {
suffixImpfDef : Voice -> Mood => PerGenNum => Str = \vc ->
let default : Mood -> Str = \m -> case vc of {
Pas => case m of {Jus => "" ; _ => "ى"} ;
Act => case vw of {
Act => case vowImpf of {
u => case m of {Ind => "و" ; Cnj => "وَ" ; Jus => ""} ;
i => case m of {Ind => "ي" ; Cnj => "يَ" ; Jus => ""} ;
a => case m of {Ind => "ى" ; Cnj => "ى" ; Jus => ""}
}
}
} in
table {
Ind =>
table {
Per3 Masc Pl => "وْنَ" ;
Per2 Masc Pl => "وْنَ" ;
(Per3 _ Dl|Per2 _ Dl) => case vw of {
u => "وَانِ" ;
_ => "يَانِ" } ;
Per3 Fem Pl => "يْنَ" ;
Per2 Fem _ => "يْنَ" ;
_ => default Ind
} ;
m => -- TODO: check whether to remove sukuns
table {
Per3 Masc Pl => "وْا" ;
Per2 Masc Pl => "وْا" ;
(Per3 _ Dl|Per2 _ Dl) => case vw of {
u => "وَا" ;
_ => "يَا" } ;
Per3 Fem Pl => "يْنَ" ;
Per2 Fem Pl => "يْنَ" ;
Per2 Fem Sg => "ي" ;
_ => default m
a => case m of {Ind => "ى" ; Cnj => "ى" ; Jus => ""} }
}
in table { -- TODO: check whether to remove sukuns
Ind => table {
Per3 Masc Pl => "وْنَ" ;
Per2 Masc Pl => "وْنَ" ;
(Per3 _ Dl|Per2 _ Dl) => case vowImpf of {
u => "وَانِ" ;
_ => "يَانِ" } ;
Per3 Fem Pl => "يْنَ" ;
Per2 Fem _ => "يْنَ" ;
_ => default Ind
} ;
mood => table {
Per3 Masc Pl => "وْا" ;
Per2 Masc Pl => "وْا" ;
(Per3 _ Dl|Per2 _ Dl) => case vowImpf of {
u => "وَا" ;
_ => "يَا" } ;
Per3 Fem Pl => "يْنَ" ;
Per2 Fem Pl => "يْنَ" ;
Per2 Fem Sg => "ي" ;
_ => default mood
}
} ;
-- does this even happen other than with رءي? /IL
suffixImpfDoubleDef : Voice -> Vowel -> Mood => PerGenNum => Str = \vc,vw ->
\\m,p => rmSukun (suffixImpfDef vc vw ! m ! p) ;
suffixImpf : Voice -> Mood => PerGenNum => Str = \vc -> case isDoubleDef of {
False => suffixImpfDef vc ;
True => \\m,p => rmSukun (suffixImpfDef vc ! m ! p) } ;
} ;
------------------------------------------------------------
-- Common affixes

View File

@@ -42,11 +42,6 @@ resource ParadigmsAra = open
acc : Case ;
gen : Case ;
-- Prepositions are used in many-argument functions for rection.
Preposition : Type ;
noPrep : Preposition ;
casePrep : Case -> Preposition ;
--- TODO: continue, add all over the grammar
Gender : Type ;
masc : Gender ;
@@ -112,10 +107,10 @@ resource ParadigmsAra = open
--3 Relational nouns
mkN2 : overload {
mkN2 : N -> Preposition -> N2 ; -- ready-made preposition
mkN2 : N -> Str -> N2 ; -- preposition given as a string
mkN2 : N -> N2 ; -- no preposition
mkN2 : Str -> N2 ; -- no preposition, predictable inflection
mkN2 : N -> Prep -> N2 ; -- Noun and a ready-made preposition.
mkN2 : N -> Str -> N2 ; -- Noun, preposition given as a string, complement case genitive.
mkN2 : N -> N2 ; -- Noun, no preposition, complement case genitive.
mkN2 : Str -> N2 ; -- Predictable inflection, no preposition, complement case genitive.
} ;
mkN3 : overload {
@@ -143,20 +138,22 @@ resource ParadigmsAra = open
= \s,a -> a ** {s = table {af => s ++ a.s ! af}}
} ;
idaafaA : N -> A -> A ; -- first argument will be in constructus but inflect in case, adjective in genitive, but inflect in gender, number and definiteness. e.g. غَيْرُ طَيِّبٍ
nisbaA : Str -> Adj ; -- Forms relative adjectives with the suffix ِيّ. Takes either the stem and adds يّ, or the whole word ending in يّ and just adds declension.
degrA : (masc,fem,plur : Str) -> A ; -- adjective where masculine singular is also the comparative form.
idaafaA : N -> A -> A ; -- Forms adjectives of type غَيْرُ طَيِّبٍ 'not good'. Noun is in constructus but inflects in case. Adjective is in genitive, but inflects in gender, number and definiteness.
irregFemA : (masc : A) -> (fem : A) -> A ; -- adjective with irregular feminine. Takes two adjectives (masc. "regular" and fem. "regular") and puts them together.
degrA : (masc,fem,plur : Str) -> A ; -- Adjective where masculine singular is also the comparative form. Indeclinable singular, basic triptote declension for dual and plural.
nisbaA : Str -> Adj ; -- forms relative adjectives by adding the suffix ِيّ
irregFemA : (masc : A) -> (fem : A) -> A ; -- Adjective with irregular feminine. Takes two adjectives (masc. regular and fem. "regular", with fem. forms in the masc fields,) and puts them together.
invarGenderA : A -> A ; -- Forms an adjective that has no feminine form. Takes a regular adjective and forces the masculine forms into the fem. table.
--3 Two-place adjectives
--
-- Two-place adjectives need a preposition for their second argument.
mkA2 : overload {
mkA2 : A -> Preposition -> A2 ;
mkA2 : A -> Prep -> A2 ;
mkA2 : A -> Str -> A2
} ;
@@ -185,9 +182,14 @@ resource ParadigmsAra = open
-- build $PP$s in the resource API. Requires a string and a case.
mkPrep : overload {
mkPrep : Str -> Prep ;
mkPrep : Str -> Case -> Prep
} ; -- preposition in the sense of RGL abstract syntax
mkPrep : Str -> Prep ; -- Build a preposition out of the given string, with genitive case.
mkPrep : Str -> Case -> Prep ; -- Build a preposition out of the given string and case.
mkPrep : Case -> Prep ; -- Just a case, no preposition.
} ;
liPrep : Prep ; -- The preposition لِ, binding to its head. Vowel assimilation and def. article elision implemented.
biPrep : Prep ; -- The preposition بِ, binding to its head.
noPrep : Prep ; -- No preposition at all, "complement case" is nominative.
--2 Conjunctions
mkConj : overload {
@@ -203,7 +205,7 @@ resource ParadigmsAra = open
mkV : (imperfect : Str) -> V ; -- The verb in Per3 Sg Masc imperfect tense gives the most information
mkV : (root : Str) -> (perf,impf : Vowel) -> (masdar : Str) -> V ; -- Verb form I. Vowel is one of {va,vi,vu}. Unpredictable masdar given as an argument.
mkV : (root : Str) -> (perf,impf : Vowel) -> V ; -- Like above, but dummy masdar inserted. This function is here only to keep compatibility for the old API; for new grammars, use the constructor with masdar as an argument.
mkV : (root,masdar : Str) -> VerbForm -> V ; -- FormI…FormXI (no IX). XI is quadriliteral. For FormI, default vowels are va and vu, and dummy masdar is inserted. Forms II-XI have predictable masdar, so this constructor works fine.
mkV : (root,masdar : Str) -> VerbForm -> V ; -- FormI…FormXI (no IX). XI is quadriliteral. For FormI, default vowels are va and vu. The given masdar is used for FormI, but currently ignored for Forms II-XI.
mkV : (root : Str) -> VerbForm -> V ; -- Like above, but dummy masdar inserted for FormI verbs. No difference for FormII-FormXI, because they have predictable masdar.
mkV : V -> (particle : Str) -> V -- V with a non-inflecting particle/phrasal verb
} ;
@@ -242,8 +244,8 @@ resource ParadigmsAra = open
mkV2 : overload {
mkV2 : V -> V2 ; -- No preposition
mkV2 : V -> Str -> V2 ; -- Preposition as string, default case genitive
mkV2 : V -> Preposition -> V2 ; -- Ready-made preposition
mkV2 : V -> Str -> V2 ; -- Prep as string, default case genitive
mkV2 : V -> Prep -> V2 ; -- Ready-made preposition
mkV2 : Str -> V2 ; -- Predictable verb conjugation, no preposition
} ;
@@ -255,11 +257,11 @@ resource ParadigmsAra = open
-- the first one or both can be absent.
mkV3 : overload {
mkV3 : V -> Preposition -> Preposition -> V3 ; -- speak, with, about
mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about
mkV3 : V -> (to : Str) -> (about:Str) -> V3 -- like above, but with strings as arguments (default complement case genitive)
} ;
dirV3 : overload {
dirV3 : V -> Preposition -> V3 ; -- give,_,to
dirV3 : V -> Prep -> V3 ; -- give,_,to
dirV3 : V -> (to : Str) -> V3 -- like above, but with string as argument (default complement case genitive)
} ;
dirdirV3 : V -> V3 ; -- give,_,_
@@ -276,15 +278,19 @@ resource ParadigmsAra = open
} ;
mkV2S : V -> Str -> V2S ;
mkVV = overload {
mkVV : V -> VV = regVV ;
mkVV : V -> Str -> VV = c2VV ;
mkVV : V -> Preposition -> VV = prepVV ;
mkVV : V -> Preposition -> Preposition -> VV = prep2VV
mkVV : V -> VV -- Make VV out of a V; أَنْ as the complementiser, default subject case (nominative).
= regVV ;
mkVV : V -> Str -> VV -- String argument as the complementiser, default subject case (nominative).
= c2VV ;
mkVV : V -> Prep -> VV -- Prep argument as the complementiser, default subject case (nominative).
= prepVV ;
mkVV : V -> Prep -> Prep -> VV -- First Prep argument is the complementiser, second Prep is subject case. For instance, أَنْ and لِ to get "يُمْكِنُ أَنْ يَفْعَلَ لِشَيْءٍ".
= prep2VV
} ;
mkV2V : overload {
mkV2V : V -> Str -> Str -> V2V ;
mkV2V : V -> Preposition -> Preposition -> V2V ;
mkV2V : VV -> Preposition -> V2V
mkV2V : V -> Prep -> Prep -> V2V ;
mkV2V : VV -> Prep -> V2V
} ;
mkVA : V -> VA ;
mkV2A : V -> Str -> V2A ;
@@ -315,12 +321,6 @@ resource ParadigmsAra = open
acc = ResAra.Acc ;
gen = ResAra.Gen ;
-- Prepositions are used in many-argument functions for rection.
Preposition = ResAra.Preposition ;
noPrep = {s=[]; c=nom; binds=False} ;
casePrep c = {s=[]; c=c; binds=False} ;
Gender = ResAra.Gender ;
masc = ResAra.Masc ;
fem = ResAra.Fem ;
@@ -342,14 +342,21 @@ resource ParadigmsAra = open
mkPrep : Str -> Prep = \s ->
lin Prep (mkPreposition s) ;
mkPrep : Str -> Case -> Prep = \s,c ->
lin Prep (mkPreposition s c)
lin Prep (mkPreposition s c) ;
mkPrep : Case -> Prep = \c ->
lin Prep (casePrep c) ;
} ;
noPrep = lin Prep ResAra.noPrep ;
biPrep = lin Prep ResAra.biPrep ;
liPrep = lin Prep ResAra.liPrep ;
casePrep : Case -> Prep = \c -> lin Prep {s=[]; c=c; binds=False} ;
mkV2 = overload {
mkV2 : V -> V2 = dirV2 ;
mkV2 : V -> Str -> V2 = \v,p -> prepV2 v (mkPreposition p);
mkV2 : V -> Preposition -> V2 = prepV2 ;
mkV2 : V -> Prep -> V2 = prepV2 ;
mkV2 : Str -> V2 = strV2;
} ;
@@ -609,16 +616,16 @@ resource ParadigmsAra = open
};
mkN2 = overload {
mkN2 : N -> Preposition -> N2 = prepN2 ;
mkN2 : N -> Prep -> N2 = prepN2 ;
mkN2 : N -> Str -> N2 = \n,s -> prepN2 n (mkPreposition s);
mkN2 : N -> N2 = \n -> lin N2 (n ** {c2 = noPrep}) ;
mkN2 : Str -> N2 = \str -> lin N2 (smartN str ** {c2 = noPrep})
mkN2 : N -> N2 = \n -> prepN2 n genPrep;
mkN2 : Str -> N2 = \str -> prepN2 (smartN str) genPrep;
} ;
prepN2 : N -> Preposition -> N2 = \n,p -> lin N2 (n ** {c2 = p}) ;
mkN3 = overload {
mkN3 : N -> Preposition -> Preposition -> N3 = \n,p,q ->
mkN3 : N -> Prep -> Prep -> N3 = \n,p,q ->
lin N3 (n ** {c2 = p ; c3 = q}) ;
mkN3 : N -> Str -> Str -> N3 = \n,p,q ->
lin N3 (n ** {c2 = mkPreposition p ; c3 = mkPreposition q}) ;
@@ -721,6 +728,9 @@ resource ParadigmsAra = open
x => m.s ! x }
} ;
invarGenderA = \m ->
irregFemA m m ;
nisbaA Haal =
let Haaliyy : Str = case Haal of {
x + "يّ" => Haal ; -- if the ending is already given, don't add it
@@ -742,7 +752,7 @@ resource ParadigmsAra = open
};
mkA2 = overload {
mkA2 : A -> Preposition -> A2 = prepA2 ;
mkA2 : A -> Prep -> A2 = prepA2 ;
mkA2 : A -> Str -> A2 = \a,p -> prepA2 a (mkPreposition p)
} ;
@@ -758,10 +768,10 @@ resource ParadigmsAra = open
mkSubj : Str -> Order -> Subj = \s,o -> lin Subj {s = s ; o = o} ;
} ;
dirV2 v = prepV2 v (casePrep acc) ;
dirV2 v = prepV2 v accPrep ;
mkV3 = overload {
mkV3 : V -> Preposition -> Preposition -> V3 = \v,p,q ->
mkV3 : V -> Prep -> Prep -> V3 = \v,p,q ->
lin V3 (prepV3 v p q) ;
mkV3 : V -> Str -> Str -> V3 = \v,p,q ->
lin V3 (v ** {s = v.s ; c2 = mkPreposition p ; c3 = mkPreposition q})
@@ -771,7 +781,7 @@ resource ParadigmsAra = open
v ** {s = v.s ; c2 = p ; c3 = q} ;
dirV3 = overload {
dirV3 : V -> Preposition -> V3 = \v,p -> mkV3 v (casePrep acc) p ;
dirV3 : V -> Prep -> V3 = \v,p -> mkV3 v (casePrep acc) p ;
dirV3 : V -> Str -> V3 = \v,s -> mkV3 v (casePrep acc) (mkPreposition s)
} ;
@@ -785,8 +795,8 @@ resource ParadigmsAra = open
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} ;
prepVV : V -> Prep -> VV = \v,prep -> regVV v ** {c2=prep; sc=noPrep} ;
prep2VV : V -> (_,_ : Prep) -> VV = \v,p1,p2 -> regVV v ** {c2=p1; sc=p2} ;
V0 : Type = V ;
---- V2S, V2V, V2Q, V2A : Type = V2 ;
AS, A2S, AV : Type = A ;
@@ -799,13 +809,13 @@ resource ParadigmsAra = open
lin V2V (prepV3 v (mkPreposition p) (mkPreposition q) ** {sc = noPrep}) ;
mkV2V : V2 -> V2V = \v2 ->
lin V2V (v2 ** {c2 = v2.c2 ; c3,sc = noPrep}) ;
mkV2V : V2 -> Preposition -> V2V = \v2,p ->
mkV2V : V2 -> Prep -> V2V = \v2,p ->
lin V2V (v2 ** {c2 = v2.c2 ; c3 = p ; sc = noPrep}) ;
mkV2V : V2 -> Preposition -> Preposition -> V2V = \v2,p,q->
mkV2V : V2 -> Prep -> Prep -> V2V = \v2,p,q->
lin V2V (v2 ** {c2 = v2.c2 ; c3 = p ; sc = q}) ;
mkV2V : V -> Preposition -> Preposition -> V2V = \v,p,q ->
mkV2V : V -> Prep -> Prep -> V2V = \v,p,q ->
lin V2V (prepV3 v p q ** {sc = noPrep}) ;
mkV2V : VV -> Preposition -> V2V = \vv,p ->
mkV2V : VV -> Prep -> V2V = \vv,p ->
lin V2V (vv ** {c2 = p ; c3 = vv.c2}) ;
} ;
mkVA v = v ** {lock_VA = <>} ;

View File

@@ -8,20 +8,18 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
s = \\t,p =>
table {
QIndir => "إِذا" ++ cl.s ! t ! p ! toOrder QIndir ;
QDir => "هَلْ" ++ cl.s ! t ! p ! toOrder QDir
QDir => "هَلْ" ++ cl.s ! t ! p ! Verbal -- yes/no question
}
};
-- ComplSlashIP vps ip = {} ;
--IL guessed
QuestVP qp vp =
let np = ip2np qp vp.isPred ;
cl = PredVP np vp ;
in { s = \\t,p,qf => cl.s ! t ! p ! toOrder qf } ;
---- AR guessed
QuestIAdv iadv cl = {s = \\t,p,qf => iadv.s ++ cl.s ! t ! p ! toOrder qf} ;
QuestIAdv iadv cl = {s = \\t,p,qf => iadv.s ++ cl.s ! t ! p ! Verbal} ; -- Verbal word order, because there is no pre-existing question word /IL
---- IL guessed
-- : IComp -> NP -> QCl

View File

@@ -385,6 +385,23 @@ oper
}
} ;
laysa : PerGenNum => Str = table {
Per1 Sing => "لَسْتُ" ;
Per1 Plur => "لَسْنَا" ;
Per2 Fem Sg => "لَسْتِ" ;
Per2 Masc Sg => "لَسْتَ" ;
Per2 _ Dl => "لَسْتُمَا" ;
Per2 Fem Pl => "لَسْتُنَّ" ;
Per2 Masc Pl => "لَسْتُمْ" ;
Per3 Fem Sg => "لَيْسَتْ" ;
Per3 Masc Sg => "لَيْسَ" ;
Per3 Fem Dl => "لَيْسَتَا" ;
Per3 Masc Dl => "لَيْسَا" ;
Per3 Fem Pl => "لَسْنَ" ;
Per3 Masc Pl => "لَيْسُوا"
} ;
ladaa_V : Verb =
let laday : PerGenNum -> Str = \pgn -> case pgn of {
Per1 Sing => "لَدَيَّ" ;
@@ -406,10 +423,12 @@ oper
-- Sometimes a verb is only used in one form (per3 masc sg);
-- ideally, one would use an impersonal syntactic construction,
-- less ideally, hardcode the verb to only contain forms of one person.
forcePerson : PerGenNum -> Verb -> Verb = \pgn,verb -> verb ** {
forcePerson : PerGenNum -> Verb -> Verb = \pgn,verb ->
let gn = pgn2gn pgn in verb ** {
s = \\vf => case vf of {
VPerf v _ => verb.s ! VPerf v pgn ;
VImpf m v _ => verb.s ! VImpf m v pgn ;
VImp _g _n => verb.s ! VImp gn.g gn.n ;
_ => verb.s ! vf }
} ;
@@ -425,13 +444,14 @@ oper
sc : Preposition ; -- subject case: e.g. يُمْكِنُ *لِ*Xِ
obj : Obj;
pred : Comp;
isPred : Bool; --indicates if there is a predicate (xabar)
isPred : Bool; -- indicates if there is a predicate (xabar)
s2 : Str
} ;
VP : Type = BaseVP ** {
s : PerGenNum => VPForm => Str ;
} ;
s : PerGenNum => VPForm => Str ;
isPoss : Bool; -- special case for have_V2, to get negation right /IL
} ;
uttVP : VPForm -> VP -> (Gender=>Str) = \vpf,vp ->
\\g => vp.s ! Per3 g Sg ! vpf
@@ -451,7 +471,7 @@ oper
obj = emptyObj ;
s2 = [];
pred = {s = \\_,_ => []} ;
isPred = False
isPred,isPoss = False
};
passPredV : Verb -> VP = \v ->
@@ -592,15 +612,15 @@ oper
yaktub = vp.s ! pgn ! VPImpf Jus ;
-- Various negative particles
la = "لَا" ;
laysa = "لَيسَ" ; -- "neg. copula"
lam = "لَمْ" ; -- neg. past
alla = "أَلَّا" ; -- neg. subjunctive
lan = "لَنْ" ; -- neg. future
in case <vp.isPred,tn,pl,o> of {
in case <vp.isPred,tn,pl,o,vp.isPoss> of {
<False, Pres, Neg, _, True> => laysa ! Per3 Masc Sg ++ yaktubu ; -- special case for have_V2
<False, Pres, Pos, _> => yaktubu ;
<False, Pres, Neg, _> => la ++ yaktubu ;
<True, Pres, Pos, _> => [] ; --no verb "to be" in present
<True, Pres, Neg, _> => laysa ; --same here, just add negation particle
<True, Pres, Neg, _> => laysa ! pgn ; -- negative copula
<_, Past, Pos, _> => kataba ;
<_, Past, Neg, _> => lam ++ yaktub ;
<_, Cond, Pos, _> => yaktuba ;
@@ -625,11 +645,16 @@ oper
ClSlash : Type = VPSlash ** {subj : Subj} ;
emptyVPslash : VP -> VPSlash = \vp -> vp ** {
c2 = noPrep ; agrObj = \\_ => []
c2 = accPrep ; agrObj = \\_ => []
} ;
slashV2 : Verb2 -> VPSlash = \v ->
predV v ** {c2 = v.c2 ; agrObj = \\_ => []} ;
predV v ** {
c2 = v.c2 ; agrObj = \\_ => [] ;
isPoss = case v.c2.c of {
Nom => True ; -- for have_V2
_ => False } ;
} ;
-- Add subject string, fix agreement to the subject,
-- but keep the structure as VP, because later on
@@ -656,8 +681,8 @@ oper
-- these are chosen in many places, trying to be consistent
toOrder : QForm -> Order = \qf ->
case qf of { QIndir => Nominal ;
QDir => Verbal } ;
case qf of { QDir => Nominal ; -- works for wh-questions, not for y/n
QIndir => Verbal } ;
-----------------------------------------------------------------------------
-- Relative