From fad7cf0c6fe31aa9c3bb88ccb50f089803421445 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 5 Jun 2018 11:24:12 +0200 Subject: [PATCH 01/15] (Dut) Remove MorphoDut + update change in other files --- doc/browse/index.json | 1 - src/dutch/ExtraDut.gf | 4 +- src/dutch/IdiomDut.gf | 2 +- src/dutch/MakeStructuralDut.gf | 2 +- src/dutch/MorphoDut.gf | 101 -------------------- src/dutch/ParadigmsDut.gf | 159 +------------------------------- src/translator/ExtensionsDut.gf | 2 +- src/translator/TranslateDut.gf | 2 +- 8 files changed, 8 insertions(+), 265 deletions(-) delete mode 100644 src/dutch/MorphoDut.gf diff --git a/doc/browse/index.json b/doc/browse/index.json index 4337e7a8e..631af0c8a 100644 --- a/doc/browse/index.json +++ b/doc/browse/index.json @@ -400,7 +400,6 @@ "CatDut", "ExtDut", "GrammarDut", - "MorphoDut", "NumeralDut", "StructuralDut", "IdiomDut", diff --git a/src/dutch/ExtraDut.gf b/src/dutch/ExtraDut.gf index a4ab768ba..8758a93db 100644 --- a/src/dutch/ExtraDut.gf +++ b/src/dutch/ExtraDut.gf @@ -1,5 +1,5 @@ concrete ExtraDut of ExtraDutAbs = CatDut ** - open ResDut, MorphoDut, Coordination, Prelude, IrregDut, (P = ParadigmsDut), NounDut in + open ResDut, Coordination, Prelude, IrregDut, (P = ParadigmsDut), NounDut in { flags coding=utf8 ; @@ -109,7 +109,7 @@ lin inf : Str = vp.inf.p1 ; extra : Str = vp.ext in - lin NP (MorphoDut.mkNP (vp.s.s ! VInf ++ "van" ++ compl ++ inf ++ extra ) Utr Sg) ; + lin NP (mkNP (vp.s.s ! VInf ++ "van" ++ compl ++ inf ++ extra ) Utr Sg) ; lin diff --git a/src/dutch/IdiomDut.gf b/src/dutch/IdiomDut.gf index f17bbe286..ea9524fec 100644 --- a/src/dutch/IdiomDut.gf +++ b/src/dutch/IdiomDut.gf @@ -1,5 +1,5 @@ concrete IdiomDut of Idiom = CatDut ** - open MorphoDut, (P = ParadigmsDut), IrregDut, Prelude in { + open ResDut, (P = ParadigmsDut), IrregDut, Prelude in { flags optimize=all_subs ; diff --git a/src/dutch/MakeStructuralDut.gf b/src/dutch/MakeStructuralDut.gf index f96271aa2..08ce1c7b2 100644 --- a/src/dutch/MakeStructuralDut.gf +++ b/src/dutch/MakeStructuralDut.gf @@ -1,6 +1,6 @@ --# -path=.:../common:../abstract -resource MakeStructuralDut = open CatDut, ParadigmsDut, MorphoDut, Prelude in +resource MakeStructuralDut = open CatDut, ParadigmsDut, Prelude in { --{ -- diff --git a/src/dutch/MorphoDut.gf b/src/dutch/MorphoDut.gf deleted file mode 100644 index 3894a6577..000000000 --- a/src/dutch/MorphoDut.gf +++ /dev/null @@ -1,101 +0,0 @@ ---# -path=.:../common:../../prelude --- -----1 A Simple Dutman Resource Morphology ----- ----- Aarne Ranta & Harald Hammarström 2002 -- 2006 ----- ----- This resource morphology contains definitions needed in the resource ----- syntax. To build a lexicon, it is better to use $ParadigmsDut$, which ----- gives a higher-level access to this module. --- -resource MorphoDut = ResDut ** open Prelude, (Predef=Predef) in -{ -flags coding=utf8 ; ---{ --- --- flags optimize=all ; --- ---oper --- ----- For $StructuralDut$. --- --- mkPrep : Str -> Case -> Preposition = \s,c -> --- {s = s ; c = c} ; --- --- nameNounPhrase : {s : Case => Str} -> {s : Case => Str ; a : Agr} = \name -> --- name ** {a = agrP3 Sg} ; --- --- detLikeAdj : Number -> Str -> --- {s,sp : Gender => Case => Str ; n : Number ; a : Adjf} = \n,dies -> --- {s,sp = appAdj (regA dies) ! n ; n = n ; a = Weak} ; --- --- mkOrd : {s : Degree => AForm => Str} -> {s : AForm => Str} = \a -> --- {s = a.s ! Posit} ; --- ----- For $ParadigmsDut$. --- --- genitS : Str -> Str = \hund -> case hund of { --- _ + ("el" | "en" | "er") => hund + "s" ; --- _ + ("s" | "ß" | "sch" | "st" | "x" | "z") => hund + "es" ; --- _ => hund + variants {"s" ; "es"} --- } ; --- pluralN : Str -> Str = \hund -> case hund of { --- _ + ("el" | "er" | "e") => hund + "n" ; --- _ + "en" => hund ; --- _ => hund + "en" --- } ; --- dativE : Str -> Str = \hund -> case hund of { --- _ + ("el" | "en" | "er" | "e") => hund ; --- _ => variants {hund ; hund + "e"} --- } ; --- ----- Duden, p. 119 --- --- verbT : Str -> Str = \v -> case v of { --- _ + ("t" | "d") => v + "et" ; -- gründen, reden, betten --- _ + ("ch" | "k" | "p" | "t" | "g" | "b" | "d" | "f" | "s") + --- ("m" | "n") => v + "et" ; -- atmen, widmen, öffnen, rechnen --- _ => v + "t" -- lernen, lärmen, qualmen etc --- } ; --- --- verbST : Str -> Str = \v -> case v of { --- _ + ("s" | "ss" | "ß" | "sch" | "x" | "z") => v + "t" ; --- _ => v + "st" --- } ; --- --- stemVerb : Str -> Str = \v -> case v of { --- _ + ("rn" | "ln") => init v ; --- _ => Predef.tk 2 v --- } ; --- ----- For $Numeral$. --- --- LinDigit = {s : DForm => CardOrd => Str} ; --- --- cardOrd : Str -> Str -> CardOrd => Str = \drei,dritte -> --- table { --- NCard _ _ => drei ; --- NOrd a => (regA (init dritte)).s ! Posit ! a --- } ; --- --- cardReg : Str -> CardOrd => Str = \zehn -> --- cardOrd zehn (zehn + "te") ; --- --- mkDigit : (x1,_,_,x4 : Str) -> LinDigit = --- \drei,dreizehn,dreissig,dritte -> --- {s = table { --- DUnit => cardOrd drei dritte ; --- DTeen => cardReg dreizehn ; --- DTen => cardOrd dreissig (dreissig + "ste") --- } --- } ; --- --- regDigit : Str -> LinDigit = \vier -> --- mkDigit vier (vier + "zehn") (vier + "zig") (vier + "te") ; --- --- invNum : CardOrd = NCard Masc Nom ; --- ---} ; --- - -} diff --git a/src/dutch/ParadigmsDut.gf b/src/dutch/ParadigmsDut.gf index 25d65a8c4..540ad558f 100644 --- a/src/dutch/ParadigmsDut.gf +++ b/src/dutch/ParadigmsDut.gf @@ -327,169 +327,14 @@ oper } ; mkmaxV3 : V -> Prep -> Prep -> V3 = \v,c,d -> lin V3 (v ** {c2 = ; c3 = }) ; - - - - -----2 Definitions of paradigms ----- ----- The definitions should not bother the user of the API. So they are ----- hidden from the document. --- --- --- --- Gender = MorphoDut.Gender ; --- Case = MorphoDut.Case ; --- Number = MorphoDut.Number ; --- masculine = Masc ; --- feminine = Fem ; --- neuter = Neutr ; --- nominative = Nom ; --- accusative = Acc ; --- dative = Dat ; --- genitive = Gen ; --- singular = Sg ; --- plural = Pl ; --- --- mk6N a b c d e f g = MorphoDut.mkN a b c d e f g ** {lock_N = <>} ; --- --- regN : Str -> N = \hund -> case hund of { --- _ + "e" => mk6N hund hund hund hund (hund + "n") (hund + "n") Fem ; --- _ + ("ion" | "ung") => mk6N hund hund hund hund (hund + "en") (hund + "en") Fem ; --- _ + ("er" | "en" | "el") => mk6N hund hund hund (genitS hund) hund (pluralN hund) Masc ; --- _ => mk6N hund hund hund (genitS hund) (hund + "e") (pluralN hund) Masc --- } ; --- --- reg2N : (x1,x2 : Str) -> Gender -> N = \hund,hunde,g -> --- let --- hunds = genitS hund ; --- hundE = dativE hund ; --- hunden = pluralN hunde --- in --- case of { -- Duden p. 223 --- <_,_ + ("e" | "er"), Masc | Neutr> => -- I,IV --- mk6N hund hund hundE hunds hunde hunden g ; --- <_ + ("el"|"er"|"en"),_ + ("el"|"er"|"en"), Masc | Neutr> => -- II --- mk6N hund hund hund hunds hunde hunden g ; --- <_,_ + "s", Masc | Neutr> => -- V --- mk6N hund hund hund (hund + "s") hunde hunde g ; --- <_,_ + "en", Masc> => -- VI --- mk6N hund hunde hunde hunde hunde hunde g ; --- <_,_ + ("e" | "er"), Fem> => -- VII,VIII --- mk6N hund hund hund hund hunde hunden g ; --- <_,_ + ("n" | "s"), Fem> => -- IX,X --- mk6N hund hund hund hund hunde hunde g ; --- _ => {s = (regN hund).s ; g = g ; lock_N = <>} --- } ; --- --- mkN2 = overload { --- mkN2 : Str -> N2 = \s -> vonN2 (regN s) ; --- mkN2 : N -> N2 = vonN2 ; --- mkN2 : N -> Prep -> N2 = mmkN2 --- } ; --- --- --- mmkN2 : N -> Prep -> N2 = \n,p -> n ** {c2 = p ; lock_N2 = <>} ; --- vonN2 : N -> N2 = \n -> n ** {c2 = {s = "von" ; c = dative} ; lock_N2 = <>} ; --- --- mkN3 = \n,p,q -> n ** {c2 = p ; c3 = q ; lock_N3 = <>} ; --- --- mk2PN = \karolus, karoli -> --- {s = table {Gen => karoli ; _ => karolus} ; lock_PN = <>} ; --- regPN = \horst -> --- mk2PN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) ; --- --- mkPN = overload { --- mkPN : Str -> PN = regPN ; --- mkPN : (nom,gen : Str) -> PN = mk2PN ; --- mkPN : (nom,acc,dat,gen : Str) -> PN = \nom,acc,dat,gen -> --- {s = table {Nom => nom ; Acc => acc ; Dat => dat ; Gen => gen} ; lock_PN = <>} --- } ; --- --- mk2PN : (karolus, karoli : Str) -> PN ; -- karolus, karoli --- regPN : (Johann : Str) -> PN ; --- -- Johann, Johanns ; Johannes, Johannes --- --- --- mk3A : (gut,besser,beste : Str) -> A = \a,b,c -> --- let aa : Str = case a of { --- teu + "er" => teu + "r" ; --- mud + "e" => mud ; --- _ => a --- } in --- MorphoDut.mkA a aa b (init c) ** {lock_A = <>} ; --- mk4A : (gut,gute,besser,beste : Str) -> A = \a,aa,b,c -> --- MorphoDut.mkA a aa b (init c) ** {lock_A = <>} ; --- --- regA : Str -> A = \a -> case a of { --- teu + "er" => mk3A a (teu + "rer") (teu + "reste") ; --- _ + "e" => mk3A a (a + "r") (a + "ste") ; --- _ => mk3A a (a + "er") (a + "este") --- } ; - invarA = \s -> lin A {s = \\_,_ => s} ; ---- comparison mkA2 = \a,p -> lin A2 (a ** {c2 = p}) ; mkAdv s = {s = s ; lock_Adv = <>} ; --- --- mkPrep s c = {s = s ; c = c ; lock_Prep = <>} ; + noPrep = nomergePrep [] ; --- datPrep = mkPrep [] dative ; --- genPrep = mkPrep [] genitive ; --- von_Prep = mkPrep "von" dative ; --- zu_Prep = mkPrep "zu" dative ; --- --- mk6V geben gibt gib gab gaebe gegeben = --- let --- geb = stemVerb geben ; --- gebe = geb + "e" ; --- gibst = verbST (init gibt) ; --- gebt = verbT geb ; --- gabst = verbST gab ; --- gaben = pluralN gab ; --- gabt = verbT gab --- in --- MorphoDut.mkV --- geben gebe gibst gibt gebt gib gab gabst gaben gabt gaebe gegeben --- [] VHaben ** {lock_V = <>} ; --- --- regV fragen = --- let --- frag = stemVerb fragen ; --- fragt = verbT frag ; --- fragte = fragt + "e" ; --- gefragt = "ge" + fragt ; --- in --- mk6V fragen fragt (frag + "e") fragte fragte gefragt ; --- --- irregV singen singt sang saenge gesungen = --- let --- sing = stemVerb singen ; --- in --- mk6V singen singt sing sang saenge gesungen ; --- --- prefixV p v = MorphoDut.prefixV p v ** {lock_V = v.lock_V} ; --- --- habenV v = --- {s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VHaben ; vtype = v.vtype} ; --- seinV v = --- {s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VSein ; vtype = v.vtype} ; --- reflV v c = --- {s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VHaben ; vtype = VRefl c} ; --- --- no_geV v = let vs = v.s in { --- s = table { --- p@(VPastPart _) => Predef.drop 2 (vs ! p) ; --- p => vs ! p --- } ; --- prefix = v.prefix ; lock_V = v.lock_V ; aux = v.aux ; vtype = v.vtype --- } ; --- --- haben_V = MorphoDut.haben_V ** {lock_V = <>} ; --- sein_V = MorphoDut.sein_V ** {lock_V = <>} ; --- werden_V = MorphoDut.werden_V ** {lock_V = <>} ; --- + prepV2 : V -> Prep -> V2 ; prepV2 v c = lin V2 (v ** {c2 = }) ; --if it has prep, needed for word order (place of negation) diff --git a/src/translator/ExtensionsDut.gf b/src/translator/ExtensionsDut.gf index b0c1d350e..751b5f16a 100644 --- a/src/translator/ExtensionsDut.gf +++ b/src/translator/ExtensionsDut.gf @@ -1,7 +1,7 @@ --# -path=.:../abstract concrete ExtensionsDut of Extensions = - CatDut ** open MorphoDut, ResDut, ParadigmsDut, SyntaxDut, (E = ExtraDut), (G = GrammarDut), Prelude in { + CatDut ** open ResDut, ParadigmsDut, SyntaxDut, (E = ExtraDut), (G = GrammarDut), Prelude in { flags literal=Symb ; coding = utf8 ; diff --git a/src/translator/TranslateDut.gf b/src/translator/TranslateDut.gf index 2db8a86d0..4d41ae334 100644 --- a/src/translator/TranslateDut.gf +++ b/src/translator/TranslateDut.gf @@ -30,7 +30,7 @@ concrete TranslateDut of Translate = , WithoutVP, InOrderToVP, ByVP ], DictionaryDut ** -open MorphoDut, ResDut, ParadigmsDut, SyntaxDut, (E = ExtraDut), Prelude in { +open ResDut, ParadigmsDut, SyntaxDut, (E = ExtraDut), Prelude in { flags literal=Symb ; From b9c81ed83fbcc482b9fc21830813b66582059bd1 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 5 Jun 2018 11:35:32 +0200 Subject: [PATCH 02/15] (Dut) Improve smart paradigms --- src/dutch/ResDut.gf | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/dutch/ResDut.gf b/src/dutch/ResDut.gf index 7ce7ef0cc..d73f5f30c 100644 --- a/src/dutch/ResDut.gf +++ b/src/dutch/ResDut.gf @@ -19,7 +19,14 @@ resource ResDut = ParamX ** open Prelude, Predef in { NPCase = NPNom | NPAcc ; - oper + oper + consonant : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"|"n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"y"|"z") ; + vowel : pattern Str = #("a"|"e"|"i"|"o"|"u") ; + + dupCons : pattern Str = #("b"|"d"|"f"|"g"|"k"|"l"|"m"|"n"|"p"|"r"|"s"|"t") ; -- duplicable consonant + dupVow : pattern Str = #("aa"|"ee"|"oo"|"uu") ; -- actually duplicated vowel + diphthong : pattern Str = #("ei"|"eu"|"oe"|"ou"|"ie"|"ij"|"ui") ; + Noun = {s : NForm => Str ; g : Gender} ; mkNoun : (_,_ : Str) -> Gender -> Noun = \sg,pl,g -> { @@ -33,17 +40,16 @@ resource ResDut = ParamX ** open Prelude, Predef in { } ; regNoun : Str -> Noun = \s -> case s of { - _ + ("a" | "o" | "y" | "u" | "oe" | "é") => mkNoun s (s + "'s") Utr ; - _ + ("oir" | "ion" | "je" | "c") => mkNoun s (s + "s") Neutr ; - ? + ? + ? + _ + - ("el" | "em" | "en" | "er" | "erd" | "aar" | "aard" | "ie") => -- unstressed - mkNoun s (s + "s") Utr ; - _ + ("i"|"u") => mkNoun s (endCons s + "en") Utr ; - b + v@("aa"|"ee"|"oo"|"uu") + c@? => mkNoun s (b + shortVoc v c + "en") Utr ; - b + ("ei"|"eu"|"oe"|"ou"|"ie"|"ij"|"ui") + ? => mkNoun s (endCons s + "en") Utr ; + _ + ("a"|"o"|"y"|"u"|"oe"|"é") => mkNoun s (s + "'s") Utr ; + _ + ("oir"|"ion"|"je"|"c") => mkNoun s (s + "s") Neutr ; + ? + ? + ? + _ + ("el" | "em" | "en" | "er" | "erd" | "aar" | "aard" | "ie") -- unstressed + => mkNoun s (s + "s") Utr ; _ + ("ie"|"ee") => mkNoun s (s + "ën") Utr ; -- zee→zeeën, knie→knieën. -- olie→oliën, industrie→industrieën with 2-arg constructor. - b + v@("a"|"e"|"i"|"o"|"u") + c@? => mkNoun s (b + v + c + c + "en") Utr ; + _ + ("i"|"u") => mkNoun s (endCons s + "en") Utr ; + b + v@#vowel + c@#dupCons => mkNoun s (b + v + c + c + "en") Utr ; + b + v@#dupVow + c@? => mkNoun s (b + shortVoc v c + "en") Utr ; + b + #diphthong + ? => mkNoun s (endCons s + "en") Utr ; _ + "e" => mkNoun s (s + "s") Utr ; -- vrede→vredes. Might not be a good generalisation though. /IL2018 _ => mkNoun s (endCons s + "en") Utr } ; @@ -62,7 +68,6 @@ resource ResDut = ParamX ** open Prelude, Predef in { _ => s } ; - dupCons : pattern Str = #("b"|"d"|"f"|"g"|"k"|"l"|"m"|"n"|"p"|"r"|"s"|"t") ; add_s : Str -> Str = \s -> case s of { _ + "s" => s ; @@ -99,12 +104,13 @@ resource ResDut = ParamX ** open Prelude, Predef in { regAdjective : Str -> Adjective = \s -> let se : Str = case s of { - _ + ("er"|"en"|"ig") => s + "e" ; --- for unstressed adjective suffixes - _ + ("i"|"u"|"ij") => endCons s + "e" ; - b + v@("aa"|"ee"|"oo"|"uu") + c@? => b + shortVoc v c + "e" ; - b + ("ei"|"eu"|"oe"|"ou"|"ie"|"ij"|"ui") + ? => endCons s + "e" ; - b + v@("a"|"e"|"i"|"o"|"u" ) + "w" => s + "e" ; -- to prevent *blauwwe -- does this happen to other end consonants? - b + v@("a"|"e"|"i"|"o"|"u" ) + c@? => b + v + c + c + "e" ; + _ + ("er"|"en"|"ig") => s + "e" ; --- for unstressed adjective suffixes + _ + ("i"|"u"|"ij") => endCons s + "e" ; -- ambigu-ambigue + _ + ("a"|"e"|"o") => s ; -- no e: lila-lila ; beige-beige ; indigo-indigo + + b + v@#dupVow + c@? => b + shortVoc v c + "e" ; + b + #diphthong + ? => endCons s + "e" ; + b + v@#vowel + c@dupCons => b + v + c + c + "e" ; _ => endCons s + "e" } ; in reg2Adjective s se ; @@ -215,8 +221,6 @@ param _ => d_regVerb vergeten vergeet }; - consonant : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"|"n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"y"|"z") ; - vowel : pattern Str = #("a"|"e"|"i"|"o"|"u") ; -- To make a stem out of a verb -- If a stem ends in a 'v' then the 'v' changes into a 'f' -- If a stem ends in a 'z' then the 'z' changes into an 's' @@ -243,7 +247,7 @@ param -- Penultimate is vowel, but it doesn't double: either because _+ #vowel + _ + #vowel + #consonant => kerf ; -- a) ≥2 syllables, e.g. ademen, rekenen, schakelen -- b) diphthong, e.g. vriezen (ij + #consonant falls into the default case!) - -- OBS. will do the wrong thing, if you use it on prefix verbs + -- NB. this will do the wrong thing, if you use it on prefix verbs _ + #vowel + ("w"|"j") => werk ; -- Don't double a vowel before a w or j (are there other consonants?) From 5e4d2e654d9dbe0e0f4d2bf43812424be553245d Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 5 Jun 2018 14:20:09 +0200 Subject: [PATCH 03/15] (Dut) Update ExtensionsDut and TranslateDut --- src/translator/ExtensionsDut.gf | 48 +++++++++++++++------------------ src/translator/TranslateDut.gf | 2 +- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/src/translator/ExtensionsDut.gf b/src/translator/ExtensionsDut.gf index 751b5f16a..82aaccabc 100644 --- a/src/translator/ExtensionsDut.gf +++ b/src/translator/ExtensionsDut.gf @@ -1,7 +1,7 @@ --# -path=.:../abstract concrete ExtensionsDut of Extensions = - CatDut ** open ResDut, ParadigmsDut, SyntaxDut, (E = ExtraDut), (G = GrammarDut), Prelude in { + CatDut ** open ResDut, ParadigmsDut, SyntaxDut, (E = ExtraDut), ExtendDut, (G = GrammarDut), Prelude in { flags literal=Symb ; coding = utf8 ; @@ -70,14 +70,13 @@ lin } ; CompoundAP noun adj = { - s = \\af => glue (noun.s ! NF Sg Nom) (adj.s ! Posit ! af) ; + s = \\agr,af => glue (noun.s ! NF Sg Nom) (adj.s ! Posit ! af) ; isPre = True } ; - GerundNP vp = { -- infinitive: Bier zu trinken - s = \\c => useInfVP False vp ; - a = agrP3 Sg ; - isPron = False + GerundNP vp = heavyNP { -- infinitive: Bier zu trinken + s = \\c => useInfVP False vp ! agrP3 Sg ; + a = agrP3 Sg } ; GerundAdv vp = { -- Bier trinkend @@ -85,33 +84,31 @@ lin } ; WithoutVP vp = { -- ohne Bier zu trinken - s = "zonder" ++ useInfVP False vp + s = "zonder" ++ useInfVP False vp ! agrP3 Sg } ; InOrderToVP vp = { -- um Bier zu trinken - s = "om" ++ useInfVP False vp + s = "om" ++ useInfVP False vp ! agrP3 Sg } ; ByVP vp = { ---- durch Bier zu drinken - s = "door" ++ useInfVP False vp ---- + s = "door" ++ useInfVP False vp ! agrP3 Sg ---- } ; - PresPartAP vp = { - s = \\af => vp.n0 ! agrP3 Sg ++ vp.n2 ! agrP3 Sg ++ vp.a2 ++ vp.a1 ! Pos ++ vp.inf.p1 ++ vp.ext ++ vp.s.s ! VPresPart ; - isPre = True - } ; - - PastPartAP vp = { - s = \\af => vp.n0 ! agrP3 Sg ++ vp.n2 ! agrP3 Sg ++ vp.a2 ++ vp.a1 ! Pos ++ vp.inf.p1 ++ vp.ext ++ vp.s.s ! VPerf ; ---- agr inflection? - isPre = True - } ; + PastPartAP = ExtendDut.PastPartAP ; + + PresPartAP vp = { --# notpresent + s = \\agr,af => let aForm = case vp.isHeavy of { --# notpresent + True => APred ; --# notpresent + False => af } ; --# notpresent + in (infClause [] agr vp aForm).s ! Pres ! Simul ! Pos ! Sub ; --# notpresent + isPre = notB vp.isHeavy ; --# notpresent + } ; --# notpresent PastPartAgentAP vp np = - let agent = (SyntaxDut.mkAdv (mkPrep "door") (lin NP np)).s - in { - s = \\af => vp.n0 ! agrP3 Sg ++ vp.n2 ! agrP3 Sg ++ vp.a2 ++ vp.a1 ! Pos ++ vp.inf.p1 ++ vp.ext ++ vp.s.s ! VPerf ; ---- agr inflection? - isPre = True - } ; + let agent = (SyntaxDut.mkAdv (mkPrep "door") (lin NP np)).s ; + ap = ExtendDut.PastPartAP vp ; + in ap ** { s = \\agr,af => ap.s ! agr ! af ++ agent } ; {- @@ -139,16 +136,15 @@ lin } ; -} CompS s = {s = \\_ => "dat" ++ s.s ! Main} ; -- S -> Comp - CompVP ant p vp = {s = \\_ => useInfVP True vp} ; -- VP -> Comp + CompVP ant p vp = {s = useInfVP True vp} ; -- VP -> Comp lin that_RP = which_RP ; UttAdV adv = adv ; - ApposNP np1 np2 = { + ApposNP np1 np2 = np1 ** { s = \\c => np1.s ! c ++ SOFT_BIND ++ "," ++ np2.s ! NPNom ; - a = np1.a ; isPron = False } ; diff --git a/src/translator/TranslateDut.gf b/src/translator/TranslateDut.gf index 4d41ae334..e1e6ddc43 100644 --- a/src/translator/TranslateDut.gf +++ b/src/translator/TranslateDut.gf @@ -30,7 +30,7 @@ concrete TranslateDut of Translate = , WithoutVP, InOrderToVP, ByVP ], DictionaryDut ** -open ResDut, ParadigmsDut, SyntaxDut, (E = ExtraDut), Prelude in { +open ResDut, ParadigmsDut, SyntaxDut, (E = ExtendDut), Prelude in { flags literal=Symb ; From 3949424a7848eabf8f12f3cf77fda872e6b7f0d1 Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Tue, 5 Jun 2018 18:19:09 +0200 Subject: [PATCH 04/15] fixed Ger SentCN and AdvCN, which erased their earlier modifiers --- src/german/NounGer.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/german/NounGer.gf b/src/german/NounGer.gf index 58b75ac6f..c4fae0a8e 100644 --- a/src/german/NounGer.gf +++ b/src/german/NounGer.gf @@ -199,9 +199,9 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { rc = (np.rc ++ embedInCommas (rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a)))) ; isPron = False } ; - SentCN cn s = cn ** {ext = embedInCommas s.s} ; + SentCN cn s = cn ** {ext = cn.ext ++ embedInCommas s.s} ; - AdvCN cn a = cn ** {adv = a.s} ; + AdvCN cn a = cn ** {adv = cn.adv ++ a.s} ; ApposCN cn np = let g = cn.g in cn ** { s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPC c ++ bigNP np } ; From 2bc8b35e576ceba531a7ff2a56ee94c524e59241 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 8 Jun 2018 15:01:41 +0200 Subject: [PATCH 05/15] (Dut) Change order of cases in smart paradigm for nouns --- src/dutch/ResDut.gf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dutch/ResDut.gf b/src/dutch/ResDut.gf index d73f5f30c..38617a733 100644 --- a/src/dutch/ResDut.gf +++ b/src/dutch/ResDut.gf @@ -47,9 +47,10 @@ resource ResDut = ParamX ** open Prelude, Predef in { _ + ("ie"|"ee") => mkNoun s (s + "ën") Utr ; -- zee→zeeën, knie→knieën. -- olie→oliën, industrie→industrieën with 2-arg constructor. _ + ("i"|"u") => mkNoun s (endCons s + "en") Utr ; + + b + #diphthong + ? => mkNoun s (endCons s + "en") Utr ; -- boek→boeken + b + v@#dupVow + c@? => mkNoun s (b + shortVoc v c + "en") Utr ; b + v@#vowel + c@#dupCons => mkNoun s (b + v + c + c + "en") Utr ; - b + v@#dupVow + c@? => mkNoun s (b + shortVoc v c + "en") Utr ; - b + #diphthong + ? => mkNoun s (endCons s + "en") Utr ; _ + "e" => mkNoun s (s + "s") Utr ; -- vrede→vredes. Might not be a good generalisation though. /IL2018 _ => mkNoun s (endCons s + "en") Utr } ; From 97af158927ca9847b3777c503c38474e1ecf582c Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Sat, 9 Jun 2018 20:44:00 +0200 Subject: [PATCH 06/15] Minor fix in RGL browser --- doc/browse/.gitignore | 1 + doc/browse/build-tags.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 doc/browse/.gitignore mode change 100644 => 100755 doc/browse/build-tags.sh diff --git a/doc/browse/.gitignore b/doc/browse/.gitignore new file mode 100644 index 000000000..c41ecfbda --- /dev/null +++ b/doc/browse/.gitignore @@ -0,0 +1 @@ +tags/*.gf-tags diff --git a/doc/browse/build-tags.sh b/doc/browse/build-tags.sh old mode 100644 new mode 100755 index 3a0fec900..49a7e5089 --- a/doc/browse/build-tags.sh +++ b/doc/browse/build-tags.sh @@ -49,7 +49,7 @@ do $FIND | while read -r file do echo " \""`echo $file | sed 's|./||;s|.gf||'`"\"," >> $index - filemtime=`$STAT "${tagsdir}/${file}-tags"` 2>/dev/null + filemtime=`$STAT "${tagsdir}/${file}-tags" 2>/dev/null` if [ -z "$filemtime" ] || [ "$filemtime" -lt "$start" ] then gf --batch --quiet --tags --output-dir=${tagsdir} $file 2>/dev/null From f1889644d40b415972b8976b7c5903613b55d876 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 12 Jun 2018 14:18:49 +0200 Subject: [PATCH 07/15] (Dut) Fix bug in regAdjective: now matching a pattern #dupCons, not just any suffix --- src/dutch/ResDut.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dutch/ResDut.gf b/src/dutch/ResDut.gf index 38617a733..4ebc09a8f 100644 --- a/src/dutch/ResDut.gf +++ b/src/dutch/ResDut.gf @@ -111,7 +111,7 @@ resource ResDut = ParamX ** open Prelude, Predef in { b + v@#dupVow + c@? => b + shortVoc v c + "e" ; b + #diphthong + ? => endCons s + "e" ; - b + v@#vowel + c@dupCons => b + v + c + c + "e" ; + b + v@#vowel + c@#dupCons => b + v + c + c + "e" ; _ => endCons s + "e" } ; in reg2Adjective s se ; From 75d2f66b5901b0a80c42c1a8b976df9ea80852d3 Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Tue, 12 Jun 2018 21:06:30 +0200 Subject: [PATCH 08/15] started to add overloaded opers to ParadigmsAra --- src/arabic/ParadigmsAra.gf | 59 +++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/src/arabic/ParadigmsAra.gf b/src/arabic/ParadigmsAra.gf index 75cccff5b..68879568c 100644 --- a/src/arabic/ParadigmsAra.gf +++ b/src/arabic/ParadigmsAra.gf @@ -40,10 +40,21 @@ resource ParadigmsAra = open Preposition : Type ; --2 Nouns - + +-- Overloaded operator for main cases + + mkN = overload { + mkN : NTable -> Gender -> Species -> N -- loan words, irregular + = mkFullN ; + mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N -- broken plural + = brkN ; + mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural + = sdfN ; + } ; + --This is used for loan words or anything that has untreated irregularities --in the interdigitization process of its words - mkN : NTable -> Gender -> Species -> N ; + mkFullN : NTable -> Gender -> Species -> N ; --Takes a root string, a singular pattern string, a broken plural --pattern string, a gender, and species. Gives a noun. @@ -57,16 +68,39 @@ resource ParadigmsAra = open --and species. Gives a noun whose plural is sound masculine sdmN : Str -> Str -> Gender -> Species -> N ; - mkPN : Str -> Gender -> Species -> PN ; - + +--3 Proper names + + mkPN = overload { + mkPN : Str -> PN -- Fem Hum if ends with ة, otherwise Masc Hum + = smartPN ; + mkPN : Str -> Gender -> Species -> PN + = mkFullPN ; + } ; + + mkFullPN : Str -> Gender -> Species -> PN ; + + + --3 Relational nouns mkN2 : N -> Preposition -> N2 ; mkN3 : N -> Preposition -> Preposition -> N3 ; + --2 Adjectives - + +-- Overloaded operator for main cases + + mkA = overload { + mkA : (root,patt : Str) -> A + = sndA ; + mkA : (root : Str) -> A + = clrA ; + } ; + + --Takes a root string and a pattern string sndA : Str -> Str -> A ; @@ -296,7 +330,7 @@ resource ParadigmsAra = open Preposition = Str ; - mkN nsc gen spec = + mkFullN nsc gen spec = { s = nsc; --NTable g = gen; h = spec; @@ -307,7 +341,7 @@ resource ParadigmsAra = open \root,sg,pl,gen,spec -> let { kitAb = mkWord sg root; kutub = mkWord pl root - } in mkN (reg kitAb kutub) gen spec; + } in mkFullN (reg kitAb kutub) gen spec; brkN root sg pl gen spec = let { raw = brkN' root sg pl gen spec} in @@ -323,14 +357,14 @@ resource ParadigmsAra = open sdfN = \root,sg,gen,spec -> let { kalima = mkWord sg root; - } in mkN (sndf kalima) gen spec; + } in mkFullN (sndf kalima) gen spec; sdmN = \root,sg,gen,spec -> let { mucallim = mkWord sg root; - } in mkN (sndm mucallim) gen spec; + } in mkFullN (sndm mucallim) gen spec; - mkPN = \str,gen,species -> + mkFullPN = \str,gen,species -> { s = \\c => str + indecl!c ; g = gen; h = species; @@ -467,4 +501,9 @@ resource ParadigmsAra = open mkA2V v p = mkA2 v p ** {lock_A2 = <>} ; +smartPN : Str -> PN = \s -> case last s of { + "ة" => mkFullPN s Fem Hum ; + _ => mkFullPN s Masc Hum + } ; + } ; From 6c70ccf0a192ddbab2fbef0e90efbff529543c04 Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Tue, 12 Jun 2018 22:34:45 +0200 Subject: [PATCH 09/15] smart Arabic mkN --- src/arabic/ParadigmsAra.gf | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/arabic/ParadigmsAra.gf b/src/arabic/ParadigmsAra.gf index 68879568c..b6a93534e 100644 --- a/src/arabic/ParadigmsAra.gf +++ b/src/arabic/ParadigmsAra.gf @@ -44,12 +44,18 @@ resource ParadigmsAra = open -- Overloaded operator for main cases mkN = overload { + mkN : (sg : Str) -> N -- non-human regular nouns + = smartN ; + mkN : Species -> N -> N + = \p,n -> n ** {h = p} ; + mkN : (sg,pl : Str) -> Gender -> Species -> N + = \sg,pl -> mkFullN (reg sg pl) ; mkN : NTable -> Gender -> Species -> N -- loan words, irregular - = mkFullN ; + = mkFullN ; mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N -- broken plural = brkN ; - mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural - = sdfN ; +--- mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural +--- = sdfN ; } ; --This is used for loan words or anything that has untreated irregularities @@ -501,6 +507,11 @@ resource ParadigmsAra = open mkA2V v p = mkA2 v p ** {lock_A2 = <>} ; +smartN : Str -> N = \s -> case last s of { + "ة" => mkFullN (sndf s) Fem NoHum ; + _ => mkFullN (sndm s) Masc NoHum + } ; + smartPN : Str -> PN = \s -> case last s of { "ة" => mkFullPN s Fem Hum ; _ => mkFullPN s Masc Hum From 350adb704a50115cc06c2ef6223e0bcfcb8efe2b Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Wed, 13 Jun 2018 07:55:33 +0200 Subject: [PATCH 10/15] mkA and mkV in arabic --- src/arabic/ParadigmsAra.gf | 44 ++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/src/arabic/ParadigmsAra.gf b/src/arabic/ParadigmsAra.gf index b6a93534e..84e6759b0 100644 --- a/src/arabic/ParadigmsAra.gf +++ b/src/arabic/ParadigmsAra.gf @@ -102,16 +102,18 @@ resource ParadigmsAra = open mkA = overload { mkA : (root,patt : Str) -> A = sndA ; - mkA : (root : Str) -> A + mkA : (root : Str) -> A -- forms adjectives with positive form aFCal = clrA ; + mkA : (posit,compar,plur : Str) -> A + = degrA ; } ; --Takes a root string and a pattern string - sndA : Str -> Str -> A ; + sndA : (root,patt : Str) -> A ; --Takes a root string only - clrA : Str -> A ; + clrA : (root : Str) -> A ; -- forms adjectives of type aFCal --3 Two-place adjectives -- @@ -136,13 +138,26 @@ resource ParadigmsAra = open -- A preposition as used for rection in the lexicon, as well as to -- build $PP$s in the resource API, just requires a string. - mkPreposition : Str -> Preposition ; + mkPrep : Str -> Prep + = \s -> lin Prep {s = mkPreposition s} ; -- preposition in the sense of RGL abstract syntax + + mkPreposition : Str -> Preposition ; -- just a string, for internal use --- (These two functions are synonyms.) --2 Verbs ---The verb in the imperfect tense gives the most information +-- Overloaded operations + + mkV = overload { + mkV : (imperfect : Str) -> V + = regV ; + mkV : (root : Str) -> (perf,impf : Vowel) -> V -- verb form I ; vowel = a|i|u + = v1 ; + mkV : (root : Str) -> VerbForm -> V -- FormI .. FormVIII (no VII) ; default vowels a u for I + = formV ; + } ; + +-- The verb in the imperfect tense gives the most information regV : Str -> V ; @@ -440,6 +455,9 @@ resource ParadigmsAra = open isNum = False; lock_Quant = <> }; + + degrA : (posit,compar,plur : Str) -> A + = \posit,compar,plur -> lin A {s = clr posit compar plur} ; sndA root pat = let raw = sndA' root pat in { @@ -517,4 +535,18 @@ smartPN : Str -> PN = \s -> case last s of { _ => mkFullPN s Masc Hum } ; +formV : (root : Str) -> VerbForm -> V = \s,f -> case f of { + FormI => v1 s a u ; + FormII => v2 s ; + FormIII => v3 s ; + FormIV => v4 s ; + FormV => v5 s ; + FormVI => v6 s ; +--- FormVII => v7 s ; + FormVIII => v8 s + } ; + +param VerbForm = + FormI | FormIII | FormIII | FormIV | FormV | FormVI | FormVIII ; + } ; From 6c3125c3e28c5a7e9a72c10564f03bc87605809c Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Thu, 14 Jun 2018 10:11:43 +0200 Subject: [PATCH 11/15] VPSlash in ExtensionsEng updated --- src/translator/ExtensionsEng.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/translator/ExtensionsEng.gf b/src/translator/ExtensionsEng.gf index f6c5b77bb..94db0f4c0 100644 --- a/src/translator/ExtensionsEng.gf +++ b/src/translator/ExtensionsEng.gf @@ -129,7 +129,7 @@ lin VPSlashVS vs vp = insertObj (\\a => infVP VVInf vp Simul CPos a) (predV vs) ** - {c2 = ""; gapInMiddle = False} ; + {c2 = ""; gapInMiddle = False ; missingAdv = True} ; ---- missingAdv? PastPartRS ant pol vps = { s = \\agr => vps.ad ! agr ++ vps.ptp ++ vps.p ++ vps.s2 ! agr ; From 7dd9e62de5620b823ca785324c34b30de5b2deb7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 15 Jun 2018 10:38:04 +0200 Subject: [PATCH 12/15] (Dut) Remove . after date (op 17 mei, not 17. mei) --- src/dutch/ConstructionDut.gf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dutch/ConstructionDut.gf b/src/dutch/ConstructionDut.gf index 023476d39..6d629bb67 100644 --- a/src/dutch/ConstructionDut.gf +++ b/src/dutch/ConstructionDut.gf @@ -2,7 +2,7 @@ concrete ConstructionDut of Construction = CatDut ** open SyntaxDut, SymbolicDut, ParadigmsDut, - (L = LexiconDut), (E = ExtraDut), (G = GrammarDut), (I = IrregDut), (R = ResDut), (N = NounDut), Prelude in { + (L = LexiconDut), (E = ExtendDut), (G = GrammarDut), (I = IrregDut), (R = ResDut), (N = NounDut), (P=ParamX), Prelude in { lin @@ -49,9 +49,9 @@ lin monthAdv m = SyntaxDut.mkAdv in_Prep (mkNP the_Det m) ; yearAdv y = SyntaxDut.mkAdv (mkPrep "in jaar") y ; ---- - dayMonthAdv d m = ParadigmsDut.mkAdv ("op" ++ d.s ! R.NPNom ++ BIND ++ "." ++ m.s ! R.NF R.Sg R.Nom) ; -- op 17 Mai - monthYearAdv m y = SyntaxDut.mkAdv in_Prep (mkNP the_Det (mkCN m y)) ; -- im Mai 2012 - dayMonthYearAdv d m y = ParadigmsDut.mkAdv ("op" ++ d.s ! R.NPNom ++ BIND ++ "." ++ m.s ! R.NF R.Sg R.Nom ++ y.s ! R.NPNom) ; -- am 17 Mai 2013 + dayMonthAdv d m = ParadigmsDut.mkAdv ("op" ++ d.s ! R.NPNom ++ m.s ! R.NF R.Sg R.Nom) ; -- op 17 mei + monthYearAdv m y = SyntaxDut.mkAdv in_Prep (mkNP the_Det (mkCN m y)) ; -- in mei 2012 + dayMonthYearAdv d m y = ParadigmsDut.mkAdv ("op" ++ d.s ! R.NPNom ++ m.s ! R.NF R.Sg R.Nom ++ y.s ! R.NPNom ) ; -- op 17 mei 2013 intYear = symb ; intMonthday = symb ; From 41253228e77141d46dbdb3b84e9fe1ea05115bf0 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 15 Jun 2018 11:00:16 +0200 Subject: [PATCH 13/15] (Dut) consistency with wilt/wil, zult/zal, kunt/kan --- src/dutch/IrregDut.gf | 2 +- src/dutch/ResDut.gf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dutch/IrregDut.gf b/src/dutch/IrregDut.gf index 4464452aa..11ebb1c9b 100644 --- a/src/dutch/IrregDut.gf +++ b/src/dutch/IrregDut.gf @@ -169,7 +169,7 @@ lin weven_V = mkV "weven" "weefde" "weefden" "geweven" ; lin wijken_V = mkZijnV "wijken" "week" "weken" "geweken" ; lin wijten_V = mkV "wijten" "weet" "weten" "geweten" ; lin wijzen_V = mkV "wijzen" "wees" "wezen" "gewezen" ; -lin willen_V = mkV "wil" "wilt" "wil" "willen" "wilde" "wilde" "wilden" "gewild" ; -- mkV "wil" "wilt" "wil" "willen" "wou" "wou" "wouden" "gewild" ; +lin willen_V = mkV "wil" "wil" "wil" "willen" "wilde" "wilde" "wilden" "gewild" ; -- mkV "wil" "wilt" "wil" "willen" "wou" "wou" "wouden" "gewild" ; lin winden_V = mkV "winden" "wond" "wonden" "gewonden" ; lin winnen_V = mkV "winnen" "won" "wonnen" "gewonnen" ; lin worden_V = mkV "worden" "werd" "werden" "geworden" ; diff --git a/src/dutch/ResDut.gf b/src/dutch/ResDut.gf index 4ebc09a8f..45bc0ac3f 100644 --- a/src/dutch/ResDut.gf +++ b/src/dutch/ResDut.gf @@ -358,7 +358,7 @@ param VInf => "zullen" ; VInfFull => "zullen" ; VPresSg1 => "zal" ; - VPresSg2 => "zult" ; + VPresSg2 => "zal" ; VPresSg3 => "zal" ; VPresPl => "zullen" ; VPastSg => "zou" ; --# notpresent @@ -383,7 +383,7 @@ param VInf => "kunnen" ; VInfFull => "kunnen" ; VPresSg1 => "kan" ; - VPresSg2 => "kunt" ; + VPresSg2 => "kan" ; VPresSg3 => "kan" ; ---- kun je VPresPl => "kunnen" ; VPastSg => "kon" ; --# notpresent From 58eda092557838e4f8ea09adeead8b9b504e12d0 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 15 Jun 2018 11:05:22 +0200 Subject: [PATCH 14/15] (Dut) Fixes in DetQuant* * Fix the classic "a 1 house" bug (was handled in DetQuant but still present in DetQuantOrd) * In DetQuantOrd, choose quant.s for both s and sp, to prevent "*yours 5 youngest" --- src/dutch/NounDut.gf | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/src/dutch/NounDut.gf b/src/dutch/NounDut.gf index ad1f04f17..417b1aa46 100644 --- a/src/dutch/NounDut.gf +++ b/src/dutch/NounDut.gf @@ -9,22 +9,17 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in { isPron = False ; } ; - DetNP det = { + DetNP det = det ** { s = \\_ => det.sp ! Neutr ; a = agrP3 det.n ; - isPron = False ; - mergesWithPrep = det.mergesWithPrep ; - mergeForm = det.mergeForm + isPron = False } ; UsePN pn = noMerge ** {s = pn.s ; a = agrP3 Sg ; isPron = False} ; - UsePron pron = { + UsePron pron = pron ** { s = table {NPNom => pron.stressed.nom ; NPAcc => pron.stressed.acc} ; - a = pron.a ; isPron = True ; - mergesWithPrep = pron.mergesWithPrep ; - mergeForm = pron.mergeForm } ; PredetNP pred np = heavyNP { @@ -50,33 +45,30 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in { DetQuantOrd quant num ord = let - n = num.n ; - a = quant.a - in { - s = \\g => quant.s ! num.isNum ! n ! g ++ - num.s ++ ord.s ! agrAdj g quant.a (NF n Nom) ; - sp = \\g => quant.sp ! n ! g ++ - num.s ++ ord.s ! agrAdj g quant.a (NF n Nom) ; - n = n ; - a = a ; - mergesWithPrep = quant.mergesWithPrep ; - mergeForm = quant.mergeForm + detQuant = DetQuant quant num ; + af : Gender -> AForm = \g -> agrAdj g quant.a (NF num.n Nom) ; + in detQuant ** { + -- When combined with an ord, don't use the sp form of the quant. + -- Works the same way in English: + -- e.g. s="your", sp="yours" -> s,sp="your youngest", not sp="*yours youngest" + s,sp = \\g => detQuant.s ! g ++ ord.s ! af g ; + + -- Even if the original quant merges; when you add an ord, it doesn't. + mergesWithPrep = False } ; DetQuant quant num = let n = num.n ; a = quant.a - in { + in quant ** { s = \\g => quant.s ! num.isNum ! n ! g ++ num.s ; sp = \\g => case num.isNum of { False => quant.sp ! n ! g ++ num.s ; - True => quant.s ! True ! n ! g ++ num.s + True => quant.s ! True ! n ! g ++ num.s -- to prevent "een 5 …" } ; n = n ; a = a ; - mergesWithPrep = quant.mergesWithPrep ; - mergeForm = quant.mergeForm } ; PossPron p = noMerge ** { From 8ebf00005f0de6fd8ebb3d6e563eb6cc5224c5bb Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 15 Jun 2018 13:14:53 +0200 Subject: [PATCH 15/15] (Dut) Extend vs. Extra --- src/dutch/ExtendDut.gf | 9 ++++++--- src/dutch/ExtraDut.gf | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/dutch/ExtendDut.gf b/src/dutch/ExtendDut.gf index 5c3b86c4e..00d57f33b 100644 --- a/src/dutch/ExtendDut.gf +++ b/src/dutch/ExtendDut.gf @@ -2,7 +2,7 @@ concrete ExtendDut of Extend = CatDut ** ExtendFunctor - - [PastPartAP] + - [PastPartAP,ICompAP,IAdvAdv] with (Grammar = GrammarDut) ** open @@ -12,7 +12,7 @@ concrete ExtendDut of Extend = Prelude, ParadigmsDut in { -lin --# notpresent +lin PastPartAP vp = { --# notpresent s = \\agr,af => let aForm = case vp.isHeavy of { --# notpresent @@ -22,4 +22,7 @@ lin --# notpresent isPre = notB vp.isHeavy ; --# notpresent } ; --# notpresent - } \ No newline at end of file + ICompAP ap = {s = \\agr => "hoe" ++ ap.s ! agr ! APred} ; + + IAdvAdv adv = {s = "hoe" ++ adv.s} ; +} \ No newline at end of file diff --git a/src/dutch/ExtraDut.gf b/src/dutch/ExtraDut.gf index 8758a93db..698e692e4 100644 --- a/src/dutch/ExtraDut.gf +++ b/src/dutch/ExtraDut.gf @@ -1,5 +1,5 @@ concrete ExtraDut of ExtraDutAbs = CatDut ** - open ResDut, Coordination, Prelude, IrregDut, (P = ParadigmsDut), NounDut in + open ResDut, Coordination, Prelude, IrregDut, (P = ParadigmsDut), (E=ExtendDut), NounDut in { flags coding=utf8 ; @@ -19,9 +19,9 @@ concrete ExtraDut of ExtraDutAbs = CatDut ** predVGen v.isAux BeforeObjs v) ; ---- lin - ICompAP ap = {s = \\agr => "hoe" ++ ap.s ! agr ! APred} ; + ICompAP = E.ICompAP ; - IAdvAdv adv = {s = "hoe" ++ adv.s} ; + IAdvAdv = E.IAdvAdv ; lincat VPS = {s : Order => Agr => Str} ;