20071202_AD

This commit is contained in:
ali.eldada
2007-12-02 20:59:45 +00:00
parent e7b03c9446
commit 01e50c45e4
8 changed files with 85 additions and 35 deletions

View File

@@ -48,7 +48,8 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ;
Num, Ord = {s : Gender => State => Case => Str ;
n : Size };
Predet, QuantSg, QuantPl =
Predet = ResAra.Predet ;
QuantSg, QuantPl =
{s : Species => Gender => Case => Str;
n : ResAra.Number; d : State; isNum : Bool} ;
Det = ResAra.Det ;
@@ -87,6 +88,6 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
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} ;
PN = {s : Case => Str; g : Gender; h : Species} ;
}

View File

@@ -12,7 +12,7 @@ flags
lin
airplane_N = sdfN "ط؟ر" "فاعِلة" Fem NoHum ;
answer_V2S = dirV2 (v3 "جوب") ;
{- answer_V2S = dirV2 (v3 "جوب") ;
apartment_N = brkN "شقّ" "فِعّة" "فِعَل" Fem NoHum ;
apple_N = sdfN "تفح" "فِعّالة" Fem NoHum ;
art_N = brkN "فنّ" "فَعّ" "فُعُول" Masc NoHum ;
@@ -147,8 +147,8 @@ flags
paint_V2A = mkV2A (regV "يَدهَن" ) [] ;
-- paint_V2A = mkV2A (v1 "دهن" a a ) [] ;
paper_N = brkN "ورق" "فَعَلة" "أَفعال" Fem NoHum ;
-- paris_PN = regPN "بارِيس" nonhuman ;
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 ;
@@ -163,8 +163,8 @@ flags
-- rain_V0 = mkV0 (v1 "مطر" a u) ;
read_V2 = dirV2 (regV "يَقرَ؟") ;
-- read_V2 = dirV2 (v1 "قر؟" a a ) ;
red_A = clrA "حمر" ;
religion_N = brkN "دين" "فِعل" "أَفعال" Masc NoHum ;
-} red_A = clrA "حمر" ;
{- religion_N = brkN "دين" "فِعل" "أَفعال" Masc NoHum ;
restaurant_N = brkN "طعم" "مَفعَل" "مَفاعِل" Masc NoHum ;
river_N = brkN "نهر" "فَعل" "أَفعال" Masc NoHum ;
rock_N = brkN "صخر" "فَعلة" "فُعُول" Fem NoHum ;
@@ -173,7 +173,7 @@ flags
run_V = regV "يَركُض" ;
-- run_V = v1 "ركض" a u ;
say_VS = mkVS (v1 "قول" a u) ; --check
school_N = brkN "درس" "مَسفعَلة" "مَفاعِل" Masc NoHum ;
school_N = brkN "درس" "مَفعَلة" "مَفاعِل" Fem NoHum ;
science_N = brkN "علم" "فِعل" "فُعُول" Masc NoHum ;
sea_N = brkN "بحر" "فَعل" "فُعُول" Masc NoHum ;
seek_V2 = dirV2 (regV "يَطلُب") ;
@@ -378,7 +378,7 @@ flags
tie_V2 = dirV2 (regV "يَربُط" ) ;
wash_V2 = dirV2 ( regV "يَغسِل" ) ;
wipe_V2 = dirV2 ( regV "يَمسَح" ) ;
-}
-- other_A = sndA "ْتهر" ;
} ;

View File

@@ -3,6 +3,7 @@ resource MorphoAra = ResAra ** open Prelude in {
flags optimize = all ;--noexpand;
oper
mkDet : Str -> Number -> State -> Det
= \word,num,state ->
{ s = \\_,_,c => word + vowel ! c ;
@@ -11,6 +12,16 @@ flags optimize = all ;--noexpand;
isNum = False
};
mkPredet : Str -> Bool -> Predet
= \word,decl ->
{ s = \\c =>
case decl of {
True => word + vowel!c;
False => word
};
isDecl = decl
};
mkQuantNum : Str -> Number -> State -> {
s: Species => Gender => Case => Str; n: Number; d : State; isNum : Bool} =
\waHid,num,state ->

View File

@@ -22,13 +22,20 @@ concrete NounAra of Noun = CatAra ** open ResAra, Prelude in {
isPron = False }
};
-- UsePN pn = pn ** {a = agrP3 Sg} ;
UsePN pn = {
s = pn.s;
a = {pgn = (Per3 pn.g Sg); isPron = False }
};
UsePron p = p ;
--
-- PredetNP pred np = {
-- s = \\c => pred.s ++ np.s ! c ;
-- a = np.a
-- } ;
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
};
a = np.a
} ;
DetSg quant ord = {
s = quant.s ; --++ ord.s

View File

@@ -56,6 +56,8 @@ resource ParadigmsAra = open
--takes a root string, a singular pattern string, a gender,
--and species. Gives a noun whose plural is sound masculine
sdmN : Str -> Str -> Gender -> Species -> N ;
mkPN : Str -> Gender -> Species -> PN ;
--3 Relational nouns
@@ -178,6 +180,7 @@ resource ParadigmsAra = open
V0, V2S, V2V, V2A, V2Q : Type ;
AS, A2S, AV, A2V : Type ;
--.
--2 Definitions of paradigms
@@ -291,7 +294,7 @@ resource ParadigmsAra = open
Preposition = Str ;
mkN nsc gen spec =
{ s = nsc;
{ s = nsc; --NTable
g = gen;
h = spec;
lock_N = <>
@@ -323,12 +326,20 @@ resource ParadigmsAra = open
\root,sg,gen,spec ->
let { mucallim = mkWord sg root;
} in mkN (sndm mucallim) gen spec;
mkPN = \str,gen,species ->
{ s = \\c => str + indecl!c ;
g = gen;
h = species;
lock_PN = <>
};
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
makeNP : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn ->
mkNP : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn ->
{ s =
table {
Nom => ana;
@@ -430,4 +441,5 @@ resource ParadigmsAra = open
mkAV v = v ** {lock_A = <>} ;
mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
} ;

View File

@@ -10,7 +10,7 @@
resource ResAra = PatternsAra ** open Prelude, Predef in {
flags optimize=all ;
param
@@ -658,19 +658,26 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
};
clr : Str -> Str -> Str -> Gender => NTable =
\eaHmar,HamrA',Humr ->
\aHmar,HamrA',Humr ->
table {
Masc => reg eaHmar Humr;
Fem => reg HamrA' Humr
Masc => table {
Sg => indeclN aHmar;
Dl => dual aHmar;
Pl => sing Humr
};
Fem => table {
Sg => indeclN HamrA';
Dl => dual ((tk 2 HamrA') + "و");
Pl => sing Humr
}
};
{-in
table {
APosit _ => posit;
AComp c => posit ! Masc ! Sg ! Const ! c
};-}
--takes 2 words, singular and broken plural, and gives the
--complete noun inflection table
-- indeclinable nominal word (mamnuu3 mina S-Sarf)
indeclN : Str -> State => Case => Str =
\aHmar -> \\s,c => Al!s + aHmar + indecl!c;
-- takes 2 words, singular and broken plural, and gives the
-- complete noun inflection table
reg : Str -> Str -> NTable =
\kitAb,kutub ->
table {
@@ -679,7 +686,6 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
Pl => sing kutub
};
--takes the sound noun in singular and gives the
--complete noun inflection table of sound feminine plural
sndf : Str -> NTable =
@@ -756,6 +762,14 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
}
};
--indeclinables (mamnuu3 mina S-Sarf)
indecl : Case => Str =
table {
Nom => "ُ";
_ => "َ"
};
--declection 2 (ends in yaa') of the singular or broken plural words
dec2sg : State => Case => Str =
table {
@@ -947,6 +961,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
isNum : Bool
} ;
Predet : Type = {
s : Case => Str;
isDecl : Bool
};
Agr = { pgn : PerGenNum; isPron : Bool} ;
AAgr = { g : Gender ; n : Number} ;

View File

@@ -6,7 +6,7 @@ concrete StructuralAra of Structural = CatAra **
lin
above_Prep = ss "فَوْقَ" ;
after_Prep = ss "بَعْدَ" ;
-- all_Predet = ss "َلّ" ;
all_Predet = mkPredet "كُلّ" True ;
-- almost_AdA, almost_AdN = ss "َلمْست" ;
-- although_Subj = ss "َلتهُْغه" ;
-- always_AdV = ss "َلوَيس" ;
@@ -47,8 +47,8 @@ concrete StructuralAra of Structural = CatAra **
-- less_CAdv = ss "لسّ" ;
many_Det = mkDet "جَمِيع" Pl Const ;
-- more_CAdv = ss "مْري" ;
-- most_Predet = ss "مْست" ;
much_Det = mkDet "الكَثِير" Pl Const ;
most_Predet = mkPredet "أَكثَر" True ;
much_Det = mkDet "الكَثِير مِنَ" Pl Const ;
-- must_VV = {
-- s = table VVForm [["بي هَثي تْ"] ; "مُست" ; ["هَد تْ"] ;
-- ["هَد تْ"] ; ["هَثِنغ تْ"] ; "مُستنءت" ; ["هَدنءت تْ"]] ; ----
@@ -57,7 +57,7 @@ concrete StructuralAra of Structural = CatAra **
no_Phr = ss "لا" ;
on_Prep = ss "عَلى" ;
one_Quant = mkQuantNum "واحِد" Sg Indef ;
-- only_Predet = ss "ْنلي" ;
only_Predet = mkPredet "فَقَط" False;
-- or_Conj = ss "ْر" ** {n = Sg} ;
-- otherwise_PConj = ss "ْتهروِسي" ;
part_Prep = ss "مِنَ" ;

View File

@@ -30,7 +30,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra in {
--
-- PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ;
--
-- UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "تْ"
-- UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "تْ"
--
CompAP ap = {s = \\agr,c => ap.s ! Hum ! agr.g ! agr.n ! Indef ! c} ; --FIXME
CompNP np = {s = \\_,c => np.s ! c};