forked from GitHub/gf-core
20071225_ArabicRG
This commit is contained in:
@@ -2,15 +2,14 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
|
||||
PositA a = {
|
||||
s =
|
||||
table {
|
||||
Hum => a.s ;
|
||||
NoHum => \\g,n =>
|
||||
case n of {
|
||||
Pl => a.s ! Fem ! Sg ;
|
||||
_ => a.s ! g ! n
|
||||
}
|
||||
s = \\h,g,n,d,c => case h of {
|
||||
Hum => a.s ! APosit g n d c;
|
||||
NoHum => case n of {
|
||||
Pl => a.s ! APosit Fem Sg d c ;
|
||||
_ => a.s ! APosit g n d c
|
||||
}
|
||||
}
|
||||
};
|
||||
-- ComparA a np = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
concrete AdverbAra of Adverb = CatAra ** open ResAra, Prelude in {
|
||||
|
||||
lin
|
||||
PositAdvAdj a = {s = a.s ! Masc ! Sg ! Indef ! Acc} ;
|
||||
PositAdvAdj a = {s = a.s ! APosit Masc Sg Indef Acc} ;
|
||||
-- ComparAdvAdj cadv a np = {
|
||||
-- s = cadv.s ++ a.s ! AAdv ++ "مِنْ" ++ np.s ! Gen
|
||||
-- } ;
|
||||
|
||||
@@ -44,49 +44,55 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
||||
|
||||
-- Noun
|
||||
|
||||
CN = ResAra.Noun;
|
||||
CN = ResAra.Noun ** {adj : NTable};
|
||||
NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ;
|
||||
Num, Ord = {s : Gender => State => Case => Str ;
|
||||
n : Size };
|
||||
Predet = ResAra.Predet ;
|
||||
--- DEPREC QuantSg, QuantPl =
|
||||
--- {s : Species => Gender => Case => Str;
|
||||
--- n : ResAra.Number; d : State; isNum : Bool} ;
|
||||
|
||||
-- DEPRECATED
|
||||
-- QuantSg, QuantPl =
|
||||
-- {s : Species => Gender => Case => Str;
|
||||
-- n : ResAra.Number;
|
||||
-- d : State;
|
||||
-- isNum : Bool;
|
||||
-- isPron : Bool} ;
|
||||
|
||||
Det = ResAra.Det ;
|
||||
-- {s : Species => Gender => Case => Str ; d : State; n : Size; isNum : Bool } ;
|
||||
Quant = {s : ResAra.Number => Species => Gender => Case => Str; d : State} ;
|
||||
|
||||
-- Adverb
|
||||
|
||||
-- Adv, AdV, AdA, AdS, AdN = {s : Str} ;
|
||||
-- {s : Species => Gender => Case => Str ;
|
||||
-- d : State; n : Size; isNum : Bool } ;
|
||||
Quant = {s : ResAra.Number => Species => Gender => Case => Str;
|
||||
d : State;
|
||||
isNum : Bool;
|
||||
isPron: Bool} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
Numeral,Digits = {s : Gender => State => Case => Str ;
|
||||
Numeral = {s : CardOrd => Gender => State => Case => Str ;
|
||||
n : Size } ;
|
||||
Digits = {s : Str;
|
||||
n : Size};
|
||||
|
||||
-- Structural
|
||||
|
||||
---- Structural
|
||||
--
|
||||
Conj = {s : Str ; n : ResAra.Number} ;
|
||||
-- DConj = {s1,s2 : Str ; n : ResAra.Number} ;
|
||||
-- PConj = {s : Str} ;
|
||||
-- CAdv = {s : Str} ;
|
||||
-- Subj = {s : Str} ;
|
||||
Prep = {s : Str} ;
|
||||
--
|
||||
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
|
||||
V, VS, VQ, VA = ResAra.Verb ; -- = {s : VForm => Str} ;
|
||||
V2, V2A = ResAra.Verb ** {c2 : Str} ;
|
||||
V3 = ResAra.Verb ** {c2, c3 : Str} ;
|
||||
-- VV = {s : VVForm => Str ; isAux : Bool} ;
|
||||
--
|
||||
|
||||
A = ResAra.Adj ;
|
||||
A2 = ResAra.Adj ** {c2 : Str} ;
|
||||
--
|
||||
N, N2 = ResAra.Noun ; --{s : ResAra.Number => State => Case => Str; g : Gender ; h = Species} ;
|
||||
-- N2 = {s : ResAra.Number => Case => Str} ** {c2 : Str} ;
|
||||
|
||||
N, N2 = ResAra.Noun ;
|
||||
--{s : ResAra.Number => State => Case => Str; g : Gender ; h = Species} ;
|
||||
-- N2 = {s : ResAra.Number => Case => Str} ** {c2 : Str} ;??
|
||||
N3 = ResAra.Noun ** {c2,c3 : Str} ;
|
||||
PN = {s : Case => Str; g : Gender; h : Species} ;
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ flags
|
||||
become_VA = mkVA (v4 "صبح") ;
|
||||
beer_N = sdfN "بير" "فِعلة" Fem NoHum ;
|
||||
beg_V2V = dirV2 (v5 "وسل") ;
|
||||
big_A = sndA "كبر" "فَعِيل" ;
|
||||
-} big_A = sndA "كبر" "فَعِيل" ;
|
||||
bike_N = sdfN "درج" "فَعّالة" Fem NoHum ;
|
||||
bird_N = brkN "طير" "فَعل" "فُعُول" Masc NoHum;
|
||||
black_A = clrA "سود" ;
|
||||
{- black_A = clrA "سود" ;
|
||||
blue_A = clrA "زرق" ;
|
||||
boat_N = brkN "قرب" "فاعِل" "فَواعِل" Masc NoHum ;
|
||||
book_N = brkN "كتب" "فِعال" "فُعُل" Masc NoHum ;
|
||||
@@ -97,8 +97,8 @@ flags
|
||||
-- go_V = v1 "ذهب" a a ;
|
||||
green_A = clrA "خضر" ;
|
||||
harbour_N = brkN "رف؟" "مَفعَل" "مَفاعِل" Masc NoHum ; --mInA', marsaY
|
||||
hate_V2 = dirV2 (regV "كَرِه") ;
|
||||
hat_N = sdfN "قبع" "فُعَّلة" Fem NoHum ;
|
||||
-} hate_V2 = dirV2 (regV "كَرِه") ;
|
||||
{- hat_N = sdfN "قبع" "فُعَّلة" Fem NoHum ;
|
||||
have_V2 = dirV2 (regV "يَملِك") ;
|
||||
-- have_V2 = dirV2 (v1 "ملك" a i) ;
|
||||
hear_V2 = dirV2 (regV "سَمِع") ;
|
||||
@@ -107,8 +107,8 @@ flags
|
||||
hope_VS = mkVS (v1 "رجو" a u) ; --check
|
||||
horse_N = brkN "حصن" "فِعال" "أَفعِلة" Masc NoHum ;
|
||||
hot_A = sndA "سخن" "فاعِل" ; --HAr
|
||||
house_N = brkN "بيت" "فَعل" "فُعُول" Masc NoHum ; --manzil
|
||||
important_A = sndA "هيم" "فاعّ" ;
|
||||
-} house_N = brkN "بيت" "فَعل" "فُعُول" Masc NoHum ; --manzil
|
||||
{- important_A = sndA "هيم" "فاعّ" ;
|
||||
industry_N = sdfN "صنع" "فِعالة" Fem NoHum ;
|
||||
iron_N = brkN "حدّ" "فَعِيل" "فَعائِل" Masc NoHum ;
|
||||
king_N = brkN "ملك" "فَعِل" "فُعُول" Masc Hum ;
|
||||
@@ -147,8 +147,8 @@ flags
|
||||
paint_V2A = mkV2A (regV "يَدهَن" ) [] ;
|
||||
-- paint_V2A = mkV2A (v1 "دهن" a a ) [] ;
|
||||
paper_N = brkN "ورق" "فَعَلة" "أَفعال" Fem NoHum ;
|
||||
-} paris_PN = mkPN "بارِيس" Fem NoHum ;
|
||||
{- peace_N = brkN "سلم" "فَعال" "فَعال" Masc NoHum; --no plur
|
||||
paris_PN = mkPN "بارِيس" Fem NoHum ;
|
||||
peace_N = brkN "سلم" "فَعال" "فَعال" Masc NoHum; --no plur
|
||||
pen_N = brkN "قلم" "فَعَل" "أَفعال" Masc NoHum;
|
||||
planet_N = mkN (reg "كَوكَب" "كَواكِب") Masc NoHum ; -- quadriconsonantal
|
||||
plastic_N = mkN (sndf "بلاستِيك") Masc NoHum ;
|
||||
@@ -239,8 +239,8 @@ flags
|
||||
|
||||
do_V2 = dirV2 (regV "يَفعَل") ;
|
||||
-- do_V2 = dirV2 (v1 "فعل" a a ) ;
|
||||
now_Adv = mkAdv "الآن" ;
|
||||
already_Adv = mkAdv "سابِقاً" ;
|
||||
-} now_Adv = mkAdv "الآن" ;
|
||||
{- already_Adv = mkAdv "سابِقاً" ;
|
||||
song_N = brkN "غني" "أَفعِلة" "أَفاعِي" Fem NoHum ;
|
||||
add_V3 = dirV3 (regV "يَجمَع") "وَ" ;
|
||||
-- add_V3 = dirV3 (v1 "جمع" a a) "وَ" ;
|
||||
@@ -305,10 +305,10 @@ flags
|
||||
leg_N = brkN "رجل" "فِعل" "أَفعُل" Fem NoHum;
|
||||
liver_N = brkN "كبد" "فَعِل" "أَفعال" Masc NoHum ;
|
||||
louse_N = sdfN "قمل" "فَعلة" Fem NoHum;
|
||||
mouth_N = brkN "فوه" "فُعل" "أَفعال" Masc NoHum ;
|
||||
name_N = brkN "؟سم" "فِعل" "فَعالِي" Masc NoHum;
|
||||
neck_N = brkN "رقب" "فَعَلة" "فِعال" Fem NoHum;
|
||||
night_N = brkN "ليل" "فَعلة" "فَعالِي" Fem NoHum; --plural?
|
||||
-} mouth_N = brkN "فوه" "فُعل" "أَفعال" Masc NoHum ;
|
||||
name_N = brkN "؟سم" "فِعل" "فَعالِي" Masc NoHum;
|
||||
{- neck_N = brkN "رقب" "فَعَلة" "فِعال" Fem NoHum;
|
||||
night_N = brkN "ليل" "فَعلة" "فَعالِي" Fem NoHum; --plural?
|
||||
nose_N = brkN "؟نف" "فَعل" "فُعُول" Masc NoHum;
|
||||
person_N = brkN "شخص" "فَعل" "أَفعال" Masc Hum;
|
||||
rain_N = brkN "مطر" "فَعَل" "أَفعال" Masc NoHum;
|
||||
|
||||
@@ -8,8 +8,9 @@ flags optimize = all ;--noexpand;
|
||||
= \word,num,state ->
|
||||
{ s = \\_,_,c => word + vowel ! c ;
|
||||
n = numberToSize num;
|
||||
d = state;
|
||||
isNum = False
|
||||
d = state; --only Const is used now. check StructuralAra
|
||||
isNum = False;
|
||||
isPron = False
|
||||
};
|
||||
|
||||
mkPredet : Str -> Bool -> Predet
|
||||
@@ -23,7 +24,7 @@ flags optimize = all ;--noexpand;
|
||||
};
|
||||
|
||||
mkQuantNum : Str -> Number -> State -> {
|
||||
s: Species => Gender => Case => Str; n: Number; d : State; isNum : Bool} =
|
||||
s: Species => Gender => Case => Str; n: Number; d : State; isPron: Bool; isNum : Bool} =
|
||||
\waHid,num,state ->
|
||||
let waHida = waHid + "َة" in
|
||||
{ s = \\_,g,c =>
|
||||
@@ -34,6 +35,7 @@ flags optimize = all ;--noexpand;
|
||||
} in Al ! state + word + dec1sg ! state ! c;
|
||||
n = num;
|
||||
d = state;
|
||||
isPron = False;
|
||||
isNum = True
|
||||
};
|
||||
|
||||
|
||||
@@ -1,107 +1,170 @@
|
||||
concrete NounAra of Noun = CatAra ** open ResAra, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
flags optimize=noexpand ;
|
||||
|
||||
lin
|
||||
lin
|
||||
|
||||
DetCN det cn =
|
||||
let {
|
||||
number = sizeToNumber det.n;
|
||||
determiner : Case -> Str = \c ->
|
||||
det.s ! cn.h ! (detGender cn.g det.n) ! c;
|
||||
noun : Case -> Str = \c ->
|
||||
cn.s ! number ! (nounState det.d number) ! (nounCase c det.n det.d)
|
||||
} in
|
||||
{ s = \\c =>
|
||||
case detAsAdj det.isNum det.n det.d of {
|
||||
False => determiner c ++ noun c;
|
||||
--FIXME use the adj -> cn -> cn rule from below instead of repeating code
|
||||
True => cn.s ! number ! det.d ! c ++ det.s ! cn.h ! cn.g ! c
|
||||
};
|
||||
a = { pgn = agrP3 cn.h cn.g number;
|
||||
isPron = False }
|
||||
};
|
||||
|
||||
UsePN pn = {
|
||||
s = pn.s;
|
||||
a = {pgn = (Per3 pn.g Sg); isPron = False }
|
||||
};
|
||||
|
||||
UsePron p = p ;
|
||||
|
||||
PredetNP pred np = {
|
||||
s = \\c => case pred.isDecl of {
|
||||
True => pred.s!c ++ np.s ! Gen ; -- akvaru l-awlAdi
|
||||
False => pred.s!c ++ np.s ! c
|
||||
DetCN det cn = let {
|
||||
number = sizeToNumber det.n;
|
||||
determiner : Case -> Str = \c ->
|
||||
det.s ! cn.h ! (detGender cn.g det.n) ! c;
|
||||
noun : Case -> Str = \c -> cn.s !
|
||||
number ! (nounState det.d number) ! (nounCase c det.n det.d)
|
||||
} in {
|
||||
s = \\c =>
|
||||
case cnB4det det.isPron det.isNum det.n det.d of {
|
||||
False => determiner c ++ noun c;
|
||||
--FIXME use the adj -> cn -> cn rule from below instead of
|
||||
--repeating code
|
||||
True => cn.s ! number ! det.d ! c ++ det.s ! cn.h ! cn.g ! c
|
||||
++ cn.adj ! number ! det.d ! c
|
||||
};
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
DetSg quant ord = {
|
||||
s = \\h,g,c =>
|
||||
quant.s ! Sg ! h ! g ! c ;
|
||||
---- s = quant.s ; --++ ord.s -- AR 18/12/2007
|
||||
n = One;
|
||||
d = quant.d;
|
||||
isNum = False ---- quant.isNum
|
||||
} ;
|
||||
|
||||
|
||||
DetPl quant num ord = {
|
||||
s = \\h,g,c =>
|
||||
quant.s ! Pl ! h ! g ! c ++ -- AR 18/12/2007 ??
|
||||
num.s ! g ! (toDef quant.d num.n) ! c ;
|
||||
n = num.n;
|
||||
d = quant.d;
|
||||
isNum =
|
||||
case num.n of {
|
||||
None => False;
|
||||
_ => True
|
||||
};
|
||||
} ;
|
||||
|
||||
--- DEPREC
|
||||
--- SgQuant quant = {s = quant.s ! Sg ; n = Sg; d = quant.d; isNum = False} ;
|
||||
--- PlQuant quant = {s = quant.s ! Pl ; n = Pl; d = quant.d; isNum = False} ;
|
||||
|
||||
|
||||
-- PossPron p = {s = \\_ => p.s ! Gen} ;
|
||||
|
||||
NoNum, NoOrd = {s = \\_,_,_ => [] ;
|
||||
n = None} ;
|
||||
|
||||
-- NumInt n = n ;
|
||||
-- OrdInt n = {s = n.s ++ "ته"} ; ---
|
||||
|
||||
NumNumeral numeral = numeral ;
|
||||
-- OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||
--
|
||||
-- AdNum adn num = {s = adn.s ++ num.s} ;
|
||||
--
|
||||
-- OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
||||
--
|
||||
DefArt = {s = \\_,_,_,_ => []; d = Def } ;
|
||||
|
||||
IndefArt = {s = \\_,_,_,_ => []; d = Indef} ;
|
||||
|
||||
MassDet = {s = \\_,_,_,_ => [] ; n = Sg; d = Indef; isNum = False} ;
|
||||
|
||||
UseN n = n ;
|
||||
-- UseN2 n = n ;
|
||||
-- UseN3 n = n ;
|
||||
--
|
||||
-- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
|
||||
-- ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
|
||||
--
|
||||
AdjCN ap cn = {
|
||||
s = \\n,d,c =>
|
||||
cn.s ! n ! d ! c ++ ap.s ! cn.h ! cn.g ! n ! (definite ! d) ! c ;
|
||||
g = cn.g;
|
||||
h = cn.h
|
||||
a = { pgn = agrP3 cn.h cn.g number;
|
||||
isPron = False }
|
||||
};
|
||||
|
||||
UsePN pn = {
|
||||
s = pn.s;
|
||||
a = {pgn = (Per3 pn.g Sg); isPron = False }
|
||||
};
|
||||
|
||||
UsePron p = p ;
|
||||
|
||||
PredetNP pred np = {
|
||||
s = \\c => case pred.isDecl of {
|
||||
True => pred.s!c ++ np.s ! Gen ; -- akvaru l-awlAdi
|
||||
False => pred.s!c ++ np.s ! c
|
||||
};
|
||||
-- RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
||||
-- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
|
||||
--
|
||||
-- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;
|
||||
--
|
||||
a = np.a
|
||||
} ;
|
||||
{-
|
||||
--should compile.. not working :( wierd error message.. bug?
|
||||
PPartNP np v2 =
|
||||
let x = case np.a.pgn of {
|
||||
Per3 g n => ( positAdj (v2.s ! VPPart) ) ! g ! n ! Indef ;
|
||||
_ => \\_ => [] -- not occuring anyway
|
||||
} in {
|
||||
s = \\c => np.s ! c ++ x ! c ;
|
||||
a = np.a
|
||||
};
|
||||
-}
|
||||
|
||||
-- FIXME try parsing something like "this house now" and you'll get
|
||||
-- an internal compiler error, but it still works.. wierd..
|
||||
AdvNP np adv = {
|
||||
s = \\c => np.s ! c ++ adv.s;
|
||||
a = np.a
|
||||
};
|
||||
|
||||
DetSg quant ord = {
|
||||
s = \\h,g,c =>
|
||||
quant.s ! Sg ! h ! g ! c ++ ord.s ! g ! quant.d ! c ;
|
||||
n = One;
|
||||
d = quant.d;
|
||||
isPron = quant.isPron;
|
||||
isNum =
|
||||
case ord.n of {
|
||||
None => False;
|
||||
_ => True
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
DetPl quant num ord = {
|
||||
s = \\h,g,c => quant.s ! Pl ! h ! g ! c
|
||||
++ num.s ! g ! (toDef quant.d num.n) ! c
|
||||
--FIXME check this:
|
||||
++ ord.s ! g ! (toDef quant.d num.n) ! c ;
|
||||
n = num.n;
|
||||
d = quant.d;
|
||||
isPron = quant.isPron;
|
||||
isNum =
|
||||
case num.n of {
|
||||
None => False;
|
||||
_ => True
|
||||
}
|
||||
} ;
|
||||
|
||||
--DEPRECATED
|
||||
-- SgQuant quant = {s = quant.s ! Sg ; d = quant.d;
|
||||
-- isPron = quant.isPron; isNum = False} ;
|
||||
-- PlQuant quant = {s = quant.s ! Pl ; d = quant.d;
|
||||
-- isPron = quant.isPron; isNum = False} ;
|
||||
|
||||
PossPron p = {
|
||||
s = \\_,_,_,_ => p.s ! Gen;
|
||||
d = Const;
|
||||
isPron = True;
|
||||
isNum = False } ;
|
||||
|
||||
NoNum, NoOrd = {
|
||||
s = \\_,_,_ => [] ;
|
||||
n = None } ;
|
||||
|
||||
NumDigits digits = {
|
||||
s = \\_,_,_ => digits.s;
|
||||
n = digits.n
|
||||
};
|
||||
|
||||
NumNumeral numeral = {
|
||||
s = numeral.s ! NCard ;
|
||||
n = numeral.n
|
||||
};
|
||||
|
||||
AdNum adn num = {
|
||||
s = \\g,d,c => adn.s ++ num.s ! g ! d ! c ;
|
||||
n = num.n } ;
|
||||
|
||||
OrdDigits digits = {
|
||||
s = \\_,d,_ => Al ! d ++ digits.s;
|
||||
n = digits.n
|
||||
};
|
||||
|
||||
-- OrdNumeral : Numeral -> Ord ; -- fifty-first
|
||||
OrdNumeral numeral = {
|
||||
s = numeral.s ! NOrd ;
|
||||
n = numeral.n
|
||||
};
|
||||
|
||||
-- FIXME, "the biggest house" would better translate into
|
||||
-- akbaru baytin rather than al-baytu l-2akbaru
|
||||
-- DetCN (DetSg DefArt (OrdSuperl big_A)) (UseN house_N)
|
||||
OrdSuperl a = {
|
||||
s = \\_,d,c => a.s ! AComp d c;
|
||||
n = One
|
||||
} ;
|
||||
|
||||
DefArt = {
|
||||
s = \\_,_,_,_ => [];
|
||||
d = Def;
|
||||
isPron = False;
|
||||
isNum = False } ;
|
||||
|
||||
IndefArt = {
|
||||
s = \\_,_,_,_ => [];
|
||||
d = Indef;
|
||||
isPron = False;
|
||||
isNum = False} ;
|
||||
|
||||
MassDet = {s = \\_,_,_,_ => [] ; d = Indef;
|
||||
isNum = False; isPron = False} ;
|
||||
|
||||
UseN n = n ** {adj = \\_,_,_ => []};
|
||||
-- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
|
||||
-- ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
|
||||
--
|
||||
-- UseN2 n = n ;
|
||||
-- UseN3 n = n ;
|
||||
--
|
||||
AdjCN ap cn = {
|
||||
s = \\n,d,c => cn.s ! n ! d ! c;
|
||||
adj = \\n,d,c => ap.s ! cn.h ! cn.g ! n ! (definite ! d) ! c ;
|
||||
g = cn.g;
|
||||
h = cn.h
|
||||
};
|
||||
-- RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
||||
-- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
|
||||
--
|
||||
-- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;
|
||||
-- ApposCN cn np =
|
||||
}
|
||||
|
||||
@@ -5,115 +5,150 @@ concrete NumeralAra of Numeral = CatAra **
|
||||
|
||||
lincat
|
||||
|
||||
Digit = {s : DForm => Gender => State => Case => Str ;
|
||||
Digit = {s : DForm => CardOrd => Gender => State => Case => Str ;
|
||||
n : Size } ;
|
||||
Sub10 = {s : DForm => Gender => State => Case => Str ;
|
||||
Sub10 = {s : DForm => CardOrd => Gender => State => Case => Str ;
|
||||
n : Size } ;
|
||||
Sub100 = {s : Gender => State => Case => Str ;
|
||||
n : Size} ;
|
||||
Sub1000 = {s : Gender => State => Case => Str ;
|
||||
n : Size } ;
|
||||
Sub1000000 = {s : Gender => State => Case => Str ;
|
||||
Sub100 = {s : CardOrd => Gender => State => Case => Str ;
|
||||
n : Size} ;
|
||||
Sub1000 = {s : CardOrd => Gender => State => Case => Str ;
|
||||
n : Size } ;
|
||||
Sub1000000 = {s : CardOrd => Gender => State => Case => Str ;
|
||||
n : Size} ;
|
||||
|
||||
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
lin n2 = num2 ** {n = Two };
|
||||
|
||||
lin n3 = num3_10 "ثَلاث" "ثالِث";
|
||||
lin n4 = num3_10 "أَربَع" "رابِع";
|
||||
lin n5 = num3_10 "خَمس" "خامِس";
|
||||
lin n6 = num3_10 "سِتّ" "سادِس";
|
||||
lin n7 = num3_10 "سَبع" "سابِع";
|
||||
lin n8 = num3_10 "ثَمانِي" "ثامِن";
|
||||
lin n9 = num3_10 "تِسع" "تاسِع";
|
||||
|
||||
lin num x = x ;
|
||||
lin pot01 = mkNum "واحِد" "أَوَّل" "أُولى" ** { n = One } ;
|
||||
|
||||
lin pot0 d = d ;
|
||||
|
||||
lin n2 = num2 ** {n = Two };
|
||||
|
||||
|
||||
lin n3 = num3_10 "ثَلاث";
|
||||
lin n4 = num3_10 "أَربَع";
|
||||
lin n5 = num3_10 "خَمس";
|
||||
lin n6 = num3_10 "سِتّ";
|
||||
lin n7 = num3_10 "سَبع";
|
||||
lin n8 = num3_10 "ثَمانِي";
|
||||
lin n9 = num3_10 "تِسع";
|
||||
|
||||
|
||||
lin pot01 = num1_10 "واحِد" ** { n = One } ;
|
||||
|
||||
lin pot0 d = d ;
|
||||
|
||||
lin pot110 =
|
||||
{ s= ((num3_10 "عَشر").s ! unit ) ;
|
||||
lin pot110 = {
|
||||
s= ((num3_10 "عَشر" "عاشِر").s ! unit ) ;
|
||||
n = ThreeTen
|
||||
};
|
||||
lin pot111 =
|
||||
{ s = \\g,d,_ =>
|
||||
};
|
||||
|
||||
lin pot111 = {
|
||||
s = \\_,g,d,_ =>
|
||||
case g of {
|
||||
Masc => Al ! d + "أَحَدَ" ++ teen ! Masc ;
|
||||
Fem => Al ! d + "إِحدَى" ++ teen ! Fem
|
||||
};
|
||||
n = NonTeen
|
||||
};
|
||||
|
||||
lin pot1to19 dig =
|
||||
{ s = \\g,d,c =>
|
||||
case dig.n of {
|
||||
Two => Al ! d + num2.s ! unit ! g ! Const ! c ++ teen ! g ;
|
||||
_ => dig.s ! unit ! g ! (toDef d ThreeTen) ! Acc ++
|
||||
teen ! (genPolarity ! g)
|
||||
};
|
||||
n = case dig.n of {
|
||||
Two => NonTeen;
|
||||
_ => Teen
|
||||
}
|
||||
};
|
||||
|
||||
lin pot0as1 num =
|
||||
{ s= num.s ! unit;
|
||||
};
|
||||
|
||||
lin pot1to19 dig = {
|
||||
s = \\co,g,d,c => case dig.n of {
|
||||
Two => Al ! d + num2.s ! unit ! co ! g ! Const ! c ++ teen ! g ;
|
||||
_ => dig.s ! unit ! co ! g ! (toDef d ThreeTen) ! Acc ++
|
||||
teen ! (genPolarity ! g)
|
||||
};
|
||||
n = case dig.n of {
|
||||
Two => NonTeen;
|
||||
_ => Teen
|
||||
}
|
||||
};
|
||||
|
||||
lin pot0as1 num = {
|
||||
s= num.s ! unit;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
lin pot1 dig =
|
||||
{ s = dig.s ! ten;
|
||||
} ;
|
||||
|
||||
lin pot1 dig = {
|
||||
s = dig.s ! ten;
|
||||
n = NonTeen
|
||||
};
|
||||
} ;
|
||||
|
||||
lin pot1plus dig n = {
|
||||
s = \\co,g,d,c => n.s ! unit ! co ! g ! d ! c
|
||||
++ "وَ" ++ dig.s ! ten ! co ! g ! d ! c ;
|
||||
n = NonTeen
|
||||
};
|
||||
|
||||
lin pot1plus dig n = {
|
||||
s = \\g,d,c => n.s ! unit ! g ! d ! c
|
||||
++ "وَ" ++ dig.s ! ten ! g ! d ! c ;
|
||||
n = NonTeen
|
||||
};
|
||||
lin pot1as2 n = n ;
|
||||
|
||||
lin pot1as2 n = n ;
|
||||
|
||||
lin pot2 dig = {
|
||||
s = \\g,d,c =>
|
||||
case dig.n of {
|
||||
One => num100 ! d ! c ;
|
||||
Two => num200 ! d ! c ;
|
||||
_ => dig.s ! unit ! Masc ! (toDef d ThreeTen) ! c ++ "مِٱَةِ"
|
||||
lin pot2 dig = {
|
||||
s = \\co,_,d,c => case dig.n of {
|
||||
One => num100 ! d ! c ;
|
||||
Two => num200 ! d ! c ;
|
||||
_ => dig.s ! unit ! co ! Masc ! (toDef d ThreeTen) ! c ++ "مِٱَةِ"
|
||||
};
|
||||
n = Hundreds
|
||||
};
|
||||
};
|
||||
|
||||
lin pot2plus m e = {
|
||||
s = \\co,g,d,c => case m.n of {
|
||||
One => num100 ! d ! c;
|
||||
Two => num200 ! d ! c;
|
||||
_ => m.s ! unit ! co ! Masc ! (toDef d ThreeTen) ! c ++ "مِٱَةٌ"
|
||||
} ++ "وَ" ++ e.s ! co ! g ! d ! c ;
|
||||
n = e.n
|
||||
};
|
||||
|
||||
lin pot2plus m e = {
|
||||
s = \\g,d,c =>
|
||||
case m.n of {
|
||||
One => num100 ! d ! c;
|
||||
Two => num200 ! d ! c;
|
||||
_ => m.s ! unit ! Masc ! (toDef d ThreeTen) ! c ++ "مِٱَةٌ"
|
||||
} ++ "وَ" ++ e.s ! g ! d ! c ;
|
||||
n = e.n
|
||||
};
|
||||
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
|
||||
lin pot3 m = {
|
||||
s = \\g,d,c =>
|
||||
case m.n of {
|
||||
lin pot2as3 n = n ;
|
||||
|
||||
lin pot3 m = {
|
||||
s = \\co,_,d,c => case m.n of {
|
||||
One => num1000 ! (definite ! d) ! c;
|
||||
Two => num2000 ! (definite ! d) ! c;
|
||||
_ => m.s ! Fem ! (toDef d ThreeTen) ! c ++ "آلافٌ"
|
||||
} ;
|
||||
n = m.n
|
||||
};
|
||||
_ => m.s ! co ! Fem ! (toDef d ThreeTen) ! c ++ "آلافٌ"
|
||||
} ;
|
||||
n = m.n
|
||||
};
|
||||
--lin pot3plus n m = {
|
||||
-- s = \\c => n.s ! NCard ++ "تهُْسَند" ++ m.s ! c ; n = Pl} ;
|
||||
|
||||
-- numerals as sequences of digits
|
||||
|
||||
lincat
|
||||
Dig = Digits ;
|
||||
-- Numeral,Digits = {s : Gender => State => Case => Str ;
|
||||
-- n : Size } ;
|
||||
|
||||
|
||||
lin
|
||||
IDig d = d ;
|
||||
|
||||
IIDig d i = {
|
||||
s = d.s ++ i.s;
|
||||
n = ThreeTen ;
|
||||
} ;
|
||||
|
||||
D_0 = mk1Dig "0" ;
|
||||
D_1 = mk2Dig "1" One ;
|
||||
D_2 = mk2Dig "2" Two ;
|
||||
D_3 = mk1Dig "3" ;
|
||||
D_4 = mk1Dig "4" ;
|
||||
D_5 = mk1Dig "5" ;
|
||||
D_6 = mk1Dig "6" ;
|
||||
D_7 = mk1Dig "7" ;
|
||||
D_8 = mk1Dig "8" ;
|
||||
D_9 = mk1Dig "9" ;
|
||||
|
||||
oper
|
||||
|
||||
|
||||
mk2Dig : Str -> Size -> Digits = \str,sz -> {
|
||||
s = str ;
|
||||
n = sz ;
|
||||
lock_Digits = <>
|
||||
};
|
||||
|
||||
mk1Dig : Str -> Digits = \str -> {
|
||||
s = str ;
|
||||
n = ThreeTen;
|
||||
lock_Digits = <>
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ resource ParadigmsAra = open
|
||||
|
||||
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
|
||||
|
||||
mkNP : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn ->
|
||||
mkPron : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn ->
|
||||
{ s =
|
||||
table {
|
||||
Nom => ana;
|
||||
@@ -349,6 +349,20 @@ resource ParadigmsAra = open
|
||||
a = {pgn = pgn; isPron = True };
|
||||
lock_NP = <>
|
||||
};
|
||||
|
||||
-- e.g. al-jamii3, 2a7ad
|
||||
regNP : Str -> Number -> NP = \word,n ->
|
||||
{ s = \\c => word + vowel ! c ;
|
||||
a = {pgn = Per3 Masc n; isPron = False };
|
||||
lock_NP = <>
|
||||
};
|
||||
|
||||
-- e.g. hadha, dhaalika
|
||||
indeclNP : Str -> Number -> NP = \word,n ->
|
||||
{ s = \\c => word ;
|
||||
a = {pgn = Per3 Masc n; isPron = False };
|
||||
lock_NP = <>
|
||||
};
|
||||
|
||||
mkQuant7 : (_,_,_,_,_,_,_ : Str) -> State -> Quant =
|
||||
\hava,havihi,havAn,havayn,hAtAn,hAtayn,hA'ulA,det ->
|
||||
@@ -364,6 +378,8 @@ resource ParadigmsAra = open
|
||||
_ => havihi
|
||||
};
|
||||
d = Def;
|
||||
isPron = False;
|
||||
isNum = False;
|
||||
lock_Quant = <>
|
||||
};
|
||||
|
||||
@@ -377,24 +393,30 @@ resource ParadigmsAra = open
|
||||
_ => tilka
|
||||
};
|
||||
d = Def;
|
||||
isPron = False;
|
||||
isNum = False;
|
||||
lock_Quant = <>
|
||||
};
|
||||
|
||||
sndA root pat =
|
||||
let { raw = sndA' root pat } in
|
||||
{ s = \\g,n,d,c =>
|
||||
let raw = sndA' root pat in {
|
||||
s = \\af =>
|
||||
case root of {
|
||||
_ + "؟" + _ => rectifyHmz(raw.s ! g ! n ! d ! c);
|
||||
_ => raw.s ! g ! n ! d ! c
|
||||
_ + "؟" + _ => rectifyHmz(raw.s ! af);
|
||||
_ => raw.s ! af
|
||||
};
|
||||
lock_A = <>
|
||||
};
|
||||
|
||||
sndA' : Str -> Str -> A =
|
||||
\root,pat ->
|
||||
let { kabIr = mkWord pat root
|
||||
let { kabIr = mkWord pat root;
|
||||
akbar = mkWord "أَفعَل" root
|
||||
} in {
|
||||
s = adj kabIr ;
|
||||
s = table {
|
||||
APosit g n d c => (positAdj kabIr) ! g ! n ! d ! c ;
|
||||
AComp d c => (indeclN akbar) ! d ! c
|
||||
};
|
||||
lock_A = <>
|
||||
};
|
||||
|
||||
|
||||
@@ -89,6 +89,8 @@ resource PatternsAra = {
|
||||
fuculo = { h = "" ; m1 = "ُ" ; m2 = "ُ" ; t = "ْ" } ;
|
||||
fucUl = { h = "" ; m1 = "ُ" ; m2 = "ُو" ; t = "" } ;
|
||||
fUcil = { h = "" ; m1 = "ُو" ; m2 = "ِ" ; t = "" } ;
|
||||
mafcUl = { h = "مَ"; m1 = "ْ" ; m2 = "ُو" ; t = "" } ;
|
||||
mafcil = { h = "مَ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ;
|
||||
tafAcal = { h = "تَ"; m1 = "َا" ; m2 = "َ" ; t = "" } ;
|
||||
tafaccal = { h = "تَ"; m1 = "َ" ; m2 = "َّ" ; t = "" } ;
|
||||
tufuccil = { h = "تُ"; m1 = "ُ" ; m2 = "ِّ" ; t = "" } ;
|
||||
|
||||
@@ -99,42 +99,45 @@ resource ResAra = PatternsAra ** open Prelude, Predef in {
|
||||
NTable = Number => State => Case => Str;
|
||||
|
||||
Noun : Type = {s : NTable ; g : Gender; h : Species} ;
|
||||
Adj : Type = {s : Gender => NTable} ;
|
||||
-- Adj : Type = {s : AForm => Str} ;
|
||||
-- Adj : Type = {s : Gender => NTable} ;
|
||||
Adj : Type = {s : AForm => Str} ;
|
||||
Verb : Type = {s : VForm => Str} ;
|
||||
|
||||
param
|
||||
VForm =
|
||||
VPerf Voice PerGenNum
|
||||
VPerf Voice PerGenNum
|
||||
| VImpf Mood Voice PerGenNum
|
||||
| VImp Gender Number ;
|
||||
| VImp Gender Number
|
||||
| VPPart ;
|
||||
|
||||
PerGenNum =
|
||||
Per3 Gender Number
|
||||
Per3 Gender Number
|
||||
| Per2 Gender Number
|
||||
| Per1 SgPl;
|
||||
|
||||
SgPl = Sing | Plur;
|
||||
|
||||
|
||||
AForm =
|
||||
APosit Gender Number State Case
|
||||
| AComp Case ;
|
||||
|
||||
--verbal morphology
|
||||
|
||||
APosit Gender Number State Case
|
||||
| AComp State Case ;
|
||||
|
||||
--verbal morphology
|
||||
|
||||
oper
|
||||
|
||||
|
||||
--macro for sound verb
|
||||
verb : (_,_,_,_,_ : Str) -> Verb = --PerfAct, PerfPas, ImpfAct, ImpfPas, Imp
|
||||
\katab,kutib,aktub,uktab,euktub ->
|
||||
{ s = table {
|
||||
--PerfAct, PerfPas, ImpfAct, ImpfPas, Imp, PPart
|
||||
verb : (_,_,_,_,_,_ : Str) -> Verb =
|
||||
\katab,kutib,aktub,uktab,euktub,maktUb -> {
|
||||
s = table {
|
||||
VPerf Act pgn => katab + suffixPerf ! pgn ;
|
||||
VPerf Pas pgn => kutib + suffixPerf ! pgn ;
|
||||
VImpf Ind Act pgn => prefixImpf ! pgn + aktub + suffixImpfInd ! pgn ;
|
||||
VImpf Ind Pas pgn => prefixImpf ! pgn + uktab + suffixImpfInd ! pgn ;
|
||||
VImpf m Act pgn => prefixImpf ! pgn + aktub + suffixImpfCJ m ! pgn ;
|
||||
VImpf m Pas pgn => prefixImpf ! pgn + uktab + suffixImpfCJ m ! pgn ;
|
||||
VImp g n => euktub + suffixImpfCJ Jus ! (Per2 g n)
|
||||
VImpf Ind Act pgn => prefixImpf!pgn + aktub + suffixImpfInd !pgn;
|
||||
VImpf Ind Pas pgn => prefixImpf!pgn + uktab + suffixImpfInd !pgn;
|
||||
VImpf m Act pgn => prefixImpf!pgn + aktub + suffixImpfCJ m ! pgn;
|
||||
VImpf m Pas pgn => prefixImpf !pgn + uktab + suffixImpfCJ m !pgn;
|
||||
VImp g n => euktub + suffixImpfCJ Jus ! (Per2 g n);
|
||||
VPPart => maktUb
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -156,7 +159,7 @@ oper
|
||||
Per1 Sing => "ْتُ" ;
|
||||
Per1 Plur => "ْنَا"
|
||||
} ;
|
||||
|
||||
|
||||
prefixImpf : PerGenNum => Str =
|
||||
table {
|
||||
Per1 Sing => "أ" ;
|
||||
@@ -191,8 +194,8 @@ oper
|
||||
} ;
|
||||
|
||||
--macro for geminate verbs: FIXME, change the misleading variable names
|
||||
verbGeminate : (_,_,_,_,_,_,_,_,_,_ : Str) -> Verb =
|
||||
\xAf,xif,xyf,xuf,axAf,axaf,uxAf,uxaf,xaf,xAf' ->
|
||||
verbGeminate : (_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb =
|
||||
\xAf,xif,xyf,xuf,axAf,axaf,uxAf,uxaf,xaf,xAf',ppart ->
|
||||
let { perfPattern = patHollowPerf xAf xif xyf xuf ;
|
||||
impfPattern = patHollowImpf axAf axaf uxAf uxaf ;
|
||||
impPattern = patHollowImp xaf xAf'
|
||||
@@ -201,13 +204,14 @@ oper
|
||||
VPerf v pgn => perfPattern ! v ! pgn + suffixPerf ! pgn ;
|
||||
VImpf Ind v pgn => prefixImpf ! pgn + impfPattern ! v ! pgn + suffixImpfInd ! pgn ;
|
||||
VImpf m v pgn => prefixImpf ! pgn + impfPattern ! v ! pgn + suffixImpfCJ m ! pgn ;
|
||||
VImp g n => impPattern ! g ! n + suffixImpfCJ Jus ! (Per2 g n)
|
||||
VImp g n => impPattern ! g ! n + suffixImpfCJ Jus ! (Per2 g n);
|
||||
VPPart => ppart
|
||||
}
|
||||
} ;
|
||||
|
||||
--macro for hollow verbs:
|
||||
verbHollow : (_,_,_,_,_,_,_,_,_,_ : Str) -> Verb =
|
||||
\xAf,xif,xyf,xuf,axAf,axaf,uxAf,uxaf,xaf,xAf' ->
|
||||
verbHollow : (_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb =
|
||||
\xAf,xif,xyf,xuf,axAf,axaf,uxAf,uxaf,xaf,xAf',ppart ->
|
||||
let { perfPattern = patHollowPerf xAf xif xyf xuf ;
|
||||
impfPattern = patHollowImpf axAf axaf uxAf uxaf ;
|
||||
impPattern = patHollowImp axaf xAf' ;
|
||||
@@ -218,13 +222,14 @@ oper
|
||||
VImpf Ind v pgn => prefixImpf ! pgn + impfPattern ! v ! pgn + suffixImpfInd ! pgn ;
|
||||
VImpf Cnj v pgn => prefixImpf ! pgn + impfPattern ! v ! pgn + suffixImpfCJ Cnj ! pgn ;
|
||||
VImpf Jus v pgn => prefixImpf ! pgn + jusPattern ! v ! pgn + suffixImpfCJ Jus ! pgn ;
|
||||
VImp g n => impPattern ! g ! n + suffixImpfCJ Jus ! (Per2 g n)
|
||||
VImp g n => impPattern ! g ! n + suffixImpfCJ Jus ! (Per2 g n);
|
||||
VPPart => ppart
|
||||
}
|
||||
} ;
|
||||
|
||||
--macro for defective verbs:
|
||||
verbDef: (_,_,_,_,_,_,_,_,_,_ : Str) -> Vowel -> Verb =
|
||||
\rama,ramay,rumi,rumu,rumiy,armi,armu,urma,Irmi,Irmu,vowel ->
|
||||
verbDef: (_,_,_,_,_,_,_,_,_,_,_ : Str) -> Vowel -> Verb =
|
||||
\rama,ramay,rumi,rumu,rumiy,armi,armu,urma,Irmi,Irmu,ppart,vowel ->
|
||||
let {
|
||||
patPerf = patDefPerf rama ramay rumi rumu rumiy ;
|
||||
patImpfAct = patDefImpfAct armi armu ;
|
||||
@@ -234,7 +239,8 @@ oper
|
||||
VPerf v pgn => patPerf ! v ! pgn + (suffixPerfDef v) ! pgn ;
|
||||
VImpf m Act pgn => prefixImpf ! pgn + patImpfAct ! pgn + (suffixImpfDef Act vowel) ! m ! pgn ;
|
||||
VImpf m Pas pgn => prefixImpf ! pgn + urma + (suffixImpfDef Pas vowel) ! m ! pgn ;
|
||||
VImp g n => patImp ! g ! n + (suffixImpfDef Act vowel) ! Jus ! (Per2 g n)
|
||||
VImp g n => patImp ! g ! n + (suffixImpfDef Act vowel) ! Jus ! (Per2 g n) ;
|
||||
VPPart => ppart
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -355,9 +361,10 @@ v1sound : Root3 -> Vowel -> Vowel -> Verb =
|
||||
euktub = case fcl.f of {
|
||||
"؟"|"و"|"ي" => qif ;
|
||||
_ => prefixImp ! vImpf + ktub
|
||||
}
|
||||
};
|
||||
maktUb = mkStrong mafcUl fcl
|
||||
} in
|
||||
verb katab kutib aktub uktab euktub ;
|
||||
verb katab kutib aktub uktab euktub maktUb ;
|
||||
|
||||
v1hollow : Root3 -> Vowel -> Verb =
|
||||
\xwf,vowel ->
|
||||
@@ -371,8 +378,10 @@ v1hollow : Root3 -> Vowel -> Verb =
|
||||
uxAf= mkHollow ufAc xwf ;
|
||||
uxaf= "ُ" + xaf ;
|
||||
xAf'= mkHollow (patHol3 ! vowel) xwf ;
|
||||
axAf= "َ" + xAf'
|
||||
} in verbHollow xAf xif xyf xuf axAf axaf uxAf uxaf xaf xAf' ;
|
||||
axAf= "َ" + xAf';
|
||||
ppart = "مَ" + xAf' -- FIXME actually wierd anomalies happen with the a vowel..
|
||||
|
||||
} in verbHollow xAf xif xyf xuf axAf axaf uxAf uxaf xaf xAf' ppart ;
|
||||
|
||||
patHol1 : Vowel => Pattern =
|
||||
table { u => fuc ; _ => fic} ;
|
||||
@@ -411,8 +420,9 @@ v1geminate : Str -> Vowel -> Vowel -> Verb =
|
||||
amdud = "َ" + mdud ;
|
||||
umadd = "ُ" + madd ;
|
||||
umdad = "ُ" + mkStrong fcal mdd ;
|
||||
Umdud = (prefixImp ! vImpf) + mdud
|
||||
} in verbGeminate madd madad mudd mudid amudd amdud umadd umdad Umdud mudd' ;
|
||||
Umdud = (prefixImp ! vImpf) + mdud;
|
||||
mamdUd = mkStrong mafcUl mdd
|
||||
} in verbGeminate madd madad mudd mudid amudd amdud umadd umdad Umdud mudd' mamdUd;
|
||||
|
||||
patGem1 : Vowel => Pattern =
|
||||
table {
|
||||
@@ -449,8 +459,9 @@ v1defective : Root3 -> Vowel -> Verb =
|
||||
armu = "َ" + rmu ;
|
||||
urma = mkDefective ufca rmy ;
|
||||
eirmi = prefixImp ! vowel + rmi;
|
||||
eirmu = prefixImp ! vowel + rmu
|
||||
} in verbDef rama ramay rumi rumu rumiy armi armu urma eirmi eirmu vowel;
|
||||
eirmu = prefixImp ! vowel + rmu;
|
||||
marmiy = mkStrong mafcil rmy
|
||||
} in verbDef rama ramay rumi rumu rumiy armi armu urma eirmi eirmu marmiy vowel ;
|
||||
|
||||
patDef1 : Vowel => Pattern =
|
||||
table {
|
||||
@@ -471,9 +482,10 @@ v2sound : Root3 -> Verb = \qsm ->
|
||||
qussim = mkStrong fuccil qsm ;
|
||||
qassim = mkStrong faccil qsm ;
|
||||
uqassim = "ُ" + qassim ;
|
||||
uqassam = "ُ" + qassam
|
||||
uqassam = "ُ" + qassam ;
|
||||
muqassam = "مُ" + qassam
|
||||
} in
|
||||
verb qassam qussim uqassim uqassam qassim ;
|
||||
verb qassam qussim uqassim uqassam qassim muqassam;
|
||||
|
||||
v2defective : Root3 -> Verb = \gny ->
|
||||
let {
|
||||
@@ -487,7 +499,8 @@ v2defective : Root3 -> Verb = \gny ->
|
||||
gannu = mkDefective faccu gny;
|
||||
ugannu = "ُ" + gannu;
|
||||
uganna = "ُ" + ganna;
|
||||
} in verbDef ganna gannay gunni gunnu gunniy uganni ugannu uganna ganni gannu i;
|
||||
mugannaY = "مُ" + ganna + "ى"
|
||||
} in verbDef ganna gannay gunni gunnu gunniy uganni ugannu uganna ganni gannu mugannaY i;
|
||||
|
||||
v3sound : Root3 -> Verb =
|
||||
\tbc ->
|
||||
@@ -497,7 +510,8 @@ v3sound : Root3 -> Verb =
|
||||
tAbic = mkStrong fAcil tbc ;
|
||||
utAbic = "ُ" + tAbic ;
|
||||
utAbac = mkStrong ufAcal tbc ;
|
||||
} in verb tAbac twbic utAbic utAbac tAbic;
|
||||
mutAbac = "م" + utAbac
|
||||
} in verb tAbac twbic utAbic utAbac tAbic mutAbac;
|
||||
|
||||
v4sound : Root3 -> Verb =
|
||||
\qnc ->
|
||||
@@ -506,9 +520,10 @@ v4sound : Root3 -> Verb =
|
||||
euqnic = mkStrong eufcil qnc;
|
||||
uqnic = mkStrong ufcil qnc;
|
||||
uqnac = mkStrong ufcal qnc;
|
||||
eaqnic = mkStrong eafcil qnc
|
||||
eaqnic = mkStrong eafcil qnc;
|
||||
muqnac = "م" + uqnac
|
||||
} in
|
||||
verb eaqnac euqnic uqnic uqnac eaqnic ;
|
||||
verb eaqnac euqnic uqnic uqnac eaqnic muqnac;
|
||||
|
||||
v4defective : Root3 -> Verb = \cTy ->
|
||||
let {
|
||||
@@ -525,7 +540,8 @@ v4defective : Root3 -> Verb = \cTy ->
|
||||
ucTa = "ُ" + cTa;
|
||||
eacTi = "أَ" + cTi;
|
||||
eacTu = "أَ" + cTu;
|
||||
} in verbDef eacTa eacTay eucTi eucTu eucTiy ucTi ucTu ucTa eacTi eacTu i;
|
||||
mucTaY = "م" + ucTa +"ى"
|
||||
} in verbDef eacTa eacTay eucTi eucTu eucTiy ucTi ucTu ucTa eacTi eacTu mucTaY i;
|
||||
|
||||
v5sound : Root3 -> Verb =
|
||||
\nfs ->
|
||||
@@ -534,7 +550,8 @@ v5sound : Root3 -> Verb =
|
||||
tunuffis = mkStrong tufuccil nfs ;
|
||||
atanaffas = "َ" + tanaffas ;
|
||||
utanaffas = "ُ" + tanaffas ;
|
||||
} in verb tanaffas tunuffis atanaffas utanaffas tanaffas ;
|
||||
mutanaffas = "م" + tanaffas
|
||||
} in verb tanaffas tunuffis atanaffas utanaffas tanaffas mutanaffas;
|
||||
|
||||
v6sound : Root3 -> Verb =
|
||||
\fqm ->
|
||||
@@ -543,7 +560,8 @@ v6sound : Root3 -> Verb =
|
||||
tufUqim = mkStrong tufUcil fqm ;
|
||||
atafAqam = "َ" + tafAqam ;
|
||||
utafAqam = "ُ" + tafAqam ;
|
||||
} in verb tafAqam tufUqim atafAqam utafAqam tafAqam ;
|
||||
mutafAqam = "م" + utafAqam
|
||||
} in verb tafAqam tufUqim atafAqam utafAqam tafAqam mutafAqam;
|
||||
|
||||
v8sound : Root3 -> Verb =
|
||||
\rbT ->
|
||||
@@ -555,7 +573,8 @@ v8sound : Root3 -> Verb =
|
||||
artabiT = "َ" + rtabiT ;
|
||||
urtabaT = "ُ" + rtabaT ;
|
||||
eirtabiT = "إِ" + rtabiT ;
|
||||
} in verb eirtabaT eurtubiT artabiT urtabaT eirtabiT;
|
||||
murtabaT = "م" + urtabaT
|
||||
} in verb eirtabaT eurtubiT artabiT urtabaT eirtabiT murtabaT;
|
||||
|
||||
patV1Perf : Vowel => Pattern =
|
||||
table {
|
||||
@@ -649,7 +668,8 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
|
||||
--Nominal Morphology
|
||||
|
||||
adj : Str -> Gender => NTable =
|
||||
--takes the adjective lemma and gives the Posit table
|
||||
positAdj : Str -> Gender => NTable =
|
||||
\kabIr ->
|
||||
let kabIra = kabIr + "َة" in
|
||||
table {
|
||||
@@ -657,21 +677,22 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
Fem => sndf kabIra
|
||||
};
|
||||
|
||||
clr : Str -> Str -> Str -> Gender => NTable =
|
||||
clr : Str -> Str -> Str -> AForm => Str =
|
||||
\aHmar,HamrA',Humr ->
|
||||
table {
|
||||
Masc => table {
|
||||
Sg => indeclN aHmar;
|
||||
Dl => dual aHmar;
|
||||
Pl => sing Humr
|
||||
APosit Masc n d c => case n of {
|
||||
Sg => indeclN aHmar ! d ! c ;
|
||||
Dl => dual aHmar ! d ! c ;
|
||||
Pl => sing Humr ! d ! c
|
||||
};
|
||||
Fem => table {
|
||||
Sg => indeclN HamrA';
|
||||
Dl => dual ((tk 2 HamrA') + "و");
|
||||
Pl => sing Humr
|
||||
}
|
||||
APosit Fem n d c => case n of {
|
||||
Sg => indeclN HamrA' ! d ! c;
|
||||
Dl => dual ((tk 2 HamrA') + "و") ! d ! c;
|
||||
Pl => sing Humr ! d ! c
|
||||
};
|
||||
AComp d c => indeclN aHmar ! d ! c
|
||||
};
|
||||
|
||||
|
||||
-- indeclinable nominal word (mamnuu3 mina S-Sarf)
|
||||
indeclN : Str -> State => Case => Str =
|
||||
\aHmar -> \\s,c => Al!s + aHmar + indecl!c;
|
||||
@@ -770,7 +791,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
};
|
||||
|
||||
|
||||
--declection 2 (ends in yaa') of the singular or broken plural words
|
||||
--declection 2 (ends in yaa')
|
||||
dec2sg : State => Case => Str =
|
||||
table {
|
||||
Indef =>
|
||||
@@ -785,7 +806,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
}
|
||||
};
|
||||
|
||||
--declection 3 (ending in alif) of the singular or broken plural words
|
||||
--declention 3 (ending in alif)
|
||||
dec3sg : State => Case => Str =
|
||||
table {
|
||||
Indef =>
|
||||
@@ -886,7 +907,8 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
_ => Def --Lkitaabu
|
||||
};
|
||||
|
||||
--FIXME needs testing, should be wrong!
|
||||
|
||||
--FIXME needs testing
|
||||
nounCase : Case -> Size -> State -> Case =
|
||||
\c,size,s ->
|
||||
case <size,s> of {
|
||||
@@ -914,13 +936,17 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
_ => s
|
||||
};
|
||||
|
||||
--some determiners act as adjectives modifying the noun they count
|
||||
detAsAdj : Bool -> Size -> State -> Bool = \isNum,s,d ->
|
||||
case <isNum,s,d> of {
|
||||
<False,_,_> => False; --this doesn't hold for non-numerals
|
||||
<True,_,Def> => True; --definite numbers act as adjectives
|
||||
<True,Two,_> => True; --numerals one and two always adjectives
|
||||
<True,One,_> => True; --numerals one and two always adjectives
|
||||
-- in a NP, sometimes the common noun preceedes the determiner
|
||||
-- e.g. some determiners act as adjectives modifying the noun they count
|
||||
-- "the three children, two children"
|
||||
-- e.g. possesive pronouns: his book (kitaabuhu"
|
||||
cnB4det : Bool -> Bool -> Size -> State -> Bool = \isPron,isNum,s,d ->
|
||||
case <isPron,isNum,s,d> of {
|
||||
<True,_,_,_> => True;
|
||||
<_,False,_,_> => False; --non-numerals
|
||||
<_,True,_,Def> => True; --definite numbers act as adjectives
|
||||
<_,True,Two,_> => True; --numerals one and two always adjectives
|
||||
<_,True,One,_> => True; --numerals one and two always adjectives
|
||||
_ => False
|
||||
};
|
||||
|
||||
@@ -958,7 +984,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
s : Species => Gender => Case => Str ;
|
||||
d : State;
|
||||
n : Size;
|
||||
isNum : Bool
|
||||
isNum : Bool;
|
||||
-- for genitive pronouns (suffixes). if true, then "cn ++ det"
|
||||
--should be used instead of "det ++ cn" when constructing the NP
|
||||
isPron : Bool
|
||||
} ;
|
||||
|
||||
Predet : Type = {
|
||||
@@ -1055,36 +1084,60 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
|
||||
Size = One | Two | ThreeTen | Teen | NonTeen | Hundreds | None ;
|
||||
DForm = unit | ten ;
|
||||
CardOrd = NCard | NOrd ;
|
||||
|
||||
oper
|
||||
--digits 3 to 10: take the digit in masculine form and
|
||||
--calculates the whole table
|
||||
--digits 1, 3 - 10: take the lemmas of the card ords & in masculine
|
||||
--form and calculates the whole table
|
||||
|
||||
num1_10 : Str -> { s : DForm => Gender => State => Case => Str } =
|
||||
\xams ->
|
||||
let xamsa = xams + "َة" in {
|
||||
s= table {
|
||||
regNum : Str -> Str ->
|
||||
{s : DForm => CardOrd => Gender => State => Case => Str} =
|
||||
\xams,xAmis ->
|
||||
let { xamsa = xams + "َة";
|
||||
xAmisa = xAmis + "َة"} in
|
||||
mkNum xamsa xAmis xAmisa;
|
||||
|
||||
mkNum : Str -> Str -> Str ->
|
||||
{s : DForm => CardOrd => Gender => State => Case => Str} =
|
||||
\wAhid,awwal,Ula ->
|
||||
let { wAhida = wAhid + "َة"} in
|
||||
{ s= table {
|
||||
unit => table {
|
||||
Masc => \\s,c => (sing xams) ! s ! c ;
|
||||
Fem => \\s,c => Al ! s + xamsa + dec1sg ! s ! c --we know it's dec1
|
||||
};
|
||||
ten => \\_,s,c => Al ! s + xams + m_pl ! Indef ! c
|
||||
NCard => table {
|
||||
Masc => \\s,c => (sing wAhid) ! s ! c ;
|
||||
--all fem are first declension:
|
||||
Fem => \\s,c => Al ! s + wAhida + dec1sg ! s ! c
|
||||
};
|
||||
NOrd => table {
|
||||
Masc => \\s,c => Al ! s + awwal + dec1sg ! s ! c;
|
||||
Fem => \\s,c => (sing Ula) ! s ! c
|
||||
}
|
||||
};
|
||||
ten => table {
|
||||
NCard => \\_,s,c => Al ! s + wAhid + m_pl ! Indef ! c;
|
||||
NOrd => \\_,s,c => Al ! s + awwal + m_pl ! Indef ! c
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
num3_10 : Str ->{ s : DForm => Gender => State => Case => Str ;
|
||||
n : Size } =
|
||||
\xams ->
|
||||
num1_10 xams ** { n = ThreeTen };
|
||||
num3_10 : Str -> Str -> { s : DForm => CardOrd => Gender
|
||||
=> State => Case => Str ; n : Size } =
|
||||
\xams,xAmis ->
|
||||
regNum xams xAmis ** { n = ThreeTen };
|
||||
|
||||
num2 : { s : DForm => Gender => State => Case => Str} =
|
||||
num2 : { s : DForm => CardOrd => Gender => State => Case => Str} =
|
||||
{ s = table {
|
||||
unit =>
|
||||
table {
|
||||
Masc => \\s,c => Al ! s + "ٱِثن" + dl ! s ! c ;
|
||||
Fem => \\s,c => Al ! s + "ٱِثنَت" + dl ! s ! c
|
||||
unit => table {
|
||||
NCard => table {
|
||||
Masc => \\s,c => Al ! s + "ٱِثن" + dl ! s ! c ;
|
||||
Fem => \\s,c => Al ! s + "ٱِثنَت" + dl ! s ! c
|
||||
};
|
||||
NOrd => table {
|
||||
Masc => \\s,c => Al ! s + "ثان" + dec2sg ! s ! c ;
|
||||
Fem => \\s,c => Al ! s + "ثانِيَة" + dec1sg ! s ! c
|
||||
}
|
||||
};
|
||||
ten => \\_,s,c => Al ! s + "عِشر" + m_pl ! Indef ! c
|
||||
ten => \\_,_,s,c => Al ! s + "عِشر" + m_pl ! Indef ! c
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -58,7 +58,9 @@ concrete SentenceAra of Sentence = CatAra ** open
|
||||
case o of {
|
||||
Verbal =>
|
||||
case <vp.obj.a.isPron, np.a.isPron> of {
|
||||
-- ya2kuluhu
|
||||
<False,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p);
|
||||
-- ya2kuluhu al-waladu, yakuluhu al-2awlaadu
|
||||
<False,False> => (vStr t p) ++ np.s ! Nom ++ vp.obj.s ++ vp.s2 ++ (pred t p);
|
||||
<True,False> => (vStr t p) ++ vp.obj.s ++ np.s ! Nom ++ vp.s2 ++ (pred t p);
|
||||
<True,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p)
|
||||
|
||||
@@ -7,7 +7,8 @@ concrete StructuralAra of Structural = CatAra **
|
||||
above_Prep = ss "فَوْقَ" ;
|
||||
after_Prep = ss "بَعْدَ" ;
|
||||
all_Predet = mkPredet "كُلّ" True ;
|
||||
-- almost_AdA, almost_AdN = ss "َلمْست" ;
|
||||
almost_AdA = ss "تَقْرِيباً";
|
||||
almost_AdN = ss "حَوَالي" ; -- or "تَقرِيبا"
|
||||
-- although_Subj = ss "َلتهُْغه" ;
|
||||
-- always_AdV = ss "َلوَيس" ;
|
||||
and_Conj = ss "وَ" ** {n = Pl} ;
|
||||
@@ -26,14 +27,14 @@ concrete StructuralAra of Structural = CatAra **
|
||||
-- } ;
|
||||
during_Prep = ss "خِلَالَ" ;
|
||||
-- either7or_DConj = sd2 "ِتهر" "ْر" ** {n = Sg} ;
|
||||
-- everybody_NP = regNP "ثريبْدي" Sg ;
|
||||
everybody_NP = regNP "الجَمِيع" Pl ;
|
||||
every_Det = mkDet "كُلّ" Sg Const ;
|
||||
-- everything_NP = regNP "ثريتهِنغ" Sg ;
|
||||
everything_NP = regNP "كُلّ" Sg ;
|
||||
-- everywhere_Adv = ss "ثريوهري" ;
|
||||
few_Det = mkDet "بَعض" Pl Const ;
|
||||
-- first_Ord = ss "فِرست" ;
|
||||
from_Prep = ss "مِنَ" ;
|
||||
he_Pron = mkNP "هُوَ" "هُ" "هُ" (Per3 Masc Sg) ;
|
||||
he_Pron = mkPron "هُوَ" "هُ" "هُ" (Per3 Masc Sg) ;
|
||||
here_Adv = ss "هُنا" ;
|
||||
-- here7to_Adv = ss ["تْ هري"] ;
|
||||
-- here7from_Adv = ss ["فرْم هري"] ;
|
||||
@@ -41,9 +42,9 @@ concrete StructuralAra of Structural = CatAra **
|
||||
-- how8many_IDet = mkDeterminer Pl ["هْو مَني"] ;
|
||||
-- if_Subj = ss "ِف" ;
|
||||
in8front_Prep = ss "مُقَابِلَ" ;
|
||||
i_Pron = mkNP "أَنَا" "نِي" "ِي" (Per1 Sing);
|
||||
i_Pron = mkPron "أَنَا" "نِي" "ِي" (Per1 Sing);
|
||||
in_Prep = ss "فِي" ;
|
||||
-- it_Pron = mkNP "ِت" "ِت" "ِتس" Sg P3 ;
|
||||
-- it_Pron = mkPron "ِت" "ِت" "ِتس" Sg P3 ;
|
||||
-- less_CAdv = ss "لسّ" ;
|
||||
many_Det = mkDet "جَمِيع" Pl Const ;
|
||||
-- more_CAdv = ss "مْري" ;
|
||||
@@ -64,31 +65,31 @@ concrete StructuralAra of Structural = CatAra **
|
||||
-- please_Voc = ss "ةلَسي" ;
|
||||
possess_Prep = ss "ل" ;
|
||||
-- quite_Adv = ss "قُِتي" ;
|
||||
-- she_Pron = mkNP "سهي" "هر" "هر" Sg P3 ;
|
||||
she_Pron = mkPron "هِيَ" "ها" "ها" (Per3 Fem Sg) ;
|
||||
-- so_AdA = ss "سْ" ;
|
||||
-- somebody_NP = regNP "سْمبْدي" Sg ;
|
||||
somebody_NP = regNP "أَحَد" Sg ;
|
||||
someSg_Det = mkDet "أَحَد" Pl Const ;
|
||||
somePl_Det = mkDet "بَعض" Pl Const ;
|
||||
-- something_NP = regNP "سْمتهِنغ" Sg ;
|
||||
something_NP = regNP "شَيْء" Sg ;
|
||||
-- somewhere_Adv = ss "سْموهري" ;
|
||||
that_Quant = mkQuant3 "ذَلِكَ" "تِلكَ" "أُلٱِكَ" Def;
|
||||
-- that_NP = regNP "تهَت" Sg ;
|
||||
that_NP = indeclNP "ذَلِكَ" Sg ;
|
||||
there_Adv = ss "هُناك" ;
|
||||
-- there7to_Adv = ss "تهري" ;
|
||||
-- there7from_Adv = ss ["فرْم تهري"] ;
|
||||
-- therefore_PConj = ss "تهرفْري" ;
|
||||
-- these_NP = regNP "تهسي" Pl ;
|
||||
they_Pron = mkNP "هُمْ" "هُمْ" "هُمْ" (Per3 Masc Pl) ;
|
||||
these_NP = indeclNP "هَؤُلَاء" Pl ;
|
||||
they_Pron = mkPron "هُمْ" "هُمْ" "هُمْ" (Per3 Masc Pl) ;
|
||||
this_Quant = mkQuant7 "هَذا" "هَذِهِ" "هَذَان" "هَذَيْن" "هَاتَان" "هَاتَيْن" "هَؤُلَاء" Def;
|
||||
-- this_NP = regNP "تهِس" Sg ;
|
||||
-- those_NP = regNP "تهْسي" Pl ;
|
||||
this_NP = indeclNP "هَذا" Sg ;
|
||||
those_NP = indeclNP "هَؤُلَاءكَ" Pl ;
|
||||
through_Prep = ss "عَبْرَ" ;
|
||||
-- too_AdA = ss "تّْ" ;
|
||||
to_Prep = ss "إِلى" ;
|
||||
under_Prep = ss "تَحْتَ" ;
|
||||
-- very_AdA = ss "ثري" ;
|
||||
-- want_VV = P.mkVV (P.regV "وَنت") ;
|
||||
we_Pron = mkNP "نَحنُ" "نا" "نا" (Per1 Plur) ;
|
||||
we_Pron = mkPron "نَحنُ" "نا" "نا" (Per1 Plur) ;
|
||||
whatPl_IP = mkIP "ماذا" Pl ;
|
||||
whatSg_IP = mkIP "ماذا" Sg ;
|
||||
when_IAdv = ss "مَتَى" ;
|
||||
@@ -102,8 +103,8 @@ concrete StructuralAra of Structural = CatAra **
|
||||
without_Prep = ss "بِدُونِ" ;
|
||||
with_Prep = ss "مَع" ;
|
||||
yes_Phr = ss "نَعَم" ;
|
||||
youSg_Pron = mkNP "أَنتَ" "كَ" "كَ" (Per2 Masc Sg) ;
|
||||
youPl_Pron = mkNP "أَنتُمْ" "كُمْ" "كُمْ" (Per2 Masc Sg) ;
|
||||
youPol_Pron = mkNP "أَنتِ" "كِ" "كِ" (Per2 Fem Sg) ;
|
||||
youSg_Pron = mkPron "أَنتَ" "كَ" "كَ" (Per2 Masc Sg) ;
|
||||
youPl_Pron = mkPron "أَنتُمْ" "كُمْ" "كُمْ" (Per2 Masc Sg) ;
|
||||
youPol_Pron = mkPron "أَنتِ" "كِ" "كِ" (Per2 Fem Sg) ;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user