From 1427b1bbb888c52967350d4f4b200c308aa314c6 Mon Sep 17 00:00:00 2001 From: odanoburu Date: Tue, 30 Oct 2018 13:48:26 +0000 Subject: [PATCH 1/2] (Por) change mk2A paradigm (such that the second argument is the adverb string, not the feminine form, which is easier to predict) - fix bug in adjVo paradigm - add two cases to mkAdjReg smart paradigm - update lexicon tbh, it is much more common to need to correct the adverbial form because it doesn't have the accents that the adjectival forms may have, so if there's a way of removing accents easily, that might be better. --- src/portuguese/LexiconPor.gf | 4 ++-- src/portuguese/MorphoPor.gf | 22 ++++++++++++---------- src/portuguese/ParadigmsPor.gf | 6 +++--- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/portuguese/LexiconPor.gf b/src/portuguese/LexiconPor.gf index 6fbb22d45..c23939059 100644 --- a/src/portuguese/LexiconPor.gf +++ b/src/portuguese/LexiconPor.gf @@ -10,7 +10,7 @@ flags lin easy_A2V = mkA2V (mkA "fácil") dative genitive ; married_A2 = mkA2 (mkA "casado") dative ; - probable_AS = mkAS (mkA "provável" "provável" "prováveis" "prováveis" "provavelmente") ; + probable_AS = mkAS (mkA "provável" "provavelmente") ; fun_AV = mkAV (mkA "divertido") genitive ; -- A bad_A = prefA (mkA (mkA "mau") (mkA "pior")) ; @@ -58,7 +58,7 @@ lin white_A = compADeg (mkA "branco") ; wide_A = mkA "largo" ; -- extenso yellow_A = mkA "amarelo" ; - young_A = prefA (mkA "jovem" "jovem" "jovens" "jovens" "juvenilmente") ; + young_A = prefA (mkA "jovem" "juvenilmente") ; already_Adv = mkAdv "já" ; far_Adv = mkAdv "longe" ; ----? now_Adv = mkAdv "agora" ; diff --git a/src/portuguese/MorphoPor.gf b/src/portuguese/MorphoPor.gf index 54b31b10b..e4c206042 100644 --- a/src/portuguese/MorphoPor.gf +++ b/src/portuguese/MorphoPor.gf @@ -124,16 +124,16 @@ oper } } ; - mkAdj2N : (_,_: N) -> Str -> Adj = \mascN, femN, burramente -> - {s = table { - AF Masc n => mascN.s ! n ; - AF Fem n => femN.s ! n ; - AA => burramente - } + mkAdj2 : (_,_: Str) -> Adj ; + mkAdj2 aj av = let + adj = mkAdjReg aj + in { + s = table { + AF g n => adj.s ! AF g n ; + AA => av + } } ; - mkAdjN : N -> Str -> Adj = \n, burramente -> mkAdj2N n n burramente ; - -- Then the regular and invariant patterns. adjPreto : Str -> Adj = \preto -> @@ -174,7 +174,7 @@ oper "ã" => "a" } ; alemvo : Str = alem + v + "o" ; - in mkAdj alemão alemã (alemã + "s") (alemã + "es") (alemã + "amente") ; + in mkAdj alemão alemã (alemã + "s") (alemã + "es") (alemã + "mente") ; adjEuropeu : Str -> Adj = \europeu -> let europe = init europeu in mkAdj europeu (europe + "ia") (europeu + "s") (europe + "ias") @@ -183,11 +183,13 @@ oper mkAdjReg : Str -> Adj = \a -> case a of { pret + "o" => adjPreto a ; - anarquist + v@("e" | "a") => adjUtil (anarquist + v) (anarquist + v + "s") ; + anarquist + v@("e" | "a") => adjUtil a (a + "s") ; ouvido + "r" => adjOuvidor a (ouvido + "ra") ; chin + "ês" => adjFrances a ; europ + "eu" => adjEuropeu a ; alem + "ão" => adjVo a ; + provav + v@("e" | "i") + "l" => adjUtil a (provav + "eis") ; + jove + "m" => adjUtil a (jove + "ns") ; _ => adjUtil a (a + "s") } ; diff --git a/src/portuguese/ParadigmsPor.gf b/src/portuguese/ParadigmsPor.gf index 38de771b2..6066a16b5 100644 --- a/src/portuguese/ParadigmsPor.gf +++ b/src/portuguese/ParadigmsPor.gf @@ -203,9 +203,9 @@ oper regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ; - mk2A : (espanhol,espanhola : Str) -> A ; - mk2A a b = compADeg {s = \\_ => (mkAdj2N (mkN a) (mkN b) (b + "mente")).s ; isPre = False ; - lock_A = <>} ; + mk2A : (único,unicamente : Str) -> A ; + mk2A adj adv = compADeg {s = \\_ => (mkAdj2 adj adv).s ; isPre = False ; + lock_A = <>} ; mk5A : (preto,preta,pretos,pretas,pretamente : Str) -> A ; mk5A a b c d e = compADeg {s = \\_ => (mkAdj a b c d e).s ; From 08c5914466c6785294312a81ea3542d46ad7351d Mon Sep 17 00:00:00 2001 From: odanoburu Date: Tue, 13 Nov 2018 15:46:50 -0200 Subject: [PATCH 2/2] (Por) - add AdjAsCN AdjAsNP - copied VPS functions from ExtraRomance - fixes to Lexicon --- src/abstract/Sentence.gf | 2 +- src/portuguese/ExtendPor.gf | 56 ++++++++++++++++++++++++++---------- src/portuguese/LexiconPor.gf | 4 +-- 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/src/abstract/Sentence.gf b/src/abstract/Sentence.gf index 6068223ca..fc3c760b5 100644 --- a/src/abstract/Sentence.gf +++ b/src/abstract/Sentence.gf @@ -70,7 +70,7 @@ abstract Sentence = Cat ** { -- This covers subjunctive clauses, but they can also be added to the end. - SSubjS : S -> Subj -> S -> S ; -- I go home if she comes + SSubjS : S -> Subj -> S -> S ; -- I go home, if she comes -- A sentence can be modified by a relative clause referring to its contents. diff --git a/src/portuguese/ExtendPor.gf b/src/portuguese/ExtendPor.gf index 12ab235b6..52cb8e901 100644 --- a/src/portuguese/ExtendPor.gf +++ b/src/portuguese/ExtendPor.gf @@ -4,6 +4,8 @@ concrete ExtendPor of Extend = CatPor ** ExtendFunctor - [ AdAdV, + AdjAsCN, + AdjAsNP, ApposNP, BaseVPS, ByVP, @@ -13,6 +15,7 @@ concrete ExtendPor of Extend = CompoundAP, CompoundN, CompVP, + ConjVPS, ConsVPS, --EmptyRelSlash, ExistsNP, @@ -27,11 +30,13 @@ concrete ExtendPor of Extend = ICompAP, InOrderToVP, ListVPS, + MkVPS, PassAgentVPSlash, PassVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, + PredVPS, PresPartAP, ProDrop, PurposeVP, @@ -52,13 +57,13 @@ concrete ExtendPor of Extend = with (Grammar = GrammarPor), (Syntax = SyntaxPor) ** open - GrammarPor, - ResPor, - MorphoPor, - Coordination, - Prelude, - ParadigmsPor, - (S = StructuralPor) in { + GrammarPor, + ResPor, + MorphoPor, + Coordination, + Prelude, + ParadigmsPor, + (S = StructuralPor) in { lin GenNP np = @@ -85,17 +90,28 @@ concrete ExtendPor of Extend = c = Nom } ; + ---- these come from ExtraRomance: how to avoid the repetition? + ---- can't seem to be able to use two functors lincat - VPS = {s : Agr => Mood => Str} ; - [VPS] = {s1,s2 : Agr => Mood => Str} ; --- VPI = {s : VType => Agr => Str } ; + VPS = {s : Mood => Agr => Bool => Str} ; + [VPS] = {s1,s2 : Mood => Agr => Bool => Str} ; lin - BaseVPS = twoTable2 Agr Mood ; - ConsVPS = consrTable2 Agr Mood comma ; + BaseVPS x y = twoTable3 Mood Agr Bool x y ; + ConsVPS = consrTable3 Mood Agr Bool comma ; --- MkVPS t p vp = mkVPS (lin Temp t) (lin Pol p) (lin VP vp) ; ---TODO: write mkVPS oper + PredVPS np vpi = { + s = \\m => (np.s ! Nom).comp ++ vpi.s ! m ! np.a ! np.isNeg + } ; + + MkVPS tm p vp = { + s = \\m,agr,isNeg => + tm.s ++ p.s ++ + (mkClausePol (orB isNeg vp.isNeg) [] False False agr vp).s + ! DDir ! tm.t ! tm.a ! p.p ! m + } ; + + ConjVPS = conjunctDistrTable3 Mood Agr Bool ; lin ProDrop p = { @@ -148,13 +164,23 @@ concrete ExtendPor of Extend = ComplBareVS = ComplVS ; + AdjAsCN ap = { + s =\\n => ap.s ! AF Masc n ; + g = Masc + } ; + + AdjAsNP ap = heavyNP { + s = \\_c => ap.s ! AF Masc Sg ; + a = Ag Masc Sg P3 + } ; + 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 } ; - + passVPSlash : VPSlash -> Str -> VP ; passVPSlash vps agent = let auxvp = predV auxPassive diff --git a/src/portuguese/LexiconPor.gf b/src/portuguese/LexiconPor.gf index e3900909f..699a8fa63 100644 --- a/src/portuguese/LexiconPor.gf +++ b/src/portuguese/LexiconPor.gf @@ -10,7 +10,7 @@ flags lin easy_A2V = mkA2V (mkA "fácil") dative genitive ; married_A2 = mkA2 (mkA "casado") dative ; - probable_AS = mkAS (mkA "provável" "provavelmente") ; + probable_AS = mkAS (prefA (mkA "provável" "provavelmente")) ; fun_AV = mkAV (mkA "divertido") genitive ; -- A bad_A = prefA (mkA (mkA "mau") (mkA "pior")) ; @@ -38,7 +38,7 @@ lin narrow_A = mkA "estreito" ; near_A = mkA "perto" ; new_A = prefA (mkA "novo") ; - old_A = prefA (mkA "velho") ; + old_A = prefA (mkA "velho") ; ready_A = mkA "pronto" ; red_A = mkA "vermelho" ; rotten_A = mkA "podre" ;