hacks to make Arabic compile on GF3

This commit is contained in:
aarne
2008-06-27 06:44:34 +00:00
parent 334394f3ea
commit 7bf0ea6bf1
3 changed files with 39 additions and 5 deletions

View File

@@ -160,7 +160,7 @@ resource ParadigmsAra = open
mkV0 : V -> V0 ; mkV0 : V -> V0 ;
mkVS : V -> VS ; mkVS : V -> VS ;
mkV2S : V -> Str -> V2S ; mkV2S : V -> Str -> V2S ;
mkVV : V -> VV ; -- mkVV : V -> VV ;
mkV2V : V -> Str -> Str -> V2V ; mkV2V : V -> Str -> Str -> V2V ;
mkVA : V -> VA ; mkVA : V -> VA ;
mkV2A : V -> Str -> V2A ; mkV2A : V -> Str -> V2A ;
@@ -187,6 +187,8 @@ resource ParadigmsAra = open
-- The definitions should not bother the user of the API. So they are -- The definitions should not bother the user of the API. So they are
-- hidden from the document. -- hidden from the document.
{-
-- AED's original definition of regV
regV = \word -> regV = \word ->
case word of { case word of {
@@ -195,6 +197,36 @@ resource ParadigmsAra = open
"يَ" + f@_ + c@_ + "َ" + l@_ => v1 (f+c+l) a a ; "يَ" + f@_ + c@_ + "َ" + l@_ => v1 (f+c+l) a a ;
f@_ + "َ" + c@_ + "ِ" + l@_ => v1 (f+c+l) i a f@_ + "َ" + c@_ + "ِ" + l@_ => v1 (f+c+l) i a
}; };
-}
---- begin workaround for a problem with pattern matching, AR 27/6/2008
regV = \word ->
case Predef.eqStr (Predef.take 2 word) "يَ" of {
Predef.PTrue => vYa (Predef.drop 2 word) ;
_ => vCo word
};
vYa : Str -> V = \word ->
let
fcl = Predef.take 2 word + Predef.drop 3 word ;
voc = case Predef.take 1 (Predef.drop 2 word) of {
"ُ" => u ;
"ِ" => i ;
_ => a
}
in
v1 fcl a voc ;
vCo : Str -> V = \word ->
let
f = Predef.take 1 word ;
c = Predef.take 1 (Predef.drop 2 word) ;
l = Predef.drop 4 word
in
v1 (f + c + l) i a ;
---- end workaround definition
v1 = \rootStr,vPerf,vImpf -> v1 = \rootStr,vPerf,vImpf ->
let { raw = v1' rootStr vPerf vImpf } in let { raw = v1' rootStr vPerf vImpf } in

View File

@@ -91,7 +91,7 @@ resource ResAra = PatternsAra ** open Prelude, Predef in {
case <length rS : Ints 100> of { case <length rS : Ints 100> of {
6 | 5 => mkWeak pat rS ; --3=> 6 | 5 => mkWeak pat rS ; --3=>
4 | 3 => mkBilit pat (mkRoot2 rS) ; --2=> 4 | 3 => mkBilit pat (mkRoot2 rS) ; --2=>
_ => error "expected 3--6" _ => rS ---- AR error "expected 3--6"
} }
}; };
@@ -734,8 +734,9 @@ 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 ; ---- the first case gives compiler error in gf3, AR 27/6/2008
lemma + ("ا"|"ى") => \\s,c => Al ! s + word + dec3sg ! s ! c ; ---- lemma + "ِي" => \\s,c => Al ! s + lemma + dec2sg ! s ! c ;
_ + ("ا"|"ى") => \\s,c => Al ! s + word + dec3sg ! s ! c ;
_ => \\s,c => Al ! s + word + dec1sg ! s ! c _ => \\s,c => Al ! s + word + dec1sg ! s ! c
}; };

View File

@@ -57,7 +57,8 @@ concrete SentenceAra of Sentence = CatAra ** open
} in } in
case o of { case o of {
Verbal => Verbal =>
case <vp.obj.a.isPron, np.a.isPron> of { case <False, np.a.isPron> of {
----AR case <vp.obj.a.isPron, np.a.isPron> of {
-- ya2kuluhu -- ya2kuluhu
<False,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p); <False,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p);
-- ya2kuluhu al-waladu, yakuluhu al-2awlaadu -- ya2kuluhu al-waladu, yakuluhu al-2awlaadu