forked from GitHub/gf-rgl
(Ara) Normalise the order of combining characters ّ + vowel
This commit is contained in:
@@ -11,6 +11,13 @@ flags coding=utf8 ;
|
||||
-- "Sun letters": assimilate with def. article
|
||||
sun : pattern Str = #("ت"|"ث"|"د"|"ذ"|"ر"|"ز"|"س"|"ش"|"ص"|"ض"|"ط"|"ظ"|"ل"|"ن") ;
|
||||
|
||||
-- Shadda: https://www.unicode.org/L2/L2017/17253-arabic-ordering.pdf
|
||||
fixShd : Str -> Str -> Str = \word,vowel ->
|
||||
case word of {
|
||||
x + "ّ" => x + vowel + "ّ" ;
|
||||
x => x + vowel
|
||||
} ;
|
||||
|
||||
-- Hamza
|
||||
hamza : pattern Str = #("ء"|"؟") ;
|
||||
|
||||
|
||||
@@ -438,7 +438,7 @@ resource ParadigmsAra = open
|
||||
|
||||
-- e.g. al-jamii3, 2a7ad
|
||||
regNP : Str -> Number -> NP = \word,n ->
|
||||
{ s = \\c => word ++ vowel ! c ; ---- gives strange chars
|
||||
{ s = \\c => fixShd word (dec1sg ! Def ! c) ;
|
||||
a = {pgn = Per3 Masc n; isPron = False };
|
||||
lock_NP = <>
|
||||
};
|
||||
|
||||
@@ -842,13 +842,12 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
|
||||
-- takes a singular or broken plural word and tests the ending to
|
||||
-- determine the declension and gives the corresponding inf table
|
||||
sing : Str -> State => Case => Str =
|
||||
\word ->
|
||||
case word of {
|
||||
lemma + "ِي" => \\s,c => defArt s lemma + dec2sg ! s ! c ;
|
||||
_ + ("ا"|"ى") => \\s,c => defArt s word + dec3sg ! s ! c ;
|
||||
_ => \\s,c => defArt s word + dec1sg ! s ! c
|
||||
};
|
||||
sing : Str -> State => Case => Str = \word ->
|
||||
\\s,c => defArt s (case word of {
|
||||
lemma + "ِي" => fixShd lemma (dec2sg ! s ! c) ;
|
||||
_ + ("ا"|"ى") => fixShd word (dec3sg ! s ! c) ;
|
||||
_ => fixShd word (dec1sg ! s ! c)
|
||||
}) ;
|
||||
|
||||
|
||||
-- takes a singular word and tests the ending to
|
||||
|
||||
Reference in New Issue
Block a user