From 7bf0ea6bf13484bd64cfb816ae739bdbf00b2b8a Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 27 Jun 2008 06:44:34 +0000 Subject: [PATCH] hacks to make Arabic compile on GF3 --- lib/resource/arabic/ParadigmsAra.gf | 34 ++++++++++++++++++++++++++++- lib/resource/arabic/ResAra.gf | 7 +++--- lib/resource/arabic/SentenceAra.gf | 3 ++- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/lib/resource/arabic/ParadigmsAra.gf b/lib/resource/arabic/ParadigmsAra.gf index 1d41b4f3e..bc9d498a5 100644 --- a/lib/resource/arabic/ParadigmsAra.gf +++ b/lib/resource/arabic/ParadigmsAra.gf @@ -160,7 +160,7 @@ resource ParadigmsAra = open mkV0 : V -> V0 ; mkVS : V -> VS ; mkV2S : V -> Str -> V2S ; - mkVV : V -> VV ; +-- mkVV : V -> VV ; mkV2V : V -> Str -> Str -> V2V ; mkVA : V -> VA ; mkV2A : V -> Str -> V2A ; @@ -187,6 +187,8 @@ resource ParadigmsAra = open -- The definitions should not bother the user of the API. So they are -- hidden from the document. +{- +-- AED's original definition of regV regV = \word -> 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) 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 -> let { raw = v1' rootStr vPerf vImpf } in diff --git a/lib/resource/arabic/ResAra.gf b/lib/resource/arabic/ResAra.gf index a7ecb64ee..152da5f4d 100644 --- a/lib/resource/arabic/ResAra.gf +++ b/lib/resource/arabic/ResAra.gf @@ -91,7 +91,7 @@ resource ResAra = PatternsAra ** open Prelude, Predef in { case of { 6 | 5 => mkWeak pat rS ; --3=> 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 = \word -> case word of { - lemma + "ِي" => \\s,c => Al ! s + lemma + dec2sg ! s ! c ; - lemma + ("ا"|"ى") => \\s,c => Al ! s + word + dec3sg ! s ! c ; +---- the first case gives compiler error in gf3, AR 27/6/2008 +---- 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 }; diff --git a/lib/resource/arabic/SentenceAra.gf b/lib/resource/arabic/SentenceAra.gf index 951b07640..33becd26b 100644 --- a/lib/resource/arabic/SentenceAra.gf +++ b/lib/resource/arabic/SentenceAra.gf @@ -57,7 +57,8 @@ concrete SentenceAra of Sentence = CatAra ** open } in case o of { Verbal => - case of { + case of { +----AR case of { -- ya2kuluhu => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p); -- ya2kuluhu al-waladu, yakuluhu al-2awlaadu