From 4b2c706bcdbf119d5fb9d930207f8c6a537489be Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 19 Oct 2018 17:25:25 +0200 Subject: [PATCH 1/2] (Ara) Add linref for CN + choose bare form for UttCN, no case --- src/arabic/CatAra.gf | 6 +++++- src/arabic/PhraseAra.gf | 2 +- src/arabic/ResAra.gf | 16 ++++++++++------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/arabic/CatAra.gf b/src/arabic/CatAra.gf index 759e0fd5b..3a1ee2584 100644 --- a/src/arabic/CatAra.gf +++ b/src/arabic/CatAra.gf @@ -47,7 +47,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { -- Noun - CN = ResAra.Noun ** {adj : NTable ; np : Case => Str}; + CN = ResAra.CN; NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ; Num, Ord, @@ -90,4 +90,8 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { N3 = ResAra.Noun ** {c2, c3 : Str} ; PN = {s : Case => Str; g : Gender; h : Species} ; +linref + + CN = \cn -> uttCN cn ! Masc ; + } diff --git a/src/arabic/PhraseAra.gf b/src/arabic/PhraseAra.gf index 0bc3931cb..9d24e6898 100644 --- a/src/arabic/PhraseAra.gf +++ b/src/arabic/PhraseAra.gf @@ -15,7 +15,7 @@ concrete PhraseAra of Phrase = CatAra ** open UttAP ap = {s = ResAra.uttAP ap} ; --IL UttCard c = {s = ResAra.uttNum c} ; --IL - UttCN cn = {s = \\_ => cn.s ! Sg ! Def ! Nom} ; --IL + UttCN cn = {s = ResAra.uttCN cn } ; --IL UttNP np = {s = \\_ => np.s ! Nom} ; UttVP vp = {s = \\g => (compVP vp).s ! {g=g ; n=Sg} ! Nom} ; --IL UttS, diff --git a/src/arabic/ResAra.gf b/src/arabic/ResAra.gf index 39768e9e8..bf9a37941 100644 --- a/src/arabic/ResAra.gf +++ b/src/arabic/ResAra.gf @@ -17,7 +17,7 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in { Vowel = u | a | i ; Number = Sg | Dl | Pl; Gender = Masc | Fem ; - Case = Nom | Acc | Gen + Case = Nom | Acc | Gen | Bare ; -- 1st person poss. suff. overrides case Person = P1 | P2 | P3 ; Species = NoHum | Hum ; @@ -99,7 +99,7 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in { => mkDefective pat (mkRoot3 rS) ; x@? + ("و"|"ي") + z@? => mkHollow pat (mkRoot3 rS) ; - ("و"|"ي") + y@? + z@? + ("و"|"ي") + y@? + z@? => mkAssimilated pat (mkRoot3 rS) ; ? + ? + _ => mkBilit pat (mkRoot2 rS) ; --2=> _=> error rS ---- AR error "expected 3--6" @@ -119,6 +119,10 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in { uttAP : AP -> (Gender => Str) ; uttAP ap = \\g => ap.s ! NoHum ! g ! Sg ! Def ! Nom ; ----IL + CN : Type = Noun ** {adj : NTable ; np : Case => Str}; + uttCN : CN -> (Gender => Str) ; + uttCN cn = \\_ => cn.s ! Sg ! Indef ! Bare ; + NumOrdCard : Type = { s : Gender => State => Case => Str ; n : Size ; @@ -861,11 +865,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> \\s,c => defArt s (case word of { lemma + "ِي" => fixShd lemma (dec2sg ! s ! c) ; _ + ("ا"|"ى") => fixShd word (dec3sg ! s ! c) ; - lemma + "ة" => case s of { + lemma + "ة" => case s of { Poss => lemma + "ت" + dec1sg ! s ! c ; _ => word + dec1sg ! s ! c } ; - _ => fixShd word (dec1sg ! s ! c) + _ => fixShd word (dec1sg ! s ! c) }) ; @@ -960,7 +964,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> _ => table { Nom => "َانِ"; - Bare => "َيْن"; + Bare => "َيْن"; _ => "َيْنِ" } }; @@ -975,7 +979,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> }; _ => table { - Bare => "ِين"; + Bare => "ِين"; Nom => "ُونَ"; _ => "ِينَ" } From 2d5655aa506eb48d9d92f021e70cdf535b4e1e78 Mon Sep 17 00:00:00 2001 From: bruno cuconato Date: Sun, 21 Oct 2018 17:42:05 +0000 Subject: [PATCH 2/2] (Por) Extend: add lins (#49) - add PastPartAP, PastPartAgentAP - add PassVPSlash, PassAgentVPSlash lins from ExtraRomance - correct CompoundN --- src/portuguese/ExtendPor.gf | 45 +++++++++++++++++++---------- src/portuguese/MakeStructuralPor.gf | 3 +- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/portuguese/ExtendPor.gf b/src/portuguese/ExtendPor.gf index 6719ca65d..3ee18db8f 100644 --- a/src/portuguese/ExtendPor.gf +++ b/src/portuguese/ExtendPor.gf @@ -18,7 +18,9 @@ concrete ExtendPor of Extend = iFem_Pron, ListVPS, PassVPSlash, - PassVPSlash, + PassAgentVPSlash, + PastPartAP, + PastPartAgentAP, ProDrop, theyFem_Pron, VPS, @@ -94,31 +96,42 @@ concrete ExtendPor of Extend = PrepCN prep cn = {s = prep.s ++ prepCase prep.c ++ cn.s ! Sg} ; lin - PassVPSlash vps = - let auxvp = predV copula - in - insertComplement (\\a => let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) { - s = auxvp.s ; - agr = auxvp.agr ; - neg = vps.neg ; - clit1 = vps.clit1 ; - clit2 = vps.clit2 ; - clit3 = vps.clit3 ; - isNeg = vps.isNeg ; - comp = vps.comp ; - ext = vps.ext + PastPartAP vps = pastPartAP vps [] ; + + PastPartAgentAP vps np = pastPartAP vps (let by = in by.s ++ (np.s ! by.c).ton) ; + + oper + pastPartAP : VPSlash -> Str -> AP ; + pastPartAP vps agent = lin AP { + s = \\af => vps.comp ! (aform2aagr af ** {p = P3}) ++ vps.s.s ! VPart (aform2gender af) (aform2number af) ++ agent ; + isPre = False } ; + lin + PassVPSlash vps = passVPSlash vps [] ; + + PassAgentVPSlash vps np = passVPSlash vps (let by = in by.s ++ (np.s ! by.c).ton) ; + ExistsNP np = mkClause [] True False np.a (insertComplement (\\_ => (np.s ! Nom).ton) (predV (mkV "existir"))) ; + oper + passVPSlash : VPSlash -> Str -> VP = \vps, agent -> + let auxvp = predV auxPassive + in + vps ** { + s = auxvp.s ; + agr = auxvp.agr ; + comp = \\a => vps.comp ! a ++ (let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) ++ agent ; + } ; + lin CompoundN noun noun2 = { -- order is different because that's needed for correct translation from english s = \\n => noun2.s ! n - ++ variants {genNumForms "do" "da" "dos" "das" ! noun.g ! n; "de"} - ++ noun.s ! n ; + ++ variants {"de" ; genForms "do" "da" ! noun.g} + ++ noun.s ! Sg ; g = noun2.g } ; diff --git a/src/portuguese/MakeStructuralPor.gf b/src/portuguese/MakeStructuralPor.gf index d7f714587..87ab6dc31 100644 --- a/src/portuguese/MakeStructuralPor.gf +++ b/src/portuguese/MakeStructuralPor.gf @@ -19,5 +19,4 @@ oper a = if_then_else PAgr p (PAg Sg) PNoAg ---- e,g, "chacun de"; other possibilities? } ; - -} +} ;