Merge pull request #85 from inariksit/arabic

Arabic
This commit is contained in:
Inari Listenmaa
2018-11-26 17:16:52 +01:00
committed by GitHub
6 changed files with 40 additions and 14 deletions

View File

@@ -16,7 +16,7 @@ concrete AdverbAra of Adverb = CatAra ** open ResAra, Prelude in {
AdAdv ad av = cc2 av ad ; AdAdv ad av = cc2 av ad ;
-- : Subj -> S -> Adv ; -- when she sleeps -- : Subj -> S -> Adv ; -- when she sleeps
SubjS subj s = {s = subj.s ++ s.s ! Subord} ; SubjS subj s = {s = subj.s ++ s.s ! subj.o} ;
-- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing -- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing

View File

@@ -72,7 +72,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
Conj = {s : Str ; n : ResAra.Number} ; Conj = {s : Str ; n : ResAra.Number} ;
-- DConj = {s1,s2 : Str ; n : ResAra.Number} ; -- DConj = {s1,s2 : Str ; n : ResAra.Number} ;
-- Subj = {s : Str} ; Subj = {s : Str ; o : Order} ;
Prep = ResAra.Preposition ; Prep = ResAra.Preposition ;
-- Open lexical classes, e.g. Lexicon -- Open lexical classes, e.g. Lexicon

View File

@@ -50,6 +50,10 @@ resource ParadigmsAra = open
masc : Gender ; masc : Gender ;
fem : Gender ; fem : Gender ;
Number : Type ;
sg : Number ;
pl : Number ;
Species : Type ; Species : Type ;
hum : Species ; hum : Species ;
nohum : Species ; nohum : Species ;
@@ -71,8 +75,8 @@ resource ParadigmsAra = open
mkN : NTable -> Gender -> Species -> N ; -- loan words, irregular mkN : NTable -> Gender -> Species -> N ; -- loan words, irregular
mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N ; -- broken plural mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N ; -- broken plural
mkN : N -> (attr : Str) -> N ; -- Compound noun with invariant attribute mkN : N -> (attr : Str) -> N ; -- Compound noun with invariant attribute
mkN : N -> N -> N ; -- Compound noun where attribute inflects in state and case but not number mkN : N -> N -> N ; -- Compound noun where attribute inflects in state and case. Attribute in singular.
mkN : Number -> N -> N -> N ; -- Compound noun where attribute inflects in state, case and number mkN : Number -> N -> N -> N ; -- Compound noun where attribute inflects in state and case. Attribute's number specified by 1st arg.
--- mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural --- mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural
--- = sdfN ; --- = sdfN ;
} ; } ;
@@ -102,7 +106,7 @@ resource ParadigmsAra = open
mkPN : Str -> PN -- Fem Hum if ends with ة, otherwise Masc Hum mkPN : Str -> PN -- Fem Hum if ends with ة, otherwise Masc Hum
= smartPN ; = smartPN ;
mkPN : N -> PN mkPN : N -> PN
= \n -> lin PN (n ** {s = \\c => n.s ! Sg ! Const ! Bare}) ; -- no idea /IL = \n -> lin PN (n ** {s = \\c => n.s ! Sg ! Const ! c ++ n.s2 ! Sg ! Const ! c }) ; -- no idea /IL
mkPN : Str -> Gender -> Species -> PN mkPN : Str -> Gender -> Species -> PN
= mkFullPN ; = mkFullPN ;
} ; } ;
@@ -172,6 +176,11 @@ resource ParadigmsAra = open
mkInterj : Str -> Interj ; mkInterj : Str -> Interj ;
mkSubj : overload {
mkSubj : Str -> Subj ; -- Default order Subord (=noun first and in accusative)
mkSubj : Str -> Order -> Subj -- Specify word order
} ;
--2 Prepositions --2 Prepositions
-- --
-- A preposition as used for rection in the lexicon, as well as to -- A preposition as used for rection in the lexicon, as well as to
@@ -301,6 +310,10 @@ resource ParadigmsAra = open
masc = ResAra.Masc ; masc = ResAra.Masc ;
fem = ResAra.Fem ; fem = ResAra.Fem ;
Number = ResAra.Number ;
sg = ResAra.Sg ;
pl = ResAra.Pl ;
Species = ResAra.Species ; Species = ResAra.Species ;
hum = ResAra.Hum ; hum = ResAra.Hum ;
nohum = ResAra.NoHum ; nohum = ResAra.NoHum ;
@@ -603,9 +616,9 @@ resource ParadigmsAra = open
mascTbl = reg jadId judud ; mascTbl = reg jadId judud ;
femTbl = reg jadIda judud ; femTbl = reg jadIda judud ;
in { s = table { in { s = table {
APosit Masc n d c => mascTbl ! n ! d ! c ; APosit Masc n d c => rectifyHmz (mascTbl ! n ! d ! c) ;
APosit Fem n d c => femTbl ! n ! d ! c ; APosit Fem n d c => rectifyHmz (femTbl ! n ! d ! c) ;
AComp d c => indeclN akbar ! d ! c } AComp d c => rectifyHmz (indeclN akbar ! d ! c) }
} ; } ;
degrA : (posit,compar,plur : Str) -> A degrA : (posit,compar,plur : Str) -> A
@@ -659,6 +672,11 @@ resource ParadigmsAra = open
mkAdA x = lin AdA (ss x) ; mkAdA x = lin AdA (ss x) ;
mkInterj x = lin Interj (ss x) ; mkInterj x = lin Interj (ss x) ;
mkSubj = overload {
mkSubj : Str -> Subj = \s -> lin Subj {s = s ; o = Subord} ;
mkSubj : Str -> Order -> Subj = \s,o -> lin Subj {s = s ; o = o} ;
} ;
dirV2 v = prepV2 v (casePrep acc) ; dirV2 v = prepV2 v (casePrep acc) ;
mkV3 = overload { mkV3 = overload {

View File

@@ -1231,7 +1231,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
<NonTeen,_> => Acc; <NonTeen,_> => Acc;
<ThreeTen,_> => Gen; <ThreeTen,_> => Gen;
<Hundreds,_> => Gen; <Hundreds,_> => Gen;
<_,Const> => Gen; <_,Const> => Gen; -- not sure if this is an actual rule /IL
_ => c _ => c
}; };
@@ -1534,7 +1534,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
<Verbal, False> => verbalAgr np.a.pgn; <Verbal, False> => verbalAgr np.a.pgn;
_ => np.a.pgn _ => np.a.pgn
}; };
sc : Preposition = case o of {Subord => {s=[]; c=Acc} ; _ => vp.sc} ; sc : Preposition = case o of { -- very unsure of this /IL
Subord => {s=[]; c=Acc} ; -- to prevent weird stuff with VVs
_ => case np.a.isPron of {True => noPrep; _ => 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

View File

@@ -62,8 +62,7 @@ concrete StructuralAra of Structural = CatAra **
-- isAux = True -- isAux = True
-- } ; -- } ;
no_Utt = {s = \\_ => "لا"} ; no_Utt = {s = \\_ => "لا"} ;
on_Prep = mkPrep "عَلى" ; on_Prep = mkPrep "عَلَى" ;
--- DEPREC one_Quant = mkQuantNum "واحِد" Sg Indef ;
only_Predet = mkPredet "فَقَط" False; only_Predet = mkPredet "فَقَط" False;
-- or_Conj = ss "ْر" ** {n = Sg} ; -- or_Conj = ss "ْر" ** {n = Sg} ;
-- otherwise_PConj = ss "ْتهروِسي" ; -- otherwise_PConj = ss "ْتهروِسي" ;
@@ -79,7 +78,7 @@ concrete StructuralAra of Structural = CatAra **
something_NP = regNP "شَيْء" Sg ; something_NP = regNP "شَيْء" Sg ;
-- somewhere_Adv = ss "سْموهري" ; -- somewhere_Adv = ss "سْموهري" ;
that_Quant = mkQuant3 "ذَلِكَ" "تِلكَ" "أُلٱِكَ" Def; that_Quant = mkQuant3 "ذَلِكَ" "تِلكَ" "أُلٱِكَ" Def;
that_Subj = ss "أنَّ" ; that_Subj = mkSubj "أنَّ" ;
----b that_NP = indeclNP "ذَلِكَ" Sg ; ----b that_NP = indeclNP "ذَلِكَ" Sg ;
there_Adv = ss "هُناك" ; there_Adv = ss "هُناك" ;
-- there7to_Adv = ss "تهري" ; -- there7to_Adv = ss "تهري" ;
@@ -100,7 +99,7 @@ concrete StructuralAra of Structural = CatAra **
whatPl_IP = mkIP "ما" "ماذا" Pl ; whatPl_IP = mkIP "ما" "ماذا" Pl ;
whatSg_IP = mkIP "ما" "ماذا" Sg ; whatSg_IP = mkIP "ما" "ماذا" Sg ;
when_IAdv = ss "مَتَى" ; when_IAdv = ss "مَتَى" ;
-- when_Subj = ss "وهن" ; when_Subj = mkSubj "عِنْدَمَا" Verbal ;
where_IAdv = ss "أَينَ" ; where_IAdv = ss "أَينَ" ;
which_IQuant = { which_IQuant = {
s = \\s,c => case <c,s> of { s = \\s,c => case <c,s> of {

View File

@@ -69,6 +69,12 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
UseCopula = predV copula ; UseCopula = predV copula ;
-- : VP -> Prep -> VPSlash ; -- live in (it)
VPSlashPrep vp prep = vp ** {
c2 = prep ;
agrObj = \\_ => []
} ;
AdvVP vp adv = insertStr adv.s vp ; AdvVP vp adv = insertStr adv.s vp ;
AdVVP adv = insertStr adv.s ; AdVVP adv = insertStr adv.s ;