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 } ; NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ;
Num, Ord = {s : Gender => State => Case => Str ; Num, Ord = {s : Gender => State => Case => Str ;
n : Size }; n : Size };
Predet, QuantSg, QuantPl = Predet = ResAra.Predet ;
QuantSg, QuantPl =
{s : Species => Gender => Case => Str; {s : Species => Gender => Case => Str;
n : ResAra.Number; d : State; isNum : Bool} ; n : ResAra.Number; d : State; isNum : Bool} ;
Det = ResAra.Det ; 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} ; N, N2 = ResAra.Noun ; --{s : ResAra.Number => State => Case => Str; g : Gender ; h = Species} ;
-- N2 = {s : ResAra.Number => Case => Str} ** {c2 : Str} ; -- N2 = {s : ResAra.Number => Case => Str} ** {c2 : Str} ;
N3 = ResAra.Noun ** {c2,c3 : 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 lin
airplane_N = sdfN "ط؟ر" "فاعِلة" Fem NoHum ; airplane_N = sdfN "ط؟ر" "فاعِلة" Fem NoHum ;
answer_V2S = dirV2 (v3 "جوب") ; {- answer_V2S = dirV2 (v3 "جوب") ;
apartment_N = brkN "شقّ" "فِعّة" "فِعَل" Fem NoHum ; apartment_N = brkN "شقّ" "فِعّة" "فِعَل" Fem NoHum ;
apple_N = sdfN "تفح" "فِعّالة" Fem NoHum ; apple_N = sdfN "تفح" "فِعّالة" Fem NoHum ;
art_N = brkN "فنّ" "فَعّ" "فُعُول" Masc NoHum ; art_N = brkN "فنّ" "فَعّ" "فُعُول" Masc NoHum ;
@@ -147,8 +147,8 @@ flags
paint_V2A = mkV2A (regV "يَدهَن" ) [] ; paint_V2A = mkV2A (regV "يَدهَن" ) [] ;
-- paint_V2A = mkV2A (v1 "دهن" a a ) [] ; -- paint_V2A = mkV2A (v1 "دهن" a a ) [] ;
paper_N = brkN "ورق" "فَعَلة" "أَفعال" Fem NoHum ; paper_N = brkN "ورق" "فَعَلة" "أَفعال" Fem NoHum ;
-- paris_PN = regPN "بارِيس" nonhuman ; -} paris_PN = mkPN "بارِيس" Fem NoHum ;
peace_N = brkN "سلم" "فَعال" "فَعال" Masc NoHum; --no plur {- peace_N = brkN "سلم" "فَعال" "فَعال" Masc NoHum; --no plur
pen_N = brkN "قلم" "فَعَل" "أَفعال" Masc NoHum; pen_N = brkN "قلم" "فَعَل" "أَفعال" Masc NoHum;
planet_N = mkN (reg "كَوكَب" "كَواكِب") Masc NoHum ; -- quadriconsonantal planet_N = mkN (reg "كَوكَب" "كَواكِب") Masc NoHum ; -- quadriconsonantal
plastic_N = mkN (sndf "بلاستِيك") Masc NoHum ; plastic_N = mkN (sndf "بلاستِيك") Masc NoHum ;
@@ -163,8 +163,8 @@ flags
-- rain_V0 = mkV0 (v1 "مطر" a u) ; -- rain_V0 = mkV0 (v1 "مطر" a u) ;
read_V2 = dirV2 (regV "يَقرَ؟") ; read_V2 = dirV2 (regV "يَقرَ؟") ;
-- read_V2 = dirV2 (v1 "قر؟" a a ) ; -- read_V2 = dirV2 (v1 "قر؟" a a ) ;
red_A = clrA "حمر" ; -} red_A = clrA "حمر" ;
religion_N = brkN "دين" "فِعل" "أَفعال" Masc NoHum ; {- religion_N = brkN "دين" "فِعل" "أَفعال" Masc NoHum ;
restaurant_N = brkN "طعم" "مَفعَل" "مَفاعِل" Masc NoHum ; restaurant_N = brkN "طعم" "مَفعَل" "مَفاعِل" Masc NoHum ;
river_N = brkN "نهر" "فَعل" "أَفعال" Masc NoHum ; river_N = brkN "نهر" "فَعل" "أَفعال" Masc NoHum ;
rock_N = brkN "صخر" "فَعلة" "فُعُول" Fem NoHum ; rock_N = brkN "صخر" "فَعلة" "فُعُول" Fem NoHum ;
@@ -173,7 +173,7 @@ flags
run_V = regV "يَركُض" ; run_V = regV "يَركُض" ;
-- run_V = v1 "ركض" a u ; -- run_V = v1 "ركض" a u ;
say_VS = mkVS (v1 "قول" a u) ; --check say_VS = mkVS (v1 "قول" a u) ; --check
school_N = brkN "درس" "مَسفعَلة" "مَفاعِل" Masc NoHum ; school_N = brkN "درس" "مَفعَلة" "مَفاعِل" Fem NoHum ;
science_N = brkN "علم" "فِعل" "فُعُول" Masc NoHum ; science_N = brkN "علم" "فِعل" "فُعُول" Masc NoHum ;
sea_N = brkN "بحر" "فَعل" "فُعُول" Masc NoHum ; sea_N = brkN "بحر" "فَعل" "فُعُول" Masc NoHum ;
seek_V2 = dirV2 (regV "يَطلُب") ; seek_V2 = dirV2 (regV "يَطلُب") ;
@@ -378,7 +378,7 @@ flags
tie_V2 = dirV2 (regV "يَربُط" ) ; tie_V2 = dirV2 (regV "يَربُط" ) ;
wash_V2 = dirV2 ( regV "يَغسِل" ) ; wash_V2 = dirV2 ( regV "يَغسِل" ) ;
wipe_V2 = dirV2 ( regV "يَمسَح" ) ; wipe_V2 = dirV2 ( regV "يَمسَح" ) ;
-}
-- other_A = sndA "ْتهر" ; -- other_A = sndA "ْتهر" ;
} ; } ;

View File

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

View File

@@ -22,13 +22,20 @@ concrete NounAra of Noun = CatAra ** open ResAra, Prelude in {
isPron = False } isPron = False }
}; };
-- UsePN pn = pn ** {a = agrP3 Sg} ; UsePN pn = {
s = pn.s;
a = {pgn = (Per3 pn.g Sg); isPron = False }
};
UsePron p = p ; UsePron p = p ;
--
-- PredetNP pred np = { PredetNP pred np = {
-- s = \\c => pred.s ++ np.s ! c ; s = \\c => case pred.isDecl of {
-- a = np.a True => pred.s!c ++ np.s ! Gen ; -- akvaru l-awlAdi
-- } ; False => pred.s!c ++ np.s ! c
};
a = np.a
} ;
DetSg quant ord = { DetSg quant ord = {
s = quant.s ; --++ ord.s s = quant.s ; --++ ord.s

View File

@@ -57,6 +57,8 @@ resource ParadigmsAra = open
--and species. Gives a noun whose plural is sound masculine --and species. Gives a noun whose plural is sound masculine
sdmN : Str -> Str -> Gender -> Species -> N ; sdmN : Str -> Str -> Gender -> Species -> N ;
mkPN : Str -> Gender -> Species -> PN ;
--3 Relational nouns --3 Relational nouns
mkN2 : N -> Preposition -> N2 ; mkN2 : N -> Preposition -> N2 ;
@@ -178,6 +180,7 @@ resource ParadigmsAra = open
V0, V2S, V2V, V2A, V2Q : Type ; V0, V2S, V2V, V2A, V2Q : Type ;
AS, A2S, AV, A2V : Type ; AS, A2S, AV, A2V : Type ;
--. --.
--2 Definitions of paradigms --2 Definitions of paradigms
@@ -291,7 +294,7 @@ resource ParadigmsAra = open
Preposition = Str ; Preposition = Str ;
mkN nsc gen spec = mkN nsc gen spec =
{ s = nsc; { s = nsc; --NTable
g = gen; g = gen;
h = spec; h = spec;
lock_N = <> lock_N = <>
@@ -324,11 +327,19 @@ resource ParadigmsAra = open
let { mucallim = mkWord sg root; let { mucallim = mkWord sg root;
} in mkN (sndm mucallim) gen spec; } 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} ; mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; 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 = { s =
table { table {
Nom => ana; Nom => ana;
@@ -430,4 +441,5 @@ resource ParadigmsAra = open
mkAV v = v ** {lock_A = <>} ; mkAV v = v ** {lock_A = <>} ;
mkA2V v p = mkA2 v p ** {lock_A2 = <>} ; mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
} ; } ;

View File

@@ -658,19 +658,26 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
}; };
clr : Str -> Str -> Str -> Gender => NTable = clr : Str -> Str -> Str -> Gender => NTable =
\eaHmar,HamrA',Humr -> \aHmar,HamrA',Humr ->
table { table {
Masc => reg eaHmar Humr; Masc => table {
Fem => reg HamrA' Humr 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 -- indeclinable nominal word (mamnuu3 mina S-Sarf)
--complete noun inflection table 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 = reg : Str -> Str -> NTable =
\kitAb,kutub -> \kitAb,kutub ->
table { table {
@@ -679,7 +686,6 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
Pl => sing kutub Pl => sing kutub
}; };
--takes the sound noun in singular and gives the --takes the sound noun in singular and gives the
--complete noun inflection table of sound feminine plural --complete noun inflection table of sound feminine plural
sndf : Str -> NTable = 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 --declection 2 (ends in yaa') of the singular or broken plural words
dec2sg : State => Case => Str = dec2sg : State => Case => Str =
table { table {
@@ -947,6 +961,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
isNum : Bool isNum : Bool
} ; } ;
Predet : Type = {
s : Case => Str;
isDecl : Bool
};
Agr = { pgn : PerGenNum; isPron : Bool} ; Agr = { pgn : PerGenNum; isPron : Bool} ;
AAgr = { g : Gender ; n : Number} ; AAgr = { g : Gender ; n : Number} ;

View File

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