1
0
forked from GitHub/gf-rgl

(Ara) WIP assimilate def. article

This commit is contained in:
Inari Listenmaa
2018-09-26 11:12:45 +02:00
parent 31b8ef9c3f
commit 83793edc30

View File

@@ -776,7 +776,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 => Al!s + aHmar + indecl!c; \aHmar -> \\s,c => defArt s 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
@@ -813,41 +813,62 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
sing : Str -> State => Case => Str = sing : Str -> State => Case => Str =
\word -> \word ->
case word of { case word of {
lemma + "ِي" => \\s,c => Al ! s + lemma + dec2sg ! s ! c ; lemma + "ِي" => \\s,c => defArt s lemma + dec2sg ! s ! c ;
_ + ("ا"|"ى") => \\s,c => Al ! s + word + dec3sg ! s ! c ; _ + ("ا"|"ى") => \\s,c => defArt s word + dec3sg ! s ! c ;
_ => \\s,c => Al ! s + word + dec1sg ! s ! c _ => \\s,c => defArt s word + dec1sg ! s ! c
}; };
-- 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 = dual : Str -> State => Case => Str =
\caSaA -> \caSaA ->
case caSaA of { case caSaA of {
lemma + ("ا"|"ى") => \\s,c => Al ! s + lemma + "ي" + dl ! s ! c ; lemma + ("ا"|"ى") => \\s,c => defArt s lemma + "ي" + dl ! s ! c ;
_ => \\s,c => Al ! s + caSaA + dl ! s ! c _ => \\s,c => defArt s caSaA + dl ! s ! c
}; };
-- takes a singular word and gives the corresponding sound -- takes a singular word and gives the corresponding sound
--plural feminine table --plural feminine table
plurF : Str -> State => Case => Str = plurF : Str -> State => Case => Str =
\kalima -> \kalima ->
\\s,c => Al ! s + (mkAt kalima) + f_pl ! s ! c ; \\s,c => defArt s (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 => Al ! s + mucallim + m_pl ! s ! c ; \\s,c => defArt s 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 =
table { table {
Def => "ال"; Def => "ال" ;
_ => "" _ => ""
}; };
--declection 1 (strong ending) of the singular or broken plural words defArt : State -> Str -> Str = \st,stem ->
let arra = "الرَّ" ;
arri = "الرِّ" ;
arr = "الرِّ" ;
atta = "التَ" ;
atti = "التِّ";
att = "التّ" ;
al = "ال" ;
in case st of { -- TODO rest of the assimilations
Def => case stem of {
ra@"رَ" + x => arra + x ;
ri@"رِ" + x => arri + x ;
r@"ر" + x => arr + x ; -- no vowel specified
ta@"تَ" + x => atta + x ;
ti@"تِ" + x => atti + x ;
t@"ت" + x => att + x ; -- no vowel specified
_ => al + stem
} ;
_ => "" + stem
};
--declension 1 (strong ending) of the singular or broken plural words
dec1sg : State => Case => Str = dec1sg : State => Case => Str =
table { table {
Indef => Indef =>