From 6aafb6ccbb427803cc22593094b45fb9c7ba240f Mon Sep 17 00:00:00 2001 From: "john.j.camilleri" Date: Mon, 24 Jun 2013 09:37:39 +0000 Subject: [PATCH] Maltese RG: small fixes; moved Maybe to ../prelude --- lib/src/maltese/AllMlt.gf | 8 ++--- lib/src/maltese/DictMlt.gf | 6 ++-- lib/src/maltese/LexiconMlt.gf | 2 +- lib/src/maltese/Maybe.gf | 55 ----------------------------------- lib/src/maltese/MorphoMlt.gf | 18 ++++++++---- lib/src/maltese/ResMlt.gf | 16 +++++++--- 6 files changed, 30 insertions(+), 75 deletions(-) delete mode 100644 lib/src/maltese/Maybe.gf diff --git a/lib/src/maltese/AllMlt.gf b/lib/src/maltese/AllMlt.gf index d5e6b8d94..3d766ddfb 100644 --- a/lib/src/maltese/AllMlt.gf +++ b/lib/src/maltese/AllMlt.gf @@ -10,10 +10,6 @@ concrete AllMlt of AllMltAbs = LangMlt, IrregMlt, ExtraMlt - ** {} ; + ** { -{- - IrregMlt-[ - blow_V,burn_V,come_V,dig_V,fall_V,fly_V,freeze_V,go_V,lie_V,run_V, - sew_V,sing_V,sit_V,sleep_V,spit_V,stand_V,swell_V,swim_V,think_V], --} +} ; diff --git a/lib/src/maltese/DictMlt.gf b/lib/src/maltese/DictMlt.gf index 25d6a9eb2..517074f1c 100644 --- a/lib/src/maltese/DictMlt.gf +++ b/lib/src/maltese/DictMlt.gf @@ -1730,7 +1730,7 @@ concrete DictMlt of DictMltAbs = CatMlt ** open ParadigmsMlt in { tharrek_HRK_5_8364_V = mkV_V "tħarrek" (mkRoot "ħ-r-k") ; horom_HRM_1_8365_V = mkV "ħorom" (mkRoot "ħ-r-m") ; harrem_HRM_2_8366_V = mkV_II "ħarrem" (mkRoot "ħ-r-m") ; - haraq_HRQ_1_8367_V = pastPartV "maħruq" (mkV "ħaraq" (mkRoot "ħ-r-q")) ; + haraq_HRQ_1_8367_V = pastPartV "maħruq" (mkV "ħaraq" "aħraq" (mkRoot "ħ-r-q")) ; harraq_HRQ_2_8368_V = mkV_II "ħarraq" (mkRoot "ħ-r-q") ; tharraq_HRQ_5_8369_V = mkV_V "tħarraq" (mkRoot "ħ-r-q") ; nharaq_HRQ_7_8370_V = mkV_VII "ħaraq" "nħaraq" (mkRoot "ħ-r-q") ; @@ -2341,7 +2341,7 @@ concrete DictMlt of DictMltAbs = CatMlt ** open ParadigmsMlt in { niffed_NFD_2_8963_V = mkV_II "niffed" (mkRoot "n-f-d") ; tniffed_NFD_5_8964_V = mkV_V "tniffed" (mkRoot "n-f-d") ; ntnifed_NFD_7_8965_V = mkV_VII "nifed" "ntnifed" (mkRoot "n-f-d") ; - nefah_NFH_1_8966_V = pastPartV "minfuħ" (mkV "nefaħ" (mkRoot "n-f-ħ")) ; + nefah_NFH_1_8966_V = pastPartV "minfuħ" (mkV "nefaħ" "onfoħ" (mkRoot "n-f-ħ")) ; neffah_NFH_2_8967_V = mkV_II "neffaħ" (mkRoot "n-f-ħ") ; tneffah_NFH_5_8968_V = mkV_V "tneffaħ" (mkRoot "n-f-ħ") ; ntnefah_NFH_7_8969_V = mkV_VII "nefaħ" "ntnefaħ" (mkRoot "n-f-ħ") ; @@ -3151,7 +3151,7 @@ concrete DictMlt of DictMltAbs = CatMlt ** open ParadigmsMlt in { sarrar_SRR_2_9763_V = mkV_II "sarrar" (mkRoot "s-r-r") ; ssarrar_SRR_5_9764_V = mkV_V "ssarrar" (mkRoot "s-r-r") ; nsarr_SRR_7_9765_V = mkV_VII "sarr" "nsarr" (mkRoot "s-r-r") ; - sata'_STGH_1_9766_V = mkV "sata'" (mkRoot "s-t-għ") ; + sata'_STGH_1_9766_V = mkV "seta'" (mkRoot "s-t-għ") ; settah_STH_2_9767_V = mkV_II "settaħ" (mkRoot "s-t-ħ") ; ssettah_STH_5_9768_V = mkV_V "ssettaħ" (mkRoot "s-t-ħ") ; satar_STR_1_9769_V = mkV "satar" (mkRoot "s-t-r") ; diff --git a/lib/src/maltese/LexiconMlt.gf b/lib/src/maltese/LexiconMlt.gf index d9bd1f82d..1cc27ee0a 100644 --- a/lib/src/maltese/LexiconMlt.gf +++ b/lib/src/maltese/LexiconMlt.gf @@ -193,7 +193,7 @@ concrete LexiconMlt of Lexicon = CatMlt ** war_N = mkN "gwerra" "gwerrer" ; water_N = mkN "ilma" "ilmijiet" masculine ; wife_N = mkN "mara" "nisa" ; - wind_N = mkN "riħ" "rjieħ" "rjiħat" ; + wind_N = mkN "riħ" "rjieħ" ; window_N = mkN "tieqa" "twieqi" ; wine_N = mkNColl "nbid" "nbejjed" ; wing_N = mkN "ġewnaħ" "ġwienaħ" ; diff --git a/lib/src/maltese/Maybe.gf b/lib/src/maltese/Maybe.gf deleted file mode 100644 index 52c9c6427..000000000 --- a/lib/src/maltese/Maybe.gf +++ /dev/null @@ -1,55 +0,0 @@ -{- - Maybe type, modelled on Haskell - John J. Camilleri --} -resource Maybe = open Prelude, Predef in { - - oper - - -- Constructors - Maybe : (t : Type) -> Type = \t -> { - inner : t ; - exists : Bool - } ; - Just : (T : Type) -> T -> Maybe T = \_,t -> { - inner = t ; - exists = True - } ; - -- Nothing : (T : Type) -> Maybe T = \_ -> { - -- inner = variants {} ; - -- exists = False - -- } ; - Nothing : (T : Type) -> T -> Maybe T = \_,t -> { - inner = t ; - exists = False - } ; - - -- Functions - exists : (T : Type) -> Maybe T -> Bool = \_,m -> m.exists ; - fromJust : (T : Type) -> Maybe T -> T = \_,m -> case m.exists of { - True => m.inner ; - False => Predef.error "Called fromJust with Nothing" - } ; - fromMaybe : (T : Type) -> T -> Maybe T -> T = \_,n,m -> case m.exists of { - True => m.inner ; - False => n - } ; - - -- Instance with Str, since it's common - MaybeS = Maybe Str ; - JustS : Str -> Maybe Str = \r -> Just Str r ; - -- NothingS : Maybe Str = Nothing Str ; - NothingS : Maybe Str = Nothing Str "" ; - - existsS : Maybe Str -> Bool = exists Str ; - fromJustS : Maybe Str -> Str = fromJust Str ; - fromMaybeS : Str -> Maybe Str -> Str = fromMaybe Str ; - - -- Example - -- j : MaybeS = JustS "hello" ; - -- n : MaybeS = NothingS ; - -- s : Str = fromJustS j; - -- b : Bool = existsS j ; - -- r : Str = if_then_Str (existsS j) ("present") ("not present") ; - -} diff --git a/lib/src/maltese/MorphoMlt.gf b/lib/src/maltese/MorphoMlt.gf index 54ea2d784..832ea4f41 100644 --- a/lib/src/maltese/MorphoMlt.gf +++ b/lib/src/maltese/MorphoMlt.gf @@ -110,10 +110,10 @@ resource MorphoMlt = ResMlt ** open Prelude in { vowelChangesStrong : Pattern -> (Number => Pattern) = \patt -> table { Sg => case of { - <"a","a"> => mkPattern "o" "o" ; -- RABAT > ORBOT (but: ITLOB, ILGĦAB, AĦBAT) + <"a","a"> => mkPattern "o" "o" ; -- RABAT > ORBOT (but: ILGĦAB, AĦBAT) <"a","e"> => mkPattern "a" "e" ; -- GĦAMEL > AGĦMEL <"e","e"> => mkPattern "i" "e" ; -- FEHEM > IFHEM - <"e","a"> => mkPattern "i" "a" ; -- FETAĦ > IFTAĦ + <"e","a"> => mkPattern "i" "a" ; -- FETAĦ > IFTAĦ (but: ONFOĦ) <"i","e"> => mkPattern "i" "e" ; -- KITEB > IKTEB <"o","o"> => mkPattern "o" "o" -- GĦOĠOB > OGĦĠOB }; @@ -168,7 +168,7 @@ resource MorphoMlt = ResMlt ** open Prelude in { vowelChangesLiquidMedial : Pattern -> (Number => Pattern) = \patt -> table { Sg => case of { - <"a","a"> => mkPattern "i" "o" ; -- TALAB > ITLOB + <"a","a"> => mkPattern "i" "o" ; -- TALAB > ITLOB but ĦARAQ > AĦRAQ <"a","e"> => mkPattern "o" "o" ; -- ĦAREĠ > OĦROĠ <"e","e"> => mkPattern "e" "e" ; -- ĦELES > EĦLES <"e","a"> => mkPattern "i" "o" ; -- ŻELAQ > IŻLOQ @@ -233,13 +233,19 @@ resource MorphoMlt = ResMlt ** open Prelude in { -- Params: Root, Pattern conjAssimilativePerf : Root -> Pattern -> (VAgr => Str) = \root,patt -> let - wasal = root.C1 + patt.V1 + root.C2 + patt.V2 + root.C3 ; + wasal = case root.C3 of { + "għ" => root.C1 + patt.V1 + root.C2 + patt.V2 + "j" ; + _ => root.C1 + patt.V1 + root.C2 + patt.V2 + root.C3 + } ; wasl = root.C1 + patt.V1 + root.C2 + root.C3 ; in table { AgP1 Sg => wasal + "t" ; -- Jiena WASALT AgP2 Sg => wasal + "t" ; -- Inti WASALT - AgP3Sg Masc=> wasal ; -- Huwa WASAL + AgP3Sg Masc=> case root.C3 of { + "għ" => root.C1 + patt.V1 + root.C2 + patt.V2 + "'" ; -- Huwa WAQA' + _ => wasal -- Huwa WASAL + } ; AgP3Sg Fem => wasl + "et" ; -- Hija WASLET AgP1 Pl => wasal + "na" ; -- Aħna WASALNA AgP2 Pl => wasal + "tu" ; -- Intom WASALTU @@ -254,7 +260,7 @@ resource MorphoMlt = ResMlt ** open Prelude in { -- Params: Root, Pattern conjAssimilativeImp : Root -> Pattern -> (Number => Str) = \root,patt -> table { - Sg => patt.V1 + root.C2 + patt.V2 + root.C3 ; -- Inti: ASAL + Sg => patt.V1 + root.C2 + patt.V2 + case root.C3 of { "għ" => "'" ; _ => root.C3 } ; -- Inti: ASAL Pl => patt.V1 + root.C2 + root.C3 + "u" -- Intom: ASLU } ; diff --git a/lib/src/maltese/ResMlt.gf b/lib/src/maltese/ResMlt.gf index b78368b56..23e733eb0 100644 --- a/lib/src/maltese/ResMlt.gf +++ b/lib/src/maltese/ResMlt.gf @@ -489,10 +489,12 @@ resource ResMlt = ParamX ** open Prelude, Predef, Maybe in { ftahn + "a" => ftahn + "ie" ; fet + h@#Cns + "et" => fet + h + "it" ; fet + "aħ" => fet + "ħ" ; + qat + "a'" => qat + "a" ; -- waqa' -> ma waqax _ => s } ; ftahni : Str = case s of { ftahn + "a" => ftahn + "i" ; + qat + "a'" => qat + "agħ" ; _ => ftahnie } ; in { @@ -504,10 +506,15 @@ resource ResMlt = ParamX ** open Prelude, Predef, Maybe in { jiftah : Str = s ; jifth : Str = case s of { jift + "aħ" => jift + "ħ" ; + jaq + "a'" => jaq + "a" ; -- jaqa' -> ma jaqax _ => s } ; + jaqagh : Str = case s of { + jaq + "a'" => jaq + "agħ" ; + _ => jifth + } ; in { - s1 = jiftah ; s2 = jifth ; s3 = jifth ; + s1 = jiftah ; s2 = jifth ; s3 = jaqagh ; } ; -- Convert old verb form table into one with stem variants @@ -515,6 +522,7 @@ resource ResMlt = ParamX ** open Prelude, Predef, Maybe in { \\vf => case vf of { VPerf _ => stemVariantsPerf (tbl ! vf) ; VImpf _ => stemVariantsImpf (tbl ! vf) ; + VImp _ => stemVariantsImpf (tbl ! vf) ; _ => mkVerbStems (tbl ! vf) } ; @@ -591,7 +599,7 @@ resource ResMlt = ParamX ** open Prelude, Predef, Maybe in { oper - --- TEMP FUNCTION + -- Pick the correct form of a verb, adding aux pickVerbForm : {s : VForm => VerbStems} -> Tense -> Anteriority -> Polarity -> Agr -> VerbParts = \verb,tense,ant,pol,agr -> let vagr : VAgr = toVAgr agr ; @@ -920,9 +928,9 @@ resource ResMlt = ParamX ** open Prelude, Predef, Maybe in { ind = NullAgr ; } ; - -- There is no infinitive in Maltese; use perfective + -- There is no infinitive in Maltese; use imperfective infVP : VerbPhrase -> Anteriority -> Polarity -> Agr -> Str = \vp,ant,pol,agr -> - joinVP vp Past ant pol agr ++ vp.s2 ! agr ; + joinVP vp Pres ant pol agr ++ vp.s2 ! agr ; Aux = { s : Tense => Polarity => Str ;