1
0
forked from GitHub/gf-rgl

(Ara) Added support for preposition contraction: added a "Dat" case

This commit is contained in:
Inari Listenmaa
2018-11-19 12:07:29 +01:00
parent 7a4f43aea2
commit 7b51bb6638
4 changed files with 30 additions and 26 deletions

View File

@@ -73,7 +73,7 @@ flags
door_N = brkN "بوب" "فاع" "أَفعَال" Masc NoHum ; door_N = brkN "بوب" "فاع" "أَفعَال" Masc NoHum ;
drink_V2 = dirV2 (regV "شَرِب") ; drink_V2 = dirV2 (regV "شَرِب") ;
-- drink_V2 = dirV2 (v1 "شرب" i a) ; -- drink_V2 = dirV2 (v1 "شرب" i a) ;
easy_A2V = mkA2 (sndA "سهل" "فَعل") "لِ" ; easy_A2V = mkA2 (sndA "سهل" "فَعل") datPrep ;
eat_V2 = dirV2 (mkV "ءكل" FormI) ; eat_V2 = dirV2 (mkV "ءكل" FormI) ;
empty_A = sndA "فرغ" "فاعِل" ; empty_A = sndA "فرغ" "فاعِل" ;
enemy_N = brkN "عدو" "فَعُلّ" "أَفعَاء" Masc Hum ; enemy_N = brkN "عدو" "فَعُلّ" "أَفعَاء" Masc Hum ;
@@ -203,7 +203,7 @@ flags
switch8off_V2 = dirV2 (v4 "طفء") ; switch8off_V2 = dirV2 (v4 "طفء") ;
switch8on_V2 = dirV2 (v4 "شعل") ; switch8on_V2 = dirV2 (v4 "شعل") ;
table_N = sdfN "طول" "فاعِلة" Fem NoHum ; table_N = sdfN "طول" "فاعِلة" Fem NoHum ;
talk_V3 = mkV3 (v5 "حدث") "لِ" "عَن" ; talk_V3 = mkV3 (v5 "حدث") datPrep (mkPrep "عَن") ;
teacher_N = sdmN "علم" "مُفَعِّل" Masc Hum ; --mucal~imö teacher_N = sdmN "علم" "مُفَعِّل" Masc Hum ; --mucal~imö
teach_V2 = dirV2 (v2 "علم") ; teach_V2 = dirV2 (v2 "علم") ;
television_N = mkN (sndf "تِلِفِزيُون") Masc NoHum ; television_N = mkN (sndf "تِلِفِزيُون") Masc NoHum ;

View File

@@ -34,7 +34,7 @@ flags optimize = all ;--noexpand;
case g of { case g of {
Masc => waHid; Masc => waHid;
Fem => waHida Fem => waHida
} in defArt state waHid + word + dec1sg ! state ! c; } in defArt state c waHid + word + dec1sg ! state ! c;
n = num; n = num;
d = state; d = state;
isPron = False; isPron = False;

View File

@@ -18,7 +18,8 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
Number = Sg | Dl | Pl; Number = Sg | Dl | Pl;
Gender = Masc | Fem ; Gender = Masc | Fem ;
Case = Nom | Acc | Gen Case = Nom | Acc | Gen
| Bare ; -- 1st person poss. suff. overrides case | Bare -- 1st person poss. suff. overrides case
| Dat ; -- Hack to make the preposition لِ contract
Species = NoHum | Hum ; Species = NoHum | Hum ;
State = Def | Indef | Const State = Def | Indef | Const
| Poss ; -- ة turns into ت | Poss ; -- ة turns into ت
@@ -126,6 +127,7 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
} ; } ;
noPrep : Preposition = mkPreposition [] Nom ; noPrep : Preposition = mkPreposition [] Nom ;
datPrep : Preposition = mkPreposition ("لِ" ++ BIND) Dat ;
Adj : Type = {s : AForm => Str} ; Adj : Type = {s : AForm => Str} ;
Adj2 : Type = Adj ** {c2 : Preposition} ; Adj2 : Type = Adj ** {c2 : Preposition} ;
@@ -901,7 +903,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
Bare => [] ; Bare => [] ;
Nom => "ُ"; Nom => "ُ";
Acc => "َ"; Acc => "َ";
Gen => "ِ" _Gen => "ِ" -- dat is the same as gen, except in definite before لِ
}; };
--takes the adjective lemma and gives the Posit table --takes the adjective lemma and gives the Posit table
@@ -931,7 +933,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
-- indeclinable nominal word (mamnuu3 mina S-Sarf) -- indeclinable nominal word (mamnuu3 mina S-Sarf)
indeclN : Str -> State => Case => Str = indeclN : Str -> State => Case => Str =
\aHmar -> \\s,c => defArt s aHmar + indecl!c; \aHmar -> \\s,c => defArt s c aHmar + indecl!c;
-- takes 2 words, singular and broken plural, and gives the -- takes 2 words, singular and broken plural, and gives the
-- complete noun inflection table -- complete noun inflection table
@@ -966,7 +968,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
-- takes a singular or broken plural word and tests the ending to -- takes a singular or broken plural word and tests the ending to
-- determine the declension and gives the corresponding inf table -- determine the declension and gives the corresponding inf table
sing : Str -> State => Case => Str = \word -> sing : Str -> State => Case => Str = \word ->
\\s,c => defArt s (case word of { \\s,c => defArt s c (case word of {
lemma + "ِيّ" => fixShd word (decNisba ! s ! c) ; lemma + "ِيّ" => fixShd word (decNisba ! s ! c) ;
lemma + "ِي" => fixShd lemma (dec2sg ! s ! c) ; lemma + "ِي" => fixShd lemma (dec2sg ! s ! c) ;
_ + ("ا"|"ى") => fixShd word (dec3sg ! s ! c) ; _ + ("ا"|"ى") => fixShd word (dec3sg ! s ! c) ;
@@ -981,7 +983,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
-- takes a singular word and tests the ending to -- takes a singular word and tests the ending to
-- determine the declension and gives the corresponding dual inf table -- determine the declension and gives the corresponding dual inf table
dual : Str -> State => Case => Str = \caSaA -> dual : Str -> State => Case => Str = \caSaA ->
\\s,c => defArt s (case caSaA of { \\s,c => defArt s c (case caSaA of {
lemma + ("ا"|"ى") => lemma + "ي" + dl ! s ! c ; lemma + ("ا"|"ى") => lemma + "ي" + dl ! s ! c ;
lemma + "ة" => lemma + "ت" + dl ! s ! c ; lemma + "ة" => lemma + "ت" + dl ! s ! c ;
_ => fixShd caSaA (dl ! s ! c) _ => fixShd caSaA (dl ! s ! c)
@@ -991,13 +993,13 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
--plural feminine table --plural feminine table
plurF : Str -> State => Case => Str = plurF : Str -> State => Case => Str =
\kalima -> \kalima ->
\\s,c => defArt s (mkAt kalima) + f_pl ! s ! c ; \\s,c => defArt s c (mkAt kalima) + f_pl ! s ! c ;
-- takes a singular word and gives the corresponding sound -- takes a singular word and gives the corresponding sound
--plural masculine table. FIXME: consider declension 3 --plural masculine table. FIXME: consider declension 3
plurM : Str -> State => Case => Str = plurM : Str -> State => Case => Str =
\mucallim -> \mucallim ->
\\s,c => defArt s mucallim + m_pl ! s ! c ; \\s,c => defArt s c mucallim + m_pl ! s ! c ;
-- to add the Al prefix for Definite words -- to add the Al prefix for Definite words
Al : State => Str = Al : State => Str =
@@ -1006,10 +1008,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
_ => "" _ => ""
}; };
defArt : State -> Str -> Str = \st,stem -> -- IL -- to be checked defArt : State -> Case -> Str -> Str = \st,c,stem -> -- IL -- to be checked
let al = "ال" in let al = "ال" in
case st of { case <st,c> of {
Def => <Def,Dat> => "ل" + stem ; -- only happens before the preposition لِ
<Def> =>
case stem of { case stem of {
s@#sun + x => fixShd (al + s) ("ّ" + x) ; s@#sun + x => fixShd (al + s) ("ّ" + x) ;
x => al + x } ; x => al + x } ;
@@ -1024,7 +1027,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
Bare => []; Bare => [];
Nom => "ٌ"; Nom => "ٌ";
Acc => "ً"; Acc => "ً";
Gen => "ٍ" _Gen => "ٍ"
}; };
_ => caseTbl --think of ?axU, ?axA, (the five nouns) _ => caseTbl --think of ?axU, ?axA, (the five nouns)
@@ -1033,7 +1036,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
--indeclinables (mamnuu3 mina S-Sarf) --indeclinables (mamnuu3 mina S-Sarf)
indecl : Case => Str = indecl : Case => Str =
table { table {
Gen => "َ" ; (Gen|Dat) => "َ" ;
x => caseTbl ! x x => caseTbl ! x
}; };
@@ -1284,9 +1287,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
mkPron : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn -> mkPron : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn ->
{ s = { s =
table { table {
Nom => ana;
Acc => BIND ++ nI; -- object suffix Acc => BIND ++ nI; -- object suffix
Gen => BIND ++ I; -- possessive suffix Gen => BIND ++ I; -- possessive suffix
_ => ana Dat => I -- will only be used with preposition لِ, which already has a BIND
}; };
a = {pgn = pgn; isPron = True }; a = {pgn = pgn; isPron = True };
empty = [] empty = []
@@ -1612,16 +1616,16 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
NCard => table { NCard => table {
Masc => \\s,c => (sing wAhid) ! s ! c ; Masc => \\s,c => (sing wAhid) ! s ! c ;
--all fem are first declension: --all fem are first declension:
Fem => \\s,c => defArt s wAhida + dec1sg ! s ! c Fem => \\s,c => defArt s c wAhida + dec1sg ! s ! c
}; };
NOrd => table { NOrd => table {
Masc => \\s,c => defArt s awwal + dec1sg ! s ! c; Masc => \\s,c => defArt s c awwal + dec1sg ! s ! c;
Fem => \\s,c => (sing Ula) ! s ! c Fem => \\s,c => (sing Ula) ! s ! c
} }
}; };
ten => table { ten => table {
NCard => \\_,s,c => defArt s wAhid + m_pl ! Indef ! c; NCard => \\_,s,c => defArt s c wAhid + m_pl ! Indef ! c;
NOrd => \\_,s,c => defArt s awwal + m_pl ! Indef ! c NOrd => \\_,s,c => defArt s c awwal + m_pl ! Indef ! c
} }
} }
}; };

View File

@@ -108,8 +108,8 @@ concrete StructuralAra of Structural = CatAra **
<Nom,_> => "أيُّ" ; <Nom,_> => "أيُّ" ;
<Acc,Indef> => "أيّاً" ; <Acc,Indef> => "أيّاً" ;
<Acc,_> => "أيَّ" ; <Acc,_> => "أيَّ" ;
<Gen,Indef> => "أيٍّ" ; <_Gen,Indef> => "أيٍّ" ;
<Gen,_> => "أيِّ" <_Gen,_> => "أيِّ"
} }
} ; } ;
whoSg_IP = mkIP "مَنْ" "مَنْ" Sg ; whoSg_IP = mkIP "مَنْ" "مَنْ" Sg ;