From aece969d3365aa4cba99e2cfa5a5c9ac0797bca0 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 4 Oct 2017 14:50:41 +0200 Subject: [PATCH] Basque (#15) A few additions and fixes in the Basque grammar, specifically * Verb morphology (missing forms & bug fixes) * Reflexives: VP and A2 "sees herself", "married to myself" work now properly. * Add Agr to AP * A few lexical changes + other small fixes * Make adjectives depend on agreement; Fix reflexives * fix typo and remove commented out line * small fixes and additions * fix linVP: use the same functions as mkClause * Add new forms to zaio and dio * Fix bug in chooseAuxPol * fix some bugs in synthetic verbs * Add some simple tests for the Basque grammar * Update README.md * formatting * Fix the RE in the grep * fixes/additions to tests * small fixes * change beautiful_A * use linCN in UttCN --- src/basque/AditzTrinkoak.gf | 154 ++++++++++++++++++---------------- src/basque/AdjectiveEus.gf | 33 +++++--- src/basque/ConjunctionEus.gf | 8 +- src/basque/IdiomEus.gf | 9 +- src/basque/LexiconEus.gf | 8 +- src/basque/NounEus.gf | 6 +- src/basque/ParadigmsEus.gf | 2 +- src/basque/PhraseEus.gf | 4 +- src/basque/ResEus.gf | 36 ++++---- src/basque/StructuralEus.gf | 9 +- src/basque/VerbEus.gf | 6 +- src/basque/tests/README.md | 26 ++++++ src/basque/tests/prepnp.gfs | 6 ++ src/basque/tests/relative.gfs | 13 +++ src/basque/tests/ukanDio.gfs | 4 + src/basque/tests/ukanDu.gfs | 6 ++ src/basque/tests/ukanZaio.gfs | 7 ++ 17 files changed, 213 insertions(+), 124 deletions(-) create mode 100644 src/basque/tests/README.md create mode 100644 src/basque/tests/prepnp.gfs create mode 100644 src/basque/tests/relative.gfs create mode 100644 src/basque/tests/ukanDio.gfs create mode 100644 src/basque/tests/ukanDu.gfs create mode 100644 src/basque/tests/ukanZaio.gfs diff --git a/src/basque/AditzTrinkoak.gf b/src/basque/AditzTrinkoak.gf index 7363973f7..776e8f837 100644 --- a/src/basque/AditzTrinkoak.gf +++ b/src/basque/AditzTrinkoak.gf @@ -17,11 +17,14 @@ oper mkVForms = overload { mkVForms : Str -> VForms = \du -> let due : Str = case du of { - _ + "en" => init du ; -- zen / zen + _ + "en" => init du ; -- zen / ze+la + _ + "on" => init du ; -- zitzaion / zitzaio+la + _ + "an" => init du ; -- zitzaidan / zitzaida+la _ + "gu" => du ; -- dugu / dugu+la _ + "u" => du + "e" ; -- du / due+n _ + "z" => du + "e" ; -- naiz / naize+n _ + "un" => du + "a" ; -- dun / duna+la + _ + "uk" => init du + "a" ; -- duk / dua+la x + "t" => x + "da" ; -- dut / duda+n _ + "r" => du + "re" ; -- dator / datorre+n @@ -79,10 +82,12 @@ oper norkUkanMid : Agr => Str = table { Hi Masc => "a" ; Hi Fem => "na" ; - Ni => "da" ; x => norkUkanLast ! x } ; + Ni => "da" ; Hauek => "e" ; + x => norkUkanLast ! x } ; noriUkanLast : Agr => Str = table { - Hau => "o" ; x => norkUkanLast ! x } ; + Hau => "o" ; Hauek => "e" ; + x => norkUkanLast ! x } ; noriUkanMid : Agr => Str = table { Hau => "o" ; Hauek => "e" ; @@ -100,6 +105,12 @@ oper Zu => "zintu" ; Zuek => "zintuzte" ; Hau => nonExist ; Hauek => nonExist } ; -- formed separately + norUkanZaioNonpres : Agr => Str = table { + Ni => "nin" ; Gu => "gin" ; + Hi _ => "hin" ; + Zu => "zin" ; Zuek => "zin" ; + Hau => "zi" ; Hauek => "zi" } ; + norUkanCond : Agr => Str = table { Zuek => "zintu" ; x => norUkanNonpres ! x } ; @@ -127,7 +138,7 @@ oper Zuek => mkVForms "zinatekete" ; Hauek => mkVForms "lirateke" } ; -- Present and future are identical - _ => table {Ni => mkVForms "naiz" ; + pres => table {Ni => mkVForms "naiz" ; Hi _ => mkVForms "haiz" ; Zu => mkVForms "zara" "zare" ; Hau => mkVForms "da" "de" ; @@ -158,7 +169,7 @@ oper Hauek => norkCond_norHauek ! nork ; _ => let gintu : Str = norCond ! nor ; - z : Str = norCondZ ! nor ; + z : Str = case nor of {(Gu|Zu|Zuek) => "z" ; _ => [] } ; te : Str = norkCond ! nork ; in gintu + z + "ke" + te } ; @@ -192,8 +203,8 @@ oper norCond : Agr => Str = norUkanCond ; - norCondZ : Agr => Str = table { - (Gu|Zu|Zuek) => "z" ; _ => [] } ; + --norCondZ : Agr => Str = table { + -- (Gu|Zu|Zuek) => "z" ; _ => [] } ; norkPast_norHau = table { Ni => "nuen" ; Gu => "genuen" ; Hi _ => "huen" ; @@ -207,7 +218,7 @@ oper norkCond_norHau = table { Hi _ => "hinduke" ; Zuek => "zenukete" ; Hau => "luke" ; Hauek => "lukete" ; - x => (tk 2 (norkPast_norHau ! x)) + "ke" } ; -- zu+en -> nu+ke + x => (tk 2 (norkPast_norHau ! x)) + "ke" } ; -- nu+en -> nu+ke norkCond_norHauek = table { Hi _ => "hindukete" ; Zuek => "zenituzkete" ; Hau => "lituzke" ; Hauek => "lituzkete" ; @@ -220,81 +231,61 @@ oper Ukan [NOR] [NORI] ============================================================================= -} + ukanZaio : TransV = \\nor,tns,nori => mkVForms (tenses ! tns) + where { + norPast : Agr => Str = norUkanZaioNonpres ; + noriPast : Agr => Str = noriUkanMid ; + + norCond : Agr => Str = table { + Hau => "li" ; Hauek => "li" ; + x => norPast ! x } ; + noriCond : Agr => Str = noriPast ; + + norPres : Agr => Str = table { + Ni => "na" ; Gu => "ga" ; + Hi _ => "ha" ; + Zu => "za" ; Zuek => "za" ; + Hau => [] ; Hauek => [] } ; + + noriPres : Agr => Str = \\nori => case of { + => "da" ; -- zai+t, zai+zki+t etc., but `za+tzai+zki_da_te', if nor is Zuek + <_,x> => noriUkanLast ! x } ; + + --- + + te : Str = case nor of { Zuek => "te" ; _ => [] } ; + zki : Str = case nor of { (Zu|Zuek|Gu|Hauek) => "zki" ; _ => [] } ; + + tenses : Tense => Str = table { + Past => let zin : Str = norPast ! nor ; + da : Str = noriPast ! nori ; + in zin + "tzai" + zki + da + te + "n" ; + + Cond => let zin : Str = norCond ! nor ; + da : Str = noriCond ! nori ; + in zin + "tzai" + zki + da + "ke" + te ; + + pres => let za : Str = norPres ! nor ; + tzai : Str = case getPers nor of { P3 => "zai" ; _ => "tzai" } ; + da : Str = noriPres ! nori ; + in za + tzai + zki + da + te } ; - ukanZaio : TransV = table { --TODO: add all forms - -- Nori,Nor - Hau => table { - Pres => table { - Ni => mkVForms "zait" ; - Hi Fem => mkVForms "zain" ; - Hi Masc => mkVForms "zaik" ; - Zu => mkVForms "zaizu" ; - Hau => mkVForms "zaio" ; - Gu => mkVForms "zaigu" ; - Zuek => mkVForms "zaizue" ; - Hauek => mkVForms "zaie" - } ; - _ => \\agr => noVForm - } ; - Hauek => table { - Pres => table { - Ni => mkVForms "zaizkit" ; - Hi Fem => mkVForms "zaizkin" ; - Hi Masc => mkVForms "zaizkik" ; - Zu => mkVForms "zaizkizu" ; - Hau => mkVForms "zaizkio" ; - Gu => mkVForms "zaizkigu" ; - Zuek => mkVForms "zaizkizue" ; - Hauek => mkVForms "zaizkie" - } ; - _ => \\agr => noVForm - } ; - _ => table { - tns => table { - agr => noVForm - } - } - } where { - -- For Nor-Nori inflection, map from Agr to prefix morpheme in Nor position - norTableZaio : Agr => Str = - table { Ni => "na" ; - Hi _ => "ha" ; - Gu => "ga" ; - Zu => "za" ; - Zuek => "za" ; - _ => [] --Hau and Hauek - } } ; - {- ============================================================================= Ukan [NOR] [NORI] [NORK] ============================================================================= -} - ukanDio : DitransV = -- TODO test properly /IL 2017-07 - \\nori,nor,tns,nork => mkVForms ( - case tns of { - Cond => "TODO:conditional" ; - Past => let zen = norkPast ! nork ; - izki = norPast ! getNum nor ; - da = noriPast ! nori ; - te = norkPastTe ! nork ; - in zen + izki + da + te + "n" ; - - _ => let dizki = norPres ! getNum nor ; - da = noriPres ! nori ; --form of nori depends on nork - zue = norkPres ! nork - in dizki + da + zue }) - + ukanDio : DitransV = \\nori,nor,tns,nork => mkVForms (tenses ! tns) where { -- Map from Number to prefix morpheme in Nor position. -- Specific to Nor-Nori-Nork, different forms in other auxiliaries. norPres : Number => Str = table { Sg => "di" ; Pl => "dizki" } ; - norPast : Number => Str = \\tns => drop 1 (norPres ! tns) ; + norPast : Number => Str = \\n => drop 1 (norPres ! n) ; ------ -- Map from Agr to morpheme in Nori position. @@ -311,8 +302,27 @@ oper norkPast : Agr => Str = norkUkanFirst ; - norkPastTe : Agr => Str = table { - (Zuek|Hauek) => "te" ; _ => [] } + norkCond : Agr => Str = table { (Hau|Hauek) => "l" ; + x => norkPast ! x } ; + + --- + te = case nork of { (Zuek|Hauek) => "te" ; _ => [] } ; + + tenses : Tense => Str = table { + Cond => let zen = norkCond ! nork ; + izki = norPast ! getNum nor ; -- same forms for past and cond + da = noriPast ! nori ; -- same forms for past and cond + in zen + izki + da + "ke" + te ; + + Past => let zen = norkPast ! nork ; + izki = norPast ! getNum nor ; + da = noriPast ! nori ; + in zen + izki + da + te + "n" ; + + pres => let dizki = norPres ! getNum nor ; + da = noriPres ! nori ; --form of nori depends on nork + zue = norkPres ! nork + in dizki + da + zue } } ; @@ -333,9 +343,9 @@ oper Hauek => mkVForms "zeuden" } ; _ => table { Ni => mkVForms "nago" ; - Hi _ => mkVForms "hago" ; + Hi _ => mkVForms "hago" "hagoe" ; Zu => mkVForms "zaude" ; - Hau => mkVForms "dago" ; + Hau => mkVForms "dago" "dagoe" ; Gu => mkVForms "gaude" ; Zuek => mkVForms "zaudete" ; Hauek => mkVForms "daude" } diff --git a/src/basque/AdjectiveEus.gf b/src/basque/AdjectiveEus.gf index cf374e59f..d70121b61 100644 --- a/src/basque/AdjectiveEus.gf +++ b/src/basque/AdjectiveEus.gf @@ -9,22 +9,29 @@ concrete AdjectiveEus of Adjective = CatEus ** open ResEus, Prelude in { -- : A -> AP ; PositA a = a ** { - s = a.s ! AF Posit ; + s = \\agr => a.s ! AF Posit ; typ = Bare } ; -- : A -> NP -> AP ; -- euskara ingelesa baino errazagoa da. ComparA a np = a ** { - s = np.s ! Abs ++ "baino" ++ a.s ! AF Compar ; + s = \\agr => np.s ! Abs ++ "baino" ++ a.s ! AF Compar ; typ = Bare } ; -- : A2 -> NP -> AP ; -- married to her ComplA2 a2 np = a2 ** { - s = applyPost a2.compl np ++ a2.s ! AF Posit ; + s = \\agr => applyPost a2.compl np ++ a2.s ! AF Posit ; typ = Bare } ; -- : A2 -> AP ; -- married to itself ReflA2 a2 = a2 ** { - s = applyPost a2.compl buru_NP ++ a2.s ! AF Posit ; + s = \\agr => + let neure : Str = reflPron ! agr ; + neureBuru : NounPhrase = empty_NP ** + { s = \\cas => neure ++ "buru" + ++ artDef ! getNum agr ! cas ! FinalVow ; + agr = agr } -- neure buruekin ezkondua naiz / + -- geure buruekin ezkonduak gara + in applyPost a2.compl neureBuru ++ a2.s ! AF Posit ; typ = Bare } ; -- : A2 -> AP ; -- married @@ -32,18 +39,19 @@ concrete AdjectiveEus of Adjective = CatEus ** open ResEus, Prelude in { -- : A -> AP ; -- warmer UseComparA a = a ** { - s = a.s ! AF Compar ; + s = \\agr => a.s ! AF Compar ; typ = Bare } ; -- : CAdv -> AP -> NP -> AP ; -- as cool as John CAdvAP adv ap np = ap ** { - s = np.s ! Abs ++ adv.s ++ ap.s } ; + s = \\agr => np.s ! Abs ++ adv.s ++ ap.s ! agr } ; -- The superlative use is covered in $Ord$. -- : Ord -> AP ; -- warmest AdjOrd ord = ord ** { + s = \\agr => ord.s ; ph = FinalCons ; --always ends in -en typ = Bare } ; @@ -51,20 +59,25 @@ concrete AdjectiveEus of Adjective = CatEus ** open ResEus, Prelude in { -- phrases, although the semantics is only clear for some adjectives. -- : AP -> SC -> AP ; -- good that she is here - SentAP ap sc = ap ; --TODO + SentAP ap sc = ap ** { + s = \\agr => sc.s ++ ap.s ! agr ; + typ = Bare + } ; -- An adjectival phrase can be modified by an *adadjective*, such as "very". -- : AdA -> AP -> AP ; AdAP ada ap = ap ** { - s = ada.s ++ ap.s ; - typ = Bare } ; + s = \\agr => ada.s ++ ap.s ! agr ; + typ = Bare } ; -- It can also be postmodified by an adverb, typically a prepositional phrase. -- : AP -> Adv -> AP ; -- warm by nature - AdvAP ap adv = ap ; --TODO + AdvAP ap adv = ap ** + { s = \\agr => ap.s ! agr ++ adv.s ; + typ = Bare } ; diff --git a/src/basque/ConjunctionEus.gf b/src/basque/ConjunctionEus.gf index a060aa647..bd3c2c796 100644 --- a/src/basque/ConjunctionEus.gf +++ b/src/basque/ConjunctionEus.gf @@ -71,12 +71,12 @@ lin -- APs and CNs. FIXME: crude first attempt, doesn't work properly. -- ConjCN gives `*nesk edo neskek' lincat - [AP] = {s1,s2 : Str ; ph : Phono ; typ : APType } ; + [AP] = {s1,s2 : Agr => Str ; ph : Phono ; typ : APType } ; lin - BaseAP x y = twoSS x y ** y ; --choose all the other fields from second argument - ConsAP as a = consrSS comma as a ** as ; - ConjAP co as = conjunctDistrSS co as ** as ; + BaseAP x y = twoTable Agr x y ** y ; --choose all the other fields from second argument + ConsAP as a = consrTable Agr comma as a ** as ; + ConjAP co as = conjunctDistrTable Agr co as ** as ; lincat [CN] = { s1,s2 : Agr => Str } ** CNLight ; diff --git a/src/basque/IdiomEus.gf b/src/basque/IdiomEus.gf index f9cac2da7..032b03cc2 100644 --- a/src/basque/IdiomEus.gf +++ b/src/basque/IdiomEus.gf @@ -7,10 +7,13 @@ concrete IdiomEus of Idiom = CatEus ** open Prelude, ResEus in { -- often different even in closely related languages. lin -{- - ImpersCl : VP -> Cl ; -- it is hot - GenericCl : VP -> Cl ; -- one sleeps + -- : VP -> Cl ; -- it is hot + ImpersCl = clFromVP empty_NP ; + + -- : VP -> Cl ; -- one sleeps + GenericCl = clFromVP empty_NP ; +{- CleftNP : NP -> RS -> Cl ; -- it is I who did it CleftAdv : Adv -> S -> Cl ; -- it is here she slept diff --git a/src/basque/LexiconEus.gf b/src/basque/LexiconEus.gf index ba534ea2e..3d9e16ed4 100644 --- a/src/basque/LexiconEus.gf +++ b/src/basque/LexiconEus.gf @@ -24,7 +24,7 @@ lin back_N = mkN "bizkar" ; lin bad_A = mkA "txar" ; lin bank_N = mkN "banku" ; --| mkN "erribera" | mkN "ertz" ; --Apertium lin bark_N = mkN "azal" ; --Apertium -lin beautiful_A = mkA "polit" ; +lin beautiful_A = mkA "eder" ; lin become_VA = mkVA "bihurtu" ; lin beer_N = mkN "garagardo" ; lin beg_V2V = mkV2V "eskatu" ; @@ -214,10 +214,7 @@ lin leave_V2 = mkV2 "utzi" ; --| mkV2 "laga" ; --Apertium lin leg_N = mkN "hanka" ; --Apertium -- lin lie_V = mkV2 "gezur8erran" ; --Apertium -- lin lie_V = mkV2 "gezurra8esan" ; --Apertium ---lin like_V2 = mkV2 "gustatu" ; --Apertium -- NOR-NORI --- lin like_V2 = mkV2 "atsegin_izan" ; --Apertium --- lin like_V2 = mkV2 "atsegin8izan" ; --Apertium --- lin like_V2 = mkV2 "gogoko8izan" ; --Apertium +lin like_V2 = mkV2 "gustatu" zaio ; -- | ukanV "atsegin" ; lin listen_V2 = mkV2 "entzun" ; --Apertium lin live_V = izanV "bizi" ; lin liver_N = mkN "gibel" ; --Apertium @@ -227,6 +224,7 @@ lin louse_N = mkN "zorri" ; --Apertium lin love_N = mkN "maitasun" ; -- | mkN "amodio" ; --Apertium lin love_V2 = ukanV "maite" ; lin man_N = mkN "gizon" animate ; --Apertium +lin married_A2 = mkA2 "ezkondu" (mkPrep [] sociative) ; lin meat_N = mkN "haragi" ; -- | mkN "mami" ; --Apertium lin milk_N = mkN "esne" ; --Apertium lin moon_N = mkN "ilargi" ; --Apertium diff --git a/src/basque/NounEus.gf b/src/basque/NounEus.gf index 2606cbba4..cfa046318 100644 --- a/src/basque/NounEus.gf +++ b/src/basque/NounEus.gf @@ -191,9 +191,9 @@ concrete NounEus of Noun = CatEus ** open ResEus, Prelude in { let a : Str = artIndef ! Abs ! cn.ph ; --`a' for FinalA, [] for other result : {s : Agr => Str ; ph : Phono} = case ap.typ of { - Ko => { s = \\agr => ap.s ++ cn.s ! agr ; + Ko => { s = \\agr => ap.s ! Hau ++ cn.s ! agr ; ph = cn.ph } ; - Bare => { s = \\agr => cn.s ! agr ++ a ++ ap.s ; + Bare => { s = \\agr => cn.s ! agr ++ a ++ ap.s ! Hau ; ph = ap.ph } } ; in cn ** { s = result.s ; @@ -252,7 +252,7 @@ concrete NounEus of Noun = CatEus ** open ResEus, Prelude in { --3 Conjoinable determiners and ones with adjectives -- : DAP -> AP -> DAP ; -- the large (one) - AdjDAP dap ap = dap ** { s = \\cas,ph => ap.s ++ dap.s ! cas ! ph } ; + AdjDAP dap ap = dap ** { s = \\cas,ph => ap.s ! Hau ++ dap.s ! cas ! ph } ; -- : Det -> DAP ; -- this (or that) DetDAP det = det ; diff --git a/src/basque/ParadigmsEus.gf b/src/basque/ParadigmsEus.gf index 537786f4c..ebcbf6889 100644 --- a/src/basque/ParadigmsEus.gf +++ b/src/basque/ParadigmsEus.gf @@ -55,7 +55,7 @@ oper mkA : Str -> A -> A = \s,a -> irregAdvAdj s a } ; --- mkA2 : Str -> A2 = \s -> lin A2 (mkAdj s) ; + mkA2 : Str -> Prep -> A2 = \s,pp -> lin A2 (regAdj s ** { compl = pp }) ; diff --git a/src/basque/PhraseEus.gf b/src/basque/PhraseEus.gf index 6b4e8674c..8c05e92b4 100644 --- a/src/basque/PhraseEus.gf +++ b/src/basque/PhraseEus.gf @@ -18,9 +18,9 @@ concrete PhraseEus of Phrase = CatEus ** open Prelude, ResEus in { UttNP np = { s = np.s ! Abs} ; UttVP vp = { s = linVPPrc vp } ; UttAdv adv = adv ; - UttCN n = {s = n.s ! Hau ++ artDef ! Sg ! Abs ! n.ph } ; + UttCN n = {s = linCNDef n } ; UttCard n = n ; - UttAP ap = ap ; + UttAP ap = { s = ap.s ! Hau } ; UttInterj i = i ; NoPConj = {s = []} ; diff --git a/src/basque/ResEus.gf b/src/basque/ResEus.gf index 32019b731..5b98cb78f 100644 --- a/src/basque/ResEus.gf +++ b/src/basque/ResEus.gf @@ -199,10 +199,6 @@ oper --- { Abs => "hargle"; Erg => "bargle" } -- the field .agr. is of type Agr. - buru_NP : NounPhrase = - empty_NP ** { s = \\_ => "buru" ; - stem = "buru" } ; - empty_NP : NounPhrase = { s = \\_ => [] ; stem = [] ; agr = Hau ; @@ -252,15 +248,23 @@ oper inanPron : (x1,_,_,_,x5 : Str) -> Agr -> Pronoun = \zer,zeri,zerk,zere,zertaz,a -> persPron zer zeri zerk zere zertaz a ** { anim = Inan } ; - + reflPron : Agr => Str = table { + Ni => "neure" ; + Hi _ => "heure" ; + Gu => "geure" ; + Zu => "zeure" ; + Zuek => "zeuen" ; + hau => "haren" } ; -------------------------------------------------------------------- -- Adjective and AP - Adjective : Type = {s : AForm => Str ; ph : Phono} ; + Adjective : Type = { s : AForm => Str ; ph : Phono } ; Adjective2 : Type = Adjective ** { compl : Postposizio } ; - AdjPhrase : Type = {s : Str ; ph : Phono ; typ : APType} ; + AdjPhrase : Type = { s : Agr => Str ; + ph : Phono ; + typ : APType} ; regAdj : Str -> Adjective = \s -> let stem : Str = case last s of { @@ -366,19 +370,17 @@ param oper --to be used in linref, PhraseEus ... anything where a VP is turned into string! - linVP : VerbPhrase -> Str = linVPTense Pres Pres ; + linVP : VerbPhrase -> Str = linVPTense Pres Simul ; - linVPTense : Tense -> Tense -> VerbPhrase -> Str = - \tnsPrc,tnsAux,vp -> - let prc = case vp.val of { - Da Izan => vp.nstem ; - Da Egon => vp.nstem ; - _ => vp.prc ! tnsPrc } ; + linVPTense : Tense -> Anteriority -> VerbPhrase -> Str = \t,a,vp -> + let verb = case isSynthetic vp.val of { + True => verbformSynthetic t a vp ; + False => verbformPeriphrastic t a vp } ; in vp.adv ++ vp.iobj.s ++ vp.dobj.s ! Pos ++ vp.comp ! Hau --all the compls! - ++ prc - ++ (chooseAux vp ! tnsAux ! Hau).indep ; + ++ verb.prc + ++ (verb.aux ! Hau).indep ; -- Used in ComplVV : does not include aux! linVPPrc : VerbPhrase -> Str = \vp -> --TODO make it less of a hack. @@ -526,7 +528,7 @@ oper case vp.val of { Da x => AditzTrinkoak.syntIntransVerb (Da x) ; - Zaio => AditzTrinkoak.ukanZaio ! vp.iobj.agr ; --are there other Zaio (nor-nori) verbs? + Zaio => AditzTrinkoak.ukanZaio ! vp.dobj.agr ; --are there other Zaio (nor-nori) verbs? Du x => let aux = AditzTrinkoak.syntTransVerb (Du x) diff --git a/src/basque/StructuralEus.gf b/src/basque/StructuralEus.gf index f153a9d20..eca8cf215 100644 --- a/src/basque/StructuralEus.gf +++ b/src/basque/StructuralEus.gf @@ -62,9 +62,8 @@ lin not_Predet = { s = "ez" } ; lin only_Predet = { s = "bakarrik" } ; lin most_Predet = { s = "gehien" } ; -lin every_Det = R.defDet [] sg ** -- egun+ero "every day" --TODO: urtero *urte+ero - { s = \\c,_ => SOFT_BIND ++ "ero" - ++ R.artDef ! R.Sg ! c ! R.FinalVow } ; +lin every_Det = R.defDet [] pl ** + { s = \\c,_ => "guzti" ++ R.artDef ! R.Pl ! c ! R.FinalVow } ; lin few_Det = R.indefDet "gutxi" pl ; lin many_Det = R.indefDet "asko" pl ; lin much_Det = R.indefDet "asko" sg ; @@ -96,8 +95,8 @@ oper -- Prep lin above_Prep = mkPrep "gainean" ; -lin after_Prep = mkPrep "ondoan" ; -lin before_Prep = mkPrep "gabe" absolutive ; +lin after_Prep = mkPrep "ondoren" ; +lin before_Prep = mkPrep "aurretik" ; lin behind_Prep = mkPrep "atzean" ; lin between_Prep = mkPrep "artean" ; --`bitartean' for time lin by8agent_Prep = mkPrep [] ergative ; -- choose just case, no separate postposition diff --git a/src/basque/VerbEus.gf b/src/basque/VerbEus.gf index fe06ee46f..5182d5a35 100644 --- a/src/basque/VerbEus.gf +++ b/src/basque/VerbEus.gf @@ -90,7 +90,9 @@ lin -- copula-preceded complements. -- : VPSlash -> VP ; - ReflVP vps = complSlash vps buru_NP ; ------ TODO + ReflVP vps = + let neureBurua : Agr => Str = \\a => reflPron ! a ++ "burua" ; + in vps ** insertComp neureBurua ; -- : Comp -> VP ; UseComp comp = insertComp comp.s (copulaVP comp.copula) ; @@ -138,7 +140,7 @@ lin -- Complement : Type = {s : Agr => Str ; copula : SyntVerb1 } ; -- : AP -> Comp ; - CompAP ap = { s = \\agr => ap.s ++ artDef ! getNum agr ! Abs ! ap.ph ; + CompAP ap = { s = \\agr => ap.s ! agr ++ artDef ! getNum agr ! Abs ! ap.ph ; copula = Izan }; -- : CN -> Comp ; diff --git a/src/basque/tests/README.md b/src/basque/tests/README.md new file mode 100644 index 000000000..b539ebc27 --- /dev/null +++ b/src/basque/tests/README.md @@ -0,0 +1,26 @@ +# Simple tests + +## Morphology of synthetic verbs + +Some tests found in `ukanDu.gfs`, `ukanZaio.gfs` and `ukanDio.gfs`. I test the forms against Apertium morphological analyser, you can use your favourite Basque morphological analyser. + +In this directory I run it like this: + +``` +gf --run < ukanDio.gfs > /tmp/Dio.txt +``` + +And in the directory with Apertium, I run this: + +``` +cat /tmp/Dio.txt | lt-proc -w eus.automorf.bin | egrep -o "\*([a-zñ]*)\>" | sort -u +*didagu$ +... +*zatzaie$ +*zintzaizkizuekete$ +``` + +The output is forms that the GF grammar generates but the Apertium analyser doesn't recognise. Some of them are due to overgeneration: forms like "I+me", "you+you" don't exist, you should use reflexive instead, which takes 3rd person object agreement and a special pronoun and all that stuff. So *didagu* is wrong in the sense that it doesn't exist, but there is no other form that would be more correct. For that reason, I decided to keep these forms and not replace them with an empty string or `nonExist`. +If an application grammarian needs to say "I see myself", they can just use `ReflVP` in `VerbEus`. + +Some of the non-existing forms are genuine mistakes, like *zatzaie*, which should be *zatza**zki**e* instead. Then you just go to `AditzTrinkoak.gf` and fix the relevant functions. diff --git a/src/basque/tests/prepnp.gfs b/src/basque/tests/prepnp.gfs new file mode 100644 index 000000000..6004df8ec --- /dev/null +++ b/src/basque/tests/prepnp.gfs @@ -0,0 +1,6 @@ +import ../LangEus.gf + +gt PrepNP ? (DetCN (DetQuant DefArt NumSg) (UseN girl_N)) | l -treebank -bind +gt PrepNP ? (DetCN (DetQuant DefArt NumSg) (UseN boy_N)) | l -treebank -bind +gt PrepNP ? (DetCN (DetQuant DefArt NumSg) (UseN dog_N)) | l -treebank -bind +gt PrepNP ? (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) | l -treebank -bind \ No newline at end of file diff --git a/src/basque/tests/relative.gfs b/src/basque/tests/relative.gfs new file mode 100644 index 000000000..9884b40a2 --- /dev/null +++ b/src/basque/tests/relative.gfs @@ -0,0 +1,13 @@ +import ../LangEus.gf +import LangEng.gfo + + +l -bind DetCN (DetQuant DefArt NumSg) (RelCN (UseN boy_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a love_V2) (DetCN (DetQuant DefArt NumSg) (UseN girl_N)))))) +l -bind DetCN (DetQuant DefArt NumSg) (RelCN (UseN boy_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a love_V2) (DetCN (DetQuant DefArt NumPl) (UseN girl_N)))))) +l -bind DetCN (DetQuant DefArt NumPl) (RelCN (UseN boy_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a love_V2) (DetCN (DetQuant DefArt NumSg) (UseN girl_N)))))) +l -bind DetCN (DetQuant DefArt NumPl) (RelCN (UseN boy_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a love_V2) (DetCN (DetQuant DefArt NumPl) (UseN girl_N)))))) + +l -bind DetCN (DetQuant DefArt NumSg) (RelCN (UseN boy_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN girl_N)) (SlashV2a love_V2))))) +l -bind DetCN (DetQuant DefArt NumSg) (RelCN (UseN boy_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumPl) (UseN girl_N)) (SlashV2a love_V2))))) +l -bind DetCN (DetQuant DefArt NumPl) (RelCN (UseN boy_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN girl_N)) (SlashV2a love_V2))))) +l -bind DetCN (DetQuant DefArt NumPl) (RelCN (UseN boy_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumPl) (UseN girl_N)) (SlashV2a love_V2))))) \ No newline at end of file diff --git a/src/basque/tests/ukanDio.gfs b/src/basque/tests/ukanDio.gfs new file mode 100644 index 000000000..a58e4328f --- /dev/null +++ b/src/basque/tests/ukanDio.gfs @@ -0,0 +1,4 @@ +import ../LangEus.gf + +gt PhrUtt NoPConj (UttS (UseCl (TTAnt ? ?) PPos (PredVP (UsePron ?) (ComplSlash (Slash3V3 give_V3 (DetCN (DetQuant DefArt NumSg) (UseN car_N))) (UsePron ?))))) NoVoc | l -bind +gt PhrUtt NoPConj (UttS (UseCl (TTAnt ? ?) PPos (PredVP (UsePron ?) (ComplSlash (Slash3V3 give_V3 (DetCN (DetQuant DefArt NumPl) (UseN car_N))) (UsePron ?))))) NoVoc | l -bind diff --git a/src/basque/tests/ukanDu.gfs b/src/basque/tests/ukanDu.gfs new file mode 100644 index 000000000..2de213779 --- /dev/null +++ b/src/basque/tests/ukanDu.gfs @@ -0,0 +1,6 @@ +import ../LangEus.gf + +gt UseCl (TTAnt ? ?) PPos (PredVP (UsePron ?) (ComplSlash (SlashV2a see_V2) (UsePron ?))) | l + +-- Inside a relative clause +gt UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVS know_VS (UseCl (TTAnt ? ?) PPos (PredVP (UsePron ?) (ComplSlash (SlashV2a see_V2) (UsePron ?)))))) | l -bind \ No newline at end of file diff --git a/src/basque/tests/ukanZaio.gfs b/src/basque/tests/ukanZaio.gfs new file mode 100644 index 000000000..7fee11fbd --- /dev/null +++ b/src/basque/tests/ukanZaio.gfs @@ -0,0 +1,7 @@ +import ../LangEus.gf + +gt UseCl (TTAnt ? ?) PPos (PredVP (UsePron ?) (ComplSlash (SlashV2a like_V2) (UsePron ?))) | l + + +-- Inside a relative clause +gt UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVS know_VS (UseCl (TTAnt ? ?) PPos (PredVP (UsePron ?) (ComplSlash (SlashV2a like_V2) (UsePron ?)))))) | l -bind \ No newline at end of file