From 38852ee672dd61e01e12c38065a22ac3012f0390 Mon Sep 17 00:00:00 2001 From: odanoburu Date: Fri, 11 May 2018 15:57:35 -0300 Subject: [PATCH 1/2] (Por) improve mkV - regV with more cases - separate one instance of mkA into an oper --- src/portuguese/ParadigmsPor.gf | 42 ++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/portuguese/ParadigmsPor.gf b/src/portuguese/ParadigmsPor.gf index 072b1d223..f985f61e9 100644 --- a/src/portuguese/ParadigmsPor.gf +++ b/src/portuguese/ParadigmsPor.gf @@ -219,6 +219,8 @@ oper } ; isPre = a.isPre ; lock_A = <>} ; + mkNonInflectA : A -> Str -> A ; + mkNonInflectA = \blanco,hueso -> blanco ** {s = \\x,y => blanco.s ! x ! y ++ hueso } ; mkA = overload { @@ -243,7 +245,7 @@ oper = mkADeg ; mkA : (blanco : A) -> (hueso : Str) -> A -- noninflecting component after the adjective - = \blanco,hueso -> blanco ** {s = \\x,y => blanco.s ! x ! y ++ hueso } ; + = mkNonInflectA ; } ; -- The functions above create postfix adjectives. To switch them to @@ -287,32 +289,38 @@ oper --2 Verbs regV : Str -> V ; - regV v = -- cortar actuar cazar guiar pagar sacar + regV v = let xr = Predef.dp 2 v ; -- -ar z = Predef.dp 1 (Predef.tk 2 v) ; -- i in -iar - verb = case xr of { + paradigm = case xr of { "ir" => case z of { - "g" => redigir_52 v ; - "a" => sair_68 v ; - "u" => distribuir_73 v ; - _ => garantir_6 v + "g" => redigir_52 ; + "a" => sair_68 ; + "u" => distribuir_73 ; + _ => garantir_6 } ; "er" => case z of { - "c" => aquecer_25 v ; - _ => vender_5 v + "c" => aquecer_25 ; + "g" => proteger_26 ; + "o" => moer_28 ; + _ => vender_5 } ; "ar" => case z of { - "e" => recear_15 v ; - "i" => anunciar_16 v ; - "o" => perdoar_20 v ; - "u" => averiguar_21 v ; - _ => comprar_4 v + "c" => ficar_12 ; + "ç" => começar_13 ; + "e" => recear_15 ; + "g" => chegar_14 ; + "i" => anunciar_16 ; + "j" => viajar_r22 ; + "o" => perdoar_20 ; + "u" => suar_r37 ; + _ => comprar_4 } ; - "or" => pôr_45 v ; - _ => comprar_4 v -- hole + "or" | "ôr" => pôr_45 ; + _ => comprar_4 -- hole } - in verboV verb ; + in verboV (paradigm v) ; {- regAltV : (mostrar,muestro : Str) -> V ; regAltV x y = case x of { From 9544bd8e6b66e0c5e95ddecd17d995de942730f6 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Sat, 12 May 2018 17:41:12 +0200 Subject: [PATCH 2/2] CompoundN in ExtendSwe and ExtendBul --- src/bulgarian/AllBul.gf | 7 +++---- src/bulgarian/AllBulAbs.gf | 5 ++--- src/bulgarian/ExtendBul.gf | 18 ++++++++++++++++++ src/swedish/ExtendSwe.gf | 9 +++++++-- 4 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 src/bulgarian/ExtendBul.gf diff --git a/src/bulgarian/AllBul.gf b/src/bulgarian/AllBul.gf index 90166354a..f09706202 100644 --- a/src/bulgarian/AllBul.gf +++ b/src/bulgarian/AllBul.gf @@ -1,9 +1,8 @@ --# -path=.:../abstract:../common:../prelude:../api ---# -coding=cp1251 -concrete AllBul of AllBulAbs = +concrete AllBul of AllBulAbs = LangBul, - ExtraBul + ExtendBul ** { - flags coding=cp1251 ; + } ; diff --git a/src/bulgarian/AllBulAbs.gf b/src/bulgarian/AllBulAbs.gf index 07e88d53e..3aa4604d7 100644 --- a/src/bulgarian/AllBulAbs.gf +++ b/src/bulgarian/AllBulAbs.gf @@ -1,9 +1,8 @@ --# -path=.:../abstract:../common:prelude ---# -coding=cp1251 abstract AllBulAbs = Lang, - ExtraBulAbs + Extend ** { - flags coding=cp1251 ; + } ; diff --git a/src/bulgarian/ExtendBul.gf b/src/bulgarian/ExtendBul.gf new file mode 100644 index 000000000..7d51c5725 --- /dev/null +++ b/src/bulgarian/ExtendBul.gf @@ -0,0 +1,18 @@ +--# -path=.:../abstract:../common:prelude +concrete ExtendBul of Extend = CatBul ** open ResBul in { + +lin + CompoundN n1 n2 = + let aform = ASg (case n2.g of { + AMasc _ => Masc ; + AFem => Fem ; + ANeut => Neut + }) Indef + in { + s = \\nf => n1.rel ! nform2aform nf n2.g ++ n2.s ! (indefNForm nf) ; + rel = \\af => n1.rel ! aform ++ n2.s ! NF Sg Indef ; + g = n2.g + } ; + +} + diff --git a/src/swedish/ExtendSwe.gf b/src/swedish/ExtendSwe.gf index 2ae788b73..4ba2eff16 100644 --- a/src/swedish/ExtendSwe.gf +++ b/src/swedish/ExtendSwe.gf @@ -8,7 +8,8 @@ concrete ExtendSwe of Extend = CatSwe ** MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, ICompAP, RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP, - Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP + Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, + CompoundN ] with (Grammar = GrammarSwe) ** @@ -143,6 +144,10 @@ concrete ExtendSwe of Extend = CatSwe ** Cons_rr_RNP x xs = consrTable Agr comma x xs ; Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ; - + CompoundN n1 n2 = { + s = \\n,s,c => n1.co ++ BIND ++ n2.s ! n ! s ! c ; + co = n1.co ++ BIND ++ n2.co ; + g = n2.g + } ; }