forked from GitHub/gf-rgl
Add Basque to the RGL
This commit is contained in:
@@ -31,6 +31,7 @@ langsCoding = [
|
||||
(("afrikaans","Afr"),""),
|
||||
(("amharic", "Amh"),""),
|
||||
(("arabic", "Ara"),""),
|
||||
(("basque", "Eus"),""),
|
||||
(("bulgarian","Bul"),""),
|
||||
(("catalan", "Cat"),"Romance"),
|
||||
(("chinese", "Chi"),""),
|
||||
@@ -80,19 +81,19 @@ langsLang = langs `except` langsIncomplete
|
||||
langsPresent = langsLang `except` ["Chi","Est","Gre","Heb","Jpn","Mlt","Nep","Pes","Snd","Tha","Thb"]
|
||||
|
||||
-- languages for which Lang can be compiled but which are incomplete
|
||||
langsIncomplete = ["Amh","Ara","Heb","Lat","Tur","Thb"]
|
||||
langsIncomplete = ["Amh","Ara","Eus","Heb","Lat","Tur","Thb"]
|
||||
|
||||
-- languages for which to compile Try
|
||||
langsAPI = langsLang `except` langsIncomplete
|
||||
|
||||
-- languages for which to compile Symbolic
|
||||
langsSymbolic = langsLang `except` (langsIncomplete ++ ["Afr","Ina","Jpn","Nep","Pnb","Snd", "Thb"])
|
||||
langsSymbolic = langsLang `except` (langsIncomplete ++ ["Afr","Ina","Nep","Pnb","Snd", "Thb"])
|
||||
|
||||
-- languages for which to compile minimal Syntax
|
||||
langsMinimal = langs `only` ["Ara","Eng","Bul","Rus"]
|
||||
|
||||
-- languages for which to run treebank test
|
||||
langsTest = langsLang `except` ["Ara","Bul","Cat","Hin","Lav","Rus","Spa","Tha","Thb"]
|
||||
langsTest = langsLang `except` ["Ara","Bul","Cat","Eus","Hin","Lav","Rus","Spa","Tha","Thb"]
|
||||
|
||||
-- languages for which to run demo test
|
||||
langsDemo = langsLang `except` ["Ara","Hin","Ina","Lat","Lav","Tha","Thb"]
|
||||
|
||||
7
src/api/CombinatorsEus.gf
Normal file
7
src/api/CombinatorsEus.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
--# -path=.:alltenses:prelude:../basque
|
||||
|
||||
resource CombinatorsEus = Combinators with
|
||||
(Cat = CatEus),
|
||||
(Structural = StructuralEus),
|
||||
(Noun = NounEus),
|
||||
(Constructors = ConstructorsEus) ** {} ;
|
||||
3
src/api/ConstructorsEus.gf
Normal file
3
src/api/ConstructorsEus.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsEus = Constructors with (Grammar = GrammarEus) ** open MissingEus in {} ;
|
||||
5
src/api/SymbolicEus.gf
Normal file
5
src/api/SymbolicEus.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../basque:../common:../abstract:../prelude
|
||||
|
||||
resource SymbolicEus = Symbolic with
|
||||
(Symbol = SymbolEus),
|
||||
(Grammar = GrammarEus) ;
|
||||
5
src/api/SyntaxEus.gf
Normal file
5
src/api/SyntaxEus.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
instance SyntaxEus of Syntax =
|
||||
ConstructorsEus, CatEus, StructuralEus, CombinatorsEus ;
|
||||
|
||||
3
src/api/TryEus.gf
Normal file
3
src/api/TryEus.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:../basque:../common:../abstract:../prelude
|
||||
|
||||
resource TryEus = SyntaxEus, LexiconEus, ParadigmsEus - [mkAdv,mkAdN,mkDet,mkQuant,mkPConj] ;
|
||||
592
src/basque/AditzTrinkoak.gf
Normal file
592
src/basque/AditzTrinkoak.gf
Normal file
@@ -0,0 +1,592 @@
|
||||
resource AditzTrinkoak = open Prelude, Predef, ParamEus in {
|
||||
|
||||
-- Synthetic verbs are in this module
|
||||
|
||||
-- I have not implemented allocutive forms.
|
||||
-- For that I'd have to keep track of up to S whether there is somewhere a familiar 2nd person
|
||||
-- (e.g. "I am afraid of you/your mother"; "You(r mother) is nice", "I gave an apple to you(r mother)"),
|
||||
-- and that affects the verb form of a main clause, regardless who is subject/object there.
|
||||
|
||||
oper
|
||||
|
||||
VForms : Type = { indep : Str ; stem : Str } ;
|
||||
|
||||
noVForm : VForms = { indep = Prelude.nonExist ; stem = Prelude.nonExist } ;
|
||||
|
||||
-- Obs. this is pretty rough heuristic, use 2-argument version for good results
|
||||
mkVForms = overload {
|
||||
mkVForms : Str -> VForms = \du ->
|
||||
let due : Str = case du of {
|
||||
_ + "en" => init du ; -- zen / zen
|
||||
_ + "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
|
||||
-- _ + ("e"|"i"|"o"|"a")
|
||||
-- => du ; -- dio / dio+n
|
||||
|
||||
-- _ => du + "e" }
|
||||
_ => du }
|
||||
in { indep = du ; stem = due } ;
|
||||
|
||||
mkVForms : (_,_ : Str) -> VForms = \dut,duda ->
|
||||
{ indep = dut ; stem = duda } ;
|
||||
} ;
|
||||
|
||||
IntransV : Type = Tense => Agr => VForms ; -- Agr = nori or nork
|
||||
TransV : Type = Agr => IntransV ; -- Agr = nor
|
||||
DitransV : Type = Agr => TransV ; -- Agr = nori
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
syntIntransVerb : AuxType -> IntransV = \val ->
|
||||
case val of {
|
||||
Da Izan => izanDa ;
|
||||
Da Egon => egonDa ;
|
||||
Da Joan => joanDa ;
|
||||
Da Ibili => ibiliDa ;
|
||||
Da Etorri => etorriDa ;
|
||||
_ => Predef.error "Not an intransitive verb"
|
||||
} ;
|
||||
|
||||
syntTransVerb : AuxType -> TransV = \val ->
|
||||
case val of {
|
||||
Du Ukan => ukanDu ;
|
||||
Du Jakin => jakinDu ;
|
||||
Du Eduki => edukiDu ;
|
||||
Zaio => ukanZaio ;
|
||||
_ => Predef.error "Not a transitive verb"
|
||||
} ;
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- General building blocks for the forms of ukan
|
||||
-- All thanks to https://upload.wikimedia.org/wikipedia/commons/3/36/Nor_Nori_Nork_taula_osoa.png
|
||||
|
||||
norkUkanFirst : Agr => Str = table { -- Past, pot, cond etc.
|
||||
Ni => "n" ; Gu => "gen" ;
|
||||
Hi _ => "h" ;
|
||||
Zu => "zen" ; Zuek => "zen" ;
|
||||
Hau => "z" ; Hauek => "z" } ;
|
||||
|
||||
norkUkanLast : Agr => Str = table {
|
||||
Ni => "t" ; Gu => "gu" ;
|
||||
Hi Masc => "k" ; Hi Fem => "n" ;
|
||||
Zu => "zu" ; Zuek => "zue" ;
|
||||
Hau => [] ; Hauek => "te" } ;
|
||||
|
||||
norkUkanMid : Agr => Str = table {
|
||||
Hi Masc => "a" ; Hi Fem => "na" ;
|
||||
Ni => "da" ; x => norkUkanLast ! x } ;
|
||||
|
||||
noriUkanLast : Agr => Str = table {
|
||||
Hau => "o" ; x => norkUkanLast ! x } ;
|
||||
|
||||
noriUkanMid : Agr => Str = table {
|
||||
Hau => "o" ; Hauek => "e" ;
|
||||
x => norkUkanMid ! x } ;
|
||||
|
||||
norUkanPres : Agr => Str = table {
|
||||
Ni => "nau" ; Gu => "gaitu" ;
|
||||
Hi _ => "hau" ;
|
||||
Zu => "zaitu" ; Zuek => "zaituzte" ;
|
||||
Hau => "du" ; Hauek => "ditu" } ;
|
||||
|
||||
norUkanNonpres : Agr => Str = table {
|
||||
Ni => "nindu" ; Gu => "gintu" ;
|
||||
Hi _ => "hindu" ;
|
||||
Zu => "zintu" ; Zuek => "zintuzte" ;
|
||||
Hau => nonExist ; Hauek => nonExist } ; -- formed separately
|
||||
|
||||
norUkanCond : Agr => Str = table {
|
||||
Zuek => "zintu" ; x => norUkanNonpres ! x } ;
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Izan [NOR]
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
-- common copula
|
||||
izanDa : IntransV =
|
||||
table {Past => table {Ni => mkVForms "nintzen" ;
|
||||
Hi _ => mkVForms "hintzen" ;
|
||||
Zu => mkVForms "zinen" ;
|
||||
Hau => mkVForms "zen" ;
|
||||
Gu => mkVForms "ginen" ;
|
||||
Zuek => mkVForms "zineten" ;
|
||||
Hauek => mkVForms "ziren" } ;
|
||||
|
||||
Cond => table {Ni => mkVForms "nintzateke" ;
|
||||
Hi _ => mkVForms "hintzateke" ;
|
||||
Zu => mkVForms "zinateke" ;
|
||||
Hau => mkVForms "litzateke" ;
|
||||
Gu => mkVForms "ginateke" ;
|
||||
Zuek => mkVForms "zinatekete" ;
|
||||
Hauek => mkVForms "lirateke" } ;
|
||||
-- Present and future are identical
|
||||
_ => table {Ni => mkVForms "naiz" ;
|
||||
Hi _ => mkVForms "haiz" ;
|
||||
Zu => mkVForms "zara" "zare" ;
|
||||
Hau => mkVForms "da" "de" ;
|
||||
Gu => mkVForms "gara" "gare" ;
|
||||
Zuek => mkVForms "zarete" ;
|
||||
Hauek => mkVForms "dira" "dire" }
|
||||
} ;
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Ukan [NOR] [NORK]
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
ukanDu : TransV = \\nor,tns,nork => mkVForms (
|
||||
case tns of {
|
||||
Past =>
|
||||
case nor of { -- Special forms for past when nor is Hau or Hauek
|
||||
Hau => norkPast_norHau ! nork ;
|
||||
Hauek => norkPast_norHauek ! nork ;
|
||||
_ => let nindu : Str = norPast ! nor ;
|
||||
te : Str = norkPast ! nork ;
|
||||
in nindu + te + "n" } ;
|
||||
|
||||
Cond =>
|
||||
case nor of { -- Special forms for conditional when nor is Hau or Hauek
|
||||
Hau => norkCond_norHau ! nork ;
|
||||
Hauek => norkCond_norHauek ! nork ;
|
||||
|
||||
_ => let gintu : Str = norCond ! nor ;
|
||||
z : Str = norCondZ ! nor ;
|
||||
te : Str = norkCond ! nork ;
|
||||
in gintu + z + "ke" + te } ;
|
||||
|
||||
pres => let gaitu : Str = norPres ! nor ;
|
||||
zte : Str = norkPres ! nork ;
|
||||
in gaitu + zte
|
||||
|
||||
}) where {
|
||||
|
||||
norkCond : Agr => Str = \\nork => case <nor,nork> of {
|
||||
<Zuek,y> => "te" + norkUkanLast ! y ; -- zintu z ke te t
|
||||
<_,x> => norkUkanLast ! x } ;
|
||||
|
||||
norkPres : Agr => Str = \\nork => case <nor,nork> of {
|
||||
<Gu,Hauek> => "zte" ; -- If Nork is Hauek and Nor is plural,
|
||||
<Zu,Hauek> => "zte" ; -- the morpheme "te" changes into "zte"
|
||||
<Hauek,Hauek> => "zte" ;
|
||||
<_,x> => norkUkanLast ! x } ;
|
||||
|
||||
norkPast : Agr => Str = \\nork => case <nor,nork> of {
|
||||
<Zuek,Hau> => "" ;
|
||||
<_,Hau> => "e" ;
|
||||
<Gu,Hauek> => "zte" ;
|
||||
<Zu,Hauek> => "zte" ;
|
||||
<Hauek,Hauek> => "zte" ;
|
||||
<_,x> => norkUkanMid ! x } ;
|
||||
|
||||
norPres : Agr => Str = norUkanPres ;
|
||||
|
||||
norPast : Agr => Str = norUkanNonpres ;
|
||||
|
||||
norCond : Agr => Str = norUkanCond ;
|
||||
|
||||
norCondZ : Agr => Str = table {
|
||||
(Gu|Zu|Zuek) => "z" ; _ => [] } ;
|
||||
|
||||
norkPast_norHau = table { Ni => "nuen" ; Gu => "genuen" ;
|
||||
Hi _ => "huen" ;
|
||||
Zu => "zenuen" ; Zuek => "zenuten" ;
|
||||
Hau => "zuen" ; Hauek => "zuten" } ;
|
||||
|
||||
norkPast_norHauek = table { Ni => "nituen" ; Gu => "genituen" ;
|
||||
Hi _ => "hituen" ;
|
||||
Zu => "zenituen" ; Zuek => "zenituzten" ;
|
||||
Hau => "zituen" ; Hauek => "zituzten" } ;
|
||||
|
||||
norkCond_norHau = table { Hi _ => "hinduke" ; Zuek => "zenukete" ;
|
||||
Hau => "luke" ; Hauek => "lukete" ;
|
||||
x => (tk 2 (norkPast_norHau ! x)) + "ke" } ; -- zu+en -> nu+ke
|
||||
|
||||
norkCond_norHauek = table { Hi _ => "hindukete" ; Zuek => "zenituzkete" ;
|
||||
Hau => "lituzke" ; Hauek => "lituzkete" ;
|
||||
x => (tk 2 (norkPast_norHauek ! x)) + "zke" } --nitu+en -> nitu+zke
|
||||
} ;
|
||||
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Ukan [NOR] [NORI]
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
|
||||
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 })
|
||||
|
||||
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) ;
|
||||
|
||||
------
|
||||
-- Map from Agr to morpheme in Nori position.
|
||||
|
||||
noriPres : Agr => Str = \\nori => case <nork,nori> of {
|
||||
<Hau,Ni> => "t" ; -- If nork is Hau, then the form ends in "t"
|
||||
<_,x> => noriUkanMid ! x } ;
|
||||
|
||||
noriPast : Agr => Str = noriUkanMid ;
|
||||
|
||||
------
|
||||
-- Map from Agr to morpheme in Nork position
|
||||
norkPres : Agr => Str = norkUkanLast ;
|
||||
|
||||
norkPast : Agr => Str = norkUkanFirst ;
|
||||
|
||||
norkPastTe : Agr => Str = table {
|
||||
(Zuek|Hauek) => "te" ; _ => [] }
|
||||
|
||||
} ;
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Egon
|
||||
=============================================================================
|
||||
-}
|
||||
-- stative copula, like Spanish estar
|
||||
egonDa : IntransV =
|
||||
table { Past => table {
|
||||
Ni => mkVForms "nengoen" ;
|
||||
Hi _ => mkVForms "hengoen" ;
|
||||
Zu => mkVForms "zeunden" ;
|
||||
Hau => mkVForms "zegoen" ;
|
||||
Gu => mkVForms "geunden" ;
|
||||
Zuek => mkVForms "zeundeten" ;
|
||||
Hauek => mkVForms "zeuden" } ;
|
||||
_ => table {
|
||||
Ni => mkVForms "nago" ;
|
||||
Hi _ => mkVForms "hago" ;
|
||||
Zu => mkVForms "zaude" ;
|
||||
Hau => mkVForms "dago" ;
|
||||
Gu => mkVForms "gaude" ;
|
||||
Zuek => mkVForms "zaudete" ;
|
||||
Hauek => mkVForms "daude" }
|
||||
} ;
|
||||
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Eduki
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
edukiDu : TransV = table {
|
||||
-- Nor,Nork
|
||||
Ni => table {
|
||||
Pres => table {
|
||||
Gu => noVForm ;
|
||||
Hauek => mkVForms "naukate" ;
|
||||
Ni => noVForm ;
|
||||
Zuek => mkVForms "naukazue" ;
|
||||
Hau => mkVForms "nauka" ;
|
||||
Hi Masc => mkVForms "naukak" ;
|
||||
Hi Fem => mkVForms "naukan" ;
|
||||
Zu => mkVForms "naukazu" } ;
|
||||
tns => \\agr => ukanDu ! Ni ! tns ! agr
|
||||
|
||||
} ;
|
||||
Gu => table {
|
||||
Pres => table { -- Pres
|
||||
Gu => noVForm ;
|
||||
Hauek => mkVForms "gauzkate" ;
|
||||
Ni => noVForm ;
|
||||
Zuek => mkVForms "gauzkazue" ;
|
||||
Hau => mkVForms "gauzka" ;
|
||||
Hi _ => noVForm ;
|
||||
Zu => mkVForms "gauzkazu" } ;
|
||||
tns => \\agr => ukanDu ! Ni ! tns ! agr
|
||||
} ;
|
||||
Hauek => table {
|
||||
Pres => table { -- Pres
|
||||
Gu => mkVForms "dauzkagu" ;
|
||||
Hauek => mkVForms "dauzkate" ;
|
||||
Ni => mkVForms "dauzkat" ;
|
||||
Zuek => mkVForms "dauzkazue" ;
|
||||
Hau => mkVForms "dauzka" ;
|
||||
Hi Masc => mkVForms "dauzkak" ;
|
||||
Hi Fem => mkVForms "dauzkan" ;
|
||||
Zu => mkVForms "dauzkazu" } ;
|
||||
tns => \\agr => ukanDu ! Ni ! tns ! agr
|
||||
} ;
|
||||
Zuek => table {
|
||||
Pres => table {
|
||||
Gu => mkVForms "zauzkategu" ;
|
||||
Hauek => mkVForms "zauzkatete" ;
|
||||
Ni => mkVForms "zauzkatet" ;
|
||||
Zuek => noVForm ;
|
||||
Hau => mkVForms "zauzkate" ;
|
||||
Hi _ => noVForm ;
|
||||
Zu => noVForm } ;
|
||||
tns => \\agr => ukanDu ! Ni ! tns ! agr
|
||||
} ;
|
||||
Hau => table {
|
||||
Pres => table {
|
||||
Gu => mkVForms "daukagu" ;
|
||||
Hauek => mkVForms "daukate" ;
|
||||
Ni => mkVForms "daukat" ;
|
||||
Zuek => mkVForms "daukazue" ;
|
||||
Hau => mkVForms "dauka" ;
|
||||
Hi Masc => mkVForms "daukak" ;
|
||||
Hi Fem => mkVForms "daukan" ;
|
||||
Zu => mkVForms "daukazu" } ;
|
||||
tns => \\agr => ukanDu ! Ni ! tns ! agr
|
||||
} ;
|
||||
Hi _ => table {
|
||||
Pres => table {
|
||||
Gu => mkVForms "haukagu" ;
|
||||
Hauek => mkVForms "haukate" ;
|
||||
Ni => mkVForms "haukat" ;
|
||||
Zuek => noVForm ;
|
||||
Hau => mkVForms "hauka" ;
|
||||
Hi _ => noVForm ;
|
||||
Zu => noVForm } ;
|
||||
tns => \\agr => ukanDu ! Ni ! tns ! agr
|
||||
} ;
|
||||
Zu => table {
|
||||
Pres => table {
|
||||
Gu => mkVForms "zauzkagu" ;
|
||||
Hauek => noVForm ;
|
||||
Ni => mkVForms "zauzkat" ;
|
||||
Zuek => noVForm ;
|
||||
Hau => mkVForms "zauzka" ;
|
||||
Hi _ => noVForm ;
|
||||
Zu => noVForm } ;
|
||||
tns => \\agr => ukanDu ! Ni ! tns ! agr
|
||||
}
|
||||
} ;
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Etorri
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
etorriDa : IntransV =
|
||||
\\tns,subjAgr =>
|
||||
case <tns,subjAgr> of {
|
||||
<Pres,Ni> => mkVForms "nator" ;
|
||||
<Pres,Hi _> => mkVForms "hator" ;
|
||||
<Pres,Zu> => mkVForms "zatoz" ;
|
||||
<Pres,Hau> => mkVForms "dator" ;
|
||||
<Pres,Gu> => mkVForms "gatoz" ;
|
||||
<Pres,Zuek> => mkVForms "zatozte" ;
|
||||
<Pres,Hauek> => mkVForms "datoz" ;
|
||||
_ => izanDa ! tns ! subjAgr
|
||||
} ;
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Joan
|
||||
=============================================================================
|
||||
-}
|
||||
joanDa : IntransV =
|
||||
\\tns,subjAgr =>
|
||||
case <tns,subjAgr> of {
|
||||
<Pres,Ni> => mkVForms "noa" ;
|
||||
<Pres,Hi _> => mkVForms "hoa" ;
|
||||
<Pres,Zu> => mkVForms "zoaz" ;
|
||||
<Pres,Hau> => mkVForms "doa" ;
|
||||
<Pres,Gu> => mkVForms "goaz" ;
|
||||
<Pres,Zuek> => mkVForms "zoazte" ;
|
||||
<Pres,Hauek> => mkVForms "doaz" ;
|
||||
<Past,Ni> => mkVForms "nindoan" ;
|
||||
<Past,Hi _> => mkVForms "hindoan" ;
|
||||
<Past,Zu> => mkVForms "zindoazen" ;
|
||||
<Past,Hau> => mkVForms "zihoan" ;
|
||||
<Past,Gu> => mkVForms "gindoazen" ;
|
||||
<Past,Zuek> => mkVForms "zindoazten" ;
|
||||
<Past,Hauek> => mkVForms "zihoazen" ;
|
||||
|
||||
_ => izanDa ! tns ! subjAgr
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Ekarri
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Ibili
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
|
||||
ibiliDa : IntransV = --TODO: check forms
|
||||
table {
|
||||
Past => table {
|
||||
Ni => mkVForms "nenbilen" ;
|
||||
Hi _ => mkVForms "henbilen" ;
|
||||
Zu => mkVForms "zenbiltzan" ;
|
||||
Hau => mkVForms "zebilen" ;
|
||||
Gu => mkVForms "genbiltzan" ;
|
||||
Zuek => mkVForms "zenbiltzaten" ;
|
||||
Hauek => mkVForms "zebiltzan" } ;
|
||||
|
||||
-- Present and future are identical
|
||||
Cond => table {
|
||||
Ni => mkVForms "nenbilke" ;
|
||||
Hi _ => mkVForms "henbilke" ;
|
||||
Zu => mkVForms "zenbilzke" ;
|
||||
Hau => mkVForms "lebilke" ;
|
||||
Gu => mkVForms "genbiltzke" ;
|
||||
Zuek => mkVForms "zenbiltzketen" ;
|
||||
Hauek => mkVForms "lebilzke" } ;
|
||||
|
||||
Pres => table {
|
||||
Ni => mkVForms "nabil" ;
|
||||
Hi _ => mkVForms "habil" ;
|
||||
Zu => mkVForms "zabiltza" ;
|
||||
Hau => mkVForms "dabil" ;
|
||||
Gu => mkVForms "gabiltza" ;
|
||||
Zuek => mkVForms "zabiltzate" ;
|
||||
Hauek => mkVForms "dabiltza" } ;
|
||||
Fut => izanDa ! Fut
|
||||
} ;
|
||||
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Jakin
|
||||
=============================================================================
|
||||
-}
|
||||
jakinDu : TransV =
|
||||
\\dobjAgr,tns,subjAgr =>
|
||||
case <dobjAgr,tns,subjAgr> of {
|
||||
<Hau,Pres,Ni> => mkVForms "dakit" ;
|
||||
<Hau,Pres,Zu> => mkVForms "dakizu" ;
|
||||
<Hau,Pres,Hau> => mkVForms "daki" ;
|
||||
<Hau,Pres,Gu> => mkVForms "dakigu" ;
|
||||
<Hau,Pres,Zuek> => mkVForms "dakizue" ;
|
||||
<Hau,Pres,Hauek> => mkVForms "dakite" ;
|
||||
|
||||
<Hau,Past,Ni> => mkVForms "nekien" ;
|
||||
<Hau,Past,Zu> => mkVForms "zenekien" ;
|
||||
<Hau,Past,Hau> => mkVForms "zekien" ;
|
||||
<Hau,Past,Gu> => mkVForms "genekien" ;
|
||||
<Hau,Past,Zuek> => mkVForms "zenekiten" ;
|
||||
<Hau,Past,Hauek> => mkVForms "zekiten" ;
|
||||
|
||||
_ => ukanDu ! dobjAgr ! tns ! subjAgr
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Ibili
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Eman
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Esan
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Ikusi
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Erabili
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
{-
|
||||
=============================================================================
|
||||
Egin
|
||||
=============================================================================
|
||||
-}
|
||||
|
||||
}
|
||||
71
src/basque/AdjectiveEus.gf
Normal file
71
src/basque/AdjectiveEus.gf
Normal file
@@ -0,0 +1,71 @@
|
||||
concrete AdjectiveEus of Adjective = CatEus ** open ResEus, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
-- The principal ways of forming an adjectival phrase are
|
||||
-- positive, comparative, relational, reflexive-relational, and
|
||||
-- elliptic-relational.
|
||||
|
||||
-- : A -> AP ;
|
||||
PositA a = a ** {
|
||||
s = 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 ;
|
||||
typ = Bare } ;
|
||||
|
||||
-- : A2 -> NP -> AP ; -- married to her
|
||||
ComplA2 a2 np = a2 ** {
|
||||
s = 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 ;
|
||||
typ = Bare } ;
|
||||
|
||||
-- : A2 -> AP ; -- married
|
||||
UseA2 = PositA ;
|
||||
|
||||
-- : A -> AP ; -- warmer
|
||||
UseComparA a = a ** {
|
||||
s = 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 } ;
|
||||
|
||||
-- The superlative use is covered in $Ord$.
|
||||
|
||||
-- : Ord -> AP ; -- warmest
|
||||
AdjOrd ord = ord ** {
|
||||
ph = FinalCons ; --always ends in -en
|
||||
typ = Bare } ;
|
||||
|
||||
-- Sentence and question complements defined for all adjectival
|
||||
-- phrases, although the semantics is only clear for some adjectives.
|
||||
|
||||
-- : AP -> SC -> AP ; -- good that she is here
|
||||
SentAP ap sc = ap ; --TODO
|
||||
|
||||
-- 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 } ;
|
||||
|
||||
|
||||
-- It can also be postmodified by an adverb, typically a prepositional phrase.
|
||||
|
||||
-- : AP -> Adv -> AP ; -- warm by nature
|
||||
AdvAP ap adv = ap ; --TODO
|
||||
|
||||
|
||||
|
||||
}
|
||||
43
src/basque/AdverbEus.gf
Normal file
43
src/basque/AdverbEus.gf
Normal file
@@ -0,0 +1,43 @@
|
||||
concrete AdverbEus of Adverb = CatEus ** open ResEus, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
-- : A -> Adv ;
|
||||
PositAdvAdj adj = { s = adj.s ! AAdv } ; --TODO: check
|
||||
|
||||
-- : CAdv -> A -> NP -> Adv ; -- more warmly than John
|
||||
ComparAdvAdj cadv a np = { s = np.s ! Abs ++ cadv.s ++ a.s ! AAdv } ;
|
||||
|
||||
-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
|
||||
|
||||
-- : Prep -> NP -> Adv ;
|
||||
PrepNP post np = { s = ResEus.applyPost post np } ;
|
||||
|
||||
-- Adverbs can be modified by 'adadjectives', just like adjectives.
|
||||
|
||||
--AdAdv : AdA -> Adv -> Adv ; -- very quickly
|
||||
AdAdv ada adv = { s = ada.s ++ adv.s } ;
|
||||
-- Like adverbs, adadjectives can be produced by adjectives.
|
||||
|
||||
-- : A -> AdA ; -- extremely
|
||||
PositAdAAdj a = { s = a.s ! AF Posit ++ BIND ++ "an" } ; --TODO check
|
||||
-- Subordinate clauses can function as adverbs.
|
||||
|
||||
--: Subj -> S -> Adv ;
|
||||
SubjS subj s =
|
||||
let auxFull : Str =
|
||||
if_then_Str subj.isPre (glue subj.s s.s.aux.indep) -- badator
|
||||
(glue s.s.aux.stem subj.s) ; -- datorrenean
|
||||
|
||||
in { s = s.s.beforeAux ++ auxFull ++ s.s.afterAux } ;
|
||||
|
||||
-- Comparison adverbs also work as numeral adverbs.
|
||||
|
||||
--AdnCAdv : CAdv -> AdN ; -- less (than five)
|
||||
--AdnCAdv cadv = {s = } ;
|
||||
} ;
|
||||
|
||||
{-
|
||||
gt PrepNP in_Prep (DetCN (DetQuant DefArt ?) (UseN ?) | l -bind
|
||||
gt PrepNP from_Prep (DetCN (DetQuant DefArt ?) (UseN ?)) | l -bind
|
||||
-}
|
||||
6
src/basque/AllEus.gf
Normal file
6
src/basque/AllEus.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete AllEus of AllEusAbs =
|
||||
LangEus,
|
||||
ExtraEus
|
||||
** {} ;
|
||||
6
src/basque/AllEusAbs.gf
Normal file
6
src/basque/AllEusAbs.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
abstract AllEusAbs =
|
||||
Lang,
|
||||
ExtraEusAbs
|
||||
** {} ;
|
||||
131
src/basque/CatEus.gf
Normal file
131
src/basque/CatEus.gf
Normal file
@@ -0,0 +1,131 @@
|
||||
concrete CatEus of Cat = CommonX ** open ResEus, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
|
||||
--2 Sentences and clauses
|
||||
-- Constructed in SentenceEus, and also in IdiomEus
|
||||
|
||||
S = { s : ResEus.Sentence } ; --must keep words separate, because we may add Subj particles for Adv
|
||||
QS = { s : ClType => ResEus.Sentence } ;
|
||||
RS = { s : Agr => Str }; -- relative sentence. Tense and polarity fixed,
|
||||
-- but agreement may depend on the CN/NP it modifies:
|
||||
-- `gorriak diren txakurrak' vs. `gorria den txakurra'
|
||||
-- mutil|ak| maite |du|en neska / mutil|ak| maite |ditu|en nesk|ak|
|
||||
-- mutil|ek| maite |dute|n nesk|a| / mutil|ek| maite |ditute|n nesk|ak|
|
||||
-- neska maite duen mutila / neskak maite dituen mutila / neska maite duten mutilak / neskak maite dituten mutilak
|
||||
|
||||
Cl = ResEus.Clause ;
|
||||
ClSlash = ResEus.ClSlash ;
|
||||
SSlash = { s : ResEus.Sentence } ; -- sentence missing NP e.g. "she has looked at"
|
||||
Imp = { s : Str } ; -- imperative e.g. "look at this"
|
||||
|
||||
--2 Questions and interrogatives
|
||||
|
||||
-- Constructed in QuestionEus.
|
||||
|
||||
QCl = ResEus.Clause ;
|
||||
IP = ResEus.NounPhrase ;
|
||||
IComp = { s : Str } ; -- interrogative complement of copula e.g. "where"
|
||||
IDet = ResEus.Determiner ; -- interrogative determiner e.g. "how many"
|
||||
IQuant = ResEus.Quant ; -- interrogative quantifier e.g. "which"
|
||||
|
||||
|
||||
|
||||
|
||||
--2 Relative clauses and pronouns
|
||||
|
||||
-- Constructed in RelativeEus.
|
||||
|
||||
RCl = ResEus.RClause ;
|
||||
RP = { s : Str } ;
|
||||
|
||||
|
||||
|
||||
--2 Verb phrases
|
||||
|
||||
-- Constructed in VerbEus.
|
||||
|
||||
VP = ResEus.VerbPhrase ;
|
||||
VPSlash = ResEus.VPSlash ;
|
||||
Comp = ResEus.Complement ;
|
||||
|
||||
|
||||
--2 Adjectival phrases
|
||||
|
||||
-- Constructed in AdjectiveEus.
|
||||
|
||||
AP = ResEus.AdjPhrase ;
|
||||
|
||||
|
||||
--2 Nouns and noun phrases
|
||||
|
||||
-- Constructed in NounEus.
|
||||
-- Many atomic noun phrases e.g. "everybody"
|
||||
-- are constructed in StructuralEus.
|
||||
-- The determiner structure is
|
||||
-- ``` Predet (QuantSg | QuantPl Num) Ord
|
||||
-- as defined in NounEus.
|
||||
|
||||
CN = ResEus.CNoun ;
|
||||
NP = ResEus.NounPhrase ;
|
||||
Pron = ResEus.Pronoun ; --Pronouns need enough info to turn it into NP or Quant.
|
||||
Det = ResEus.Determiner ;
|
||||
Predet = {s : Str} ;
|
||||
Quant = ResEus.Quant ;
|
||||
Num = { s : Str ; n : Number ; isNum : Bool } ;
|
||||
Card, Ord = { s : Str ; n : Number } ;
|
||||
DAP = ResEus.Determiner ;
|
||||
|
||||
|
||||
--2 Numerals
|
||||
|
||||
-- Constructed in NumeralEus.
|
||||
|
||||
Numeral = { s : Str ; n : Number } ;
|
||||
Digits = { s : CardOrd => Str ; n : Number } ;
|
||||
|
||||
|
||||
|
||||
--2 Structural words
|
||||
|
||||
-- Constructed in StructuralEus.
|
||||
Conj = { s1,s2 : Str ; nbr : Number } ; --Ni eta Inari gara/*naiz ; Fran edo Mikel da/*dira
|
||||
Subj = { s : Str ; isPre : Bool } ; --ba+dut vs. dut+en
|
||||
Prep = ResEus.Postposizio ;
|
||||
|
||||
|
||||
|
||||
--2 Words of open classes
|
||||
|
||||
-- These are constructed in LexiconEus and in
|
||||
-- additional lexicon modules.
|
||||
|
||||
V,
|
||||
V2,
|
||||
V3,
|
||||
VV, -- verb-phrase-complement verb e.g. "want"
|
||||
VS, -- sentence-complement verb e.g. "claim"
|
||||
VQ, -- question-complement verb e.g. "wonder"
|
||||
VA, -- adjective-complement verb e.g. "look"
|
||||
V2V, -- verb with NP and V complement e.g. "cause"
|
||||
V2S, -- verb with NP and S complement e.g. "tell"
|
||||
V2Q, -- verb with NP and Q complement e.g. "ask"
|
||||
V2A = ResEus.Verb ; -- verb with NP and AP complement e.g. "paint"
|
||||
|
||||
A = ResEus.Adjective ;
|
||||
A2 = ResEus.Adjective2 ;
|
||||
|
||||
N = ResEus.Noun ;
|
||||
N2 = ResEus.Noun2 ;
|
||||
N3 = ResEus.Noun3 ;
|
||||
PN = ResEus.PNoun ;
|
||||
|
||||
|
||||
linref
|
||||
S = \s -> linS s.s ;
|
||||
Cl = linCl ;
|
||||
VP = linVP ;
|
||||
CN = linCNIndef ;
|
||||
}
|
||||
147
src/basque/ConjunctionEus.gf
Normal file
147
src/basque/ConjunctionEus.gf
Normal file
@@ -0,0 +1,147 @@
|
||||
concrete ConjunctionEus of Conjunction =
|
||||
CatEus ** open ResEus, Coordination, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
{- Conjunction for category X needs four things:
|
||||
lincat [X]
|
||||
lin BaseX
|
||||
lin ConsX
|
||||
lin ConjX
|
||||
|
||||
For example, if X is defined as
|
||||
|
||||
lincat X = {s : Number => Str ; g : Gender} ;
|
||||
|
||||
then [X] will split its s field into two, and retain its other fields as is:
|
||||
|
||||
lincat [X] = {s1,s2 : Number => Str ; g : Gender} ;
|
||||
|
||||
Let us look at a simple case: Adv is of type {s : Str}
|
||||
Then [Adv] is {s1,s2 : Str}.
|
||||
BaseAdv, ConsAdv and ConjAdv can all use functions defined in prelude/Coordination:
|
||||
|
||||
BaseAdv = twoSS ;
|
||||
ConsAdv = consrSS comma ;
|
||||
ConjAdv = conjunctSS ;
|
||||
|
||||
--}
|
||||
|
||||
|
||||
-- Adverb and other simple {s : Str} types.
|
||||
lincat
|
||||
[Adv],[AdV],[IAdv] = {s1,s2 : Str} ;
|
||||
|
||||
lin
|
||||
BaseAdv, BaseAdV, BaseIAdv = twoSS ;
|
||||
ConsAdv, ConsAdV, ConsIAdv = consrSS comma ;
|
||||
ConjAdv, ConjAdV, ConjIAdv = conjunctDistrSS ;
|
||||
|
||||
|
||||
-- RS depends on agreement, otherwise exactly like previous.
|
||||
lincat
|
||||
[RS] = {s1,s2 : Agr => Str } ;
|
||||
|
||||
lin
|
||||
BaseRS x y = twoTable Agr x y ;
|
||||
ConsRS xs x = consrTable Agr comma xs x ;
|
||||
ConjRS co xs = conjunctDistrTable Agr co xs ;
|
||||
|
||||
-- S has three building blocks; we keep only the last one's aux open,
|
||||
-- and choose the independent form to all the rest.
|
||||
-- Produces ungrammatical results for adverbial usage of conj sentences, e.g.
|
||||
-- "when [the dog runs and you sleep], I drink beer"
|
||||
lincat
|
||||
[S] = { s : Sentence } ** { firstSent : Str } ;
|
||||
|
||||
lin
|
||||
BaseS x y =
|
||||
y ** { firstSent = linS x.s } ;
|
||||
|
||||
ConsS x xs =
|
||||
xs ** { firstSent = linS x.s ++ "," ++ xs.firstSent } ;
|
||||
|
||||
-- Combine the finished sentences all into the beforeAux part of the S
|
||||
ConjS co xs =
|
||||
{ s = xs.s ** {beforeAux = co.s1 ++ xs.firstSent ++ co.s2 ++ xs.s.beforeAux} } ;
|
||||
|
||||
|
||||
|
||||
|
||||
-- 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 } ;
|
||||
|
||||
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 ;
|
||||
|
||||
lincat
|
||||
[CN] = { s1,s2 : Agr => Str } ** CNLight ;
|
||||
|
||||
lin
|
||||
BaseCN = baseCN ; -- phono=FinalA words work correctly now!
|
||||
ConsCN = consCN ;
|
||||
ConjCN co cs = conjunctDistrTable Agr co cs ** cs ;
|
||||
|
||||
oper
|
||||
CNLight : Type = { heavyMod : Agr => Str ; comp : Str ; ph : Phono ; anim : Bizi } ;
|
||||
|
||||
-- Use linCNIndef so that words with FinalA get the -a at the end
|
||||
baseCN : CN -> CN -> [CN] = \x,y ->
|
||||
y ** --choose all the other fields from second argument
|
||||
{ s1 = \\agr => linCNIndef x ;
|
||||
s2 = y.s } ;
|
||||
|
||||
consCN : CN -> [CN] -> [CN] = \x,xs ->
|
||||
xs ** --choose all the other fields from the list
|
||||
{ s1 = \\agr => linCNIndef x ++ SOFT_BIND
|
||||
++ comma ++ xs.s1 ! agr } ;
|
||||
|
||||
|
||||
lincat
|
||||
[DAP] = Determiner ** { pref2 : Str } ;
|
||||
|
||||
lin
|
||||
BaseDAP x y = x ** { pref2 = y.pref } ;
|
||||
ConsDAP xs x = xs ** { pref2 = x.pref } ;
|
||||
ConjDet conj xs = xs ** { pref = conj.s1 ++ xs.pref ++ conj.s2 ++ xs.pref2 } ;
|
||||
-- his or some car: haren edo zenbait auto &+ a
|
||||
-- TODO: "the or some car"
|
||||
|
||||
|
||||
-- Noun phrases. Should work better now.
|
||||
lincat
|
||||
[NP] = { s1,s2 : Case => Str } ** NPLight ;
|
||||
|
||||
lin
|
||||
BaseNP x y = twoTable Case x y ** consNP x y ;
|
||||
ConsNP xs x = consrTable Case comma xs x ** consNP xs x ;
|
||||
ConjNP conj xs = conjunctNPTable conj xs ** conjNP xs conj ;
|
||||
|
||||
oper
|
||||
|
||||
--NP without the s field; just to avoid copypaste and make things easier to change
|
||||
NPLight : Type = { stem : Str ; agr : Agr ; anim : Bizi ; isDef : Bool } ;
|
||||
|
||||
consNP : NPLight -> NPLight -> NPLight = \x,y ->
|
||||
x ** { agr = conjAgr x.agr (getNum y.agr) } ;
|
||||
|
||||
conjNP : NPLight -> Conj -> NPLight = \xs,conj ->
|
||||
xs ** { agr = conjAgr xs.agr conj.nbr } ;
|
||||
|
||||
-- Like conjunctTable from prelude/Coordination.gf,
|
||||
-- but forces the first argument into absolutive.
|
||||
conjunctNPTable : Conj -> ListTable Case -> {s : Case => Str} = \co,xs ->
|
||||
{ s = table { Erg => co.s1 ++ xs.s1 ! Erg ++ co.s2 ++ xs.s2 ! Erg ;
|
||||
cas => co.s1 ++ xs.s1 ! Abs ++ co.s2 ++ xs.s2 ! cas } } ;
|
||||
|
||||
conjAgr : Agr -> Number -> Agr = \a,n ->
|
||||
case n of { Pl => plAgr a ; _ => a } ;
|
||||
|
||||
conjNbr : Number -> Number -> Number = \n,m ->
|
||||
case n of { Pl => Pl ; _ => m } ;
|
||||
|
||||
}
|
||||
119
src/basque/ConstructionEus.gf
Normal file
119
src/basque/ConstructionEus.gf
Normal file
@@ -0,0 +1,119 @@
|
||||
concrete ConstructionEus of Construction = CatEus ** open ParadigmsEus in {
|
||||
|
||||
lincat
|
||||
Timeunit = N ;
|
||||
Weekday = N ;
|
||||
Monthday = NP ;
|
||||
Month = N ;
|
||||
Year = NP ;
|
||||
{-
|
||||
lin
|
||||
|
||||
timeunitAdv n time =
|
||||
let n_card : Card = n ;
|
||||
n_hours_NP : NP = mkNP n_card time ;
|
||||
in SyntaxEus.mkAdv for_Prep n_hours_NP | mkAdv (n_hours_NP.s ! R.npNom) ;
|
||||
|
||||
weekdayPunctualAdv w = ; -- on Sunday
|
||||
weekdayHabitualAdv w = ; -- on Sundays
|
||||
weekdayNextAdv w = -- next Sunday
|
||||
weekdayLastAdv w = -- last Sunday
|
||||
|
||||
monthAdv m = mkAdv in_Prep (mkNP m) ;
|
||||
yearAdv y = mkAdv in_Prep y ;
|
||||
dayMonthAdv d m = ; -- on 17 May
|
||||
monthYearAdv m y = ; -- in May 2012
|
||||
dayMonthYearAdv d m y = ; -- on 17 May 2013
|
||||
|
||||
intYear = symb ;
|
||||
intMonthday = symb ;
|
||||
|
||||
lincat Language = N ;
|
||||
|
||||
lin InLanguage l = mkAdv ???_Prep (mkNP l) ;
|
||||
|
||||
lin
|
||||
weekdayN w = w ;
|
||||
monthN m = m ;
|
||||
|
||||
weekdayPN w = mkPN w ;
|
||||
monthPN m = mkPN m ;
|
||||
|
||||
languageCN l = mkCN l ;
|
||||
languageNP l = mkNP l ;
|
||||
|
||||
|
||||
oper mkLanguage : Str -> N = \s -> mkN s ;
|
||||
|
||||
----------------------------------------------
|
||||
---- lexicon of special names
|
||||
|
||||
lin second_Timeunit = mkN "second" ;
|
||||
lin minute_Timeunit = mkN "minute" ;
|
||||
lin hour_Timeunit = mkN "hour" ;
|
||||
lin day_Timeunit = mkN "day" ;
|
||||
lin week_Timeunit = mkN "week" ;
|
||||
lin month_Timeunit = mkN "month" ;
|
||||
lin year_Timeunit = mkN "year" ;
|
||||
|
||||
lin monday_Weekday = mkN "Monday" ;
|
||||
lin tuesday_Weekday = mkN "Tuesday" ;
|
||||
lin wednesday_Weekday = mkN "Wednesday" ;
|
||||
lin thursday_Weekday = mkN "Thursday" ;
|
||||
lin friday_Weekday = mkN "Friday" ;
|
||||
lin saturday_Weekday = mkN "Saturday" ;
|
||||
lin sunday_Weekday = mkN "Sunday" ;
|
||||
|
||||
lin january_Month = mkN "January" ;
|
||||
lin february_Month = mkN "February" ;
|
||||
lin march_Month = mkN "March" ;
|
||||
lin april_Month = mkN "April" ;
|
||||
lin may_Month = mkN "May" ;
|
||||
lin june_Month = mkN "June" ;
|
||||
lin july_Month = mkN "July" ;
|
||||
lin august_Month = mkN "August" ;
|
||||
lin september_Month = mkN "September" ;
|
||||
lin october_Month = mkN "October" ;
|
||||
lin november_Month = mkN "November" ;
|
||||
lin december_Month = mkN "December" ;
|
||||
|
||||
lin afrikaans_Language = mkLanguage "Afrikaans" ;
|
||||
lin amharic_Language = mkLanguage "Amharic" ;
|
||||
lin arabic_Language = mkLanguage "Arabic" ;
|
||||
lin bulgarian_Language = mkLanguage "Bulgarian" ;
|
||||
lin catalan_Language = mkLanguage "Catalan" ;
|
||||
lin chinese_Language = mkLanguage "Chinese" ;
|
||||
lin danish_Language = mkLanguage "Danish" ;
|
||||
lin dutch_Language = mkLanguage "Dutch" ;
|
||||
lin english_Language = mkLanguage "Euslish" ;
|
||||
lin estonian_Language = mkLanguage "Estonian" ;
|
||||
lin finnish_Language = mkLanguage "Finnish" ;
|
||||
lin french_Language = mkLanguage "French" ;
|
||||
lin german_Language = mkLanguage "German" ;
|
||||
lin greek_Language = mkLanguage "Greek" ;
|
||||
lin hebrew_Language = mkLanguage "Hebrew" ;
|
||||
lin hindi_Language = mkLanguage "Hindi" ;
|
||||
lin japanese_Language = mkLanguage "Japanese" ;
|
||||
lin italian_Language = mkLanguage "Italian" ;
|
||||
lin latin_Language = mkLanguage "Latin" ;
|
||||
lin latvian_Language = mkLanguage "Latvian" ;
|
||||
lin maltese_Language = mkLanguage "Maltese" ;
|
||||
lin nepali_Language = mkLanguage "Nepali" ;
|
||||
lin norwegian_Language = mkLanguage "Norwegian" ;
|
||||
lin persian_Language = mkLanguage "Persian" ;
|
||||
lin polish_Language = mkLanguage "Polish" ;
|
||||
lin punjabi_Language = mkLanguage "Punjabi" ;
|
||||
lin romanian_Language = mkLanguage "Romanian" ;
|
||||
lin russian_Language = mkLanguage "Russian" ;
|
||||
lin sindhi_Language = mkLanguage "Sindhi" ;
|
||||
lin spanish_Language = mkLanguage "Spanish" ;
|
||||
lin swahili_Language = mkLanguage "Swahili" ;
|
||||
lin swedish_Language = mkLanguage "Swedish" ;
|
||||
lin thai_Language = mkLanguage "Thai" ;
|
||||
lin turkish_Language = mkLanguage "Turkish" ;
|
||||
lin urdu_Language = mkLanguage "Urdu" ;
|
||||
|
||||
—}
|
||||
}
|
||||
-}
|
||||
}
|
||||
35
src/basque/ExtraEus.gf
Normal file
35
src/basque/ExtraEus.gf
Normal file
@@ -0,0 +1,35 @@
|
||||
concrete ExtraEus of ExtraEusAbs = CatEus ** open ResEus, AdjectiveEus, Prelude, ParadigmsEus in {
|
||||
|
||||
flags coding = utf8 ;
|
||||
|
||||
lincat
|
||||
|
||||
Attr = { s : Str } ;
|
||||
|
||||
|
||||
oper
|
||||
|
||||
mkAttr : Str -> Attr = \s -> lin Attr { s = s } ;
|
||||
|
||||
--lin
|
||||
|
||||
-- ko_Attr = mkAttr "ko" ;
|
||||
|
||||
{-
|
||||
Tokiorako bidaia bat 'a journey to Tokyo' [Tokyo-to-ko journey one]
|
||||
|
||||
-}
|
||||
|
||||
-- AdnP : Adv -> Attr -> AP ; -- Bilbo ra ko
|
||||
|
||||
-- AdnP adv attr = {
|
||||
-- s = adv.s ++ BIND ++ attr.s ;
|
||||
-- stem = adv.s ++ BIND ++ attr.s ;
|
||||
-- ph = FinalVow ;
|
||||
-- typ = Ko
|
||||
-- } ;
|
||||
|
||||
|
||||
|
||||
|
||||
} ;
|
||||
19
src/basque/ExtraEusAbs.gf
Normal file
19
src/basque/ExtraEusAbs.gf
Normal file
@@ -0,0 +1,19 @@
|
||||
abstract ExtraEusAbs = Extra ** {
|
||||
|
||||
cat
|
||||
|
||||
Attr ; -- morpheme to turn an phrase into an adnominal/attributive
|
||||
fun
|
||||
|
||||
ko_Attr : Attr ;
|
||||
|
||||
-- AdnP = Adnominal phrase
|
||||
|
||||
AdnP : Adv -> Attr -> AP ;
|
||||
|
||||
-- ProDrop : Pron -> Pron ;
|
||||
|
||||
-- or to drop pronouns by default and have explicit pronouns in Extra?
|
||||
-- ExplicitPron : Clause -> Clause ;
|
||||
|
||||
} ;
|
||||
20
src/basque/GrammarEus.gf
Normal file
20
src/basque/GrammarEus.gf
Normal file
@@ -0,0 +1,20 @@
|
||||
concrete GrammarEus of Grammar =
|
||||
NounEus,
|
||||
VerbEus,
|
||||
AdjectiveEus,
|
||||
AdverbEus,
|
||||
NumeralEus,
|
||||
SentenceEus,
|
||||
QuestionEus,
|
||||
RelativeEus,
|
||||
ConjunctionEus,
|
||||
PhraseEus,
|
||||
TextX,
|
||||
StructuralEus,
|
||||
IdiomEus,
|
||||
TenseX
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
41
src/basque/IdiomEus.gf
Normal file
41
src/basque/IdiomEus.gf
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
--1 Idiom: Idiomatic Expressions
|
||||
|
||||
concrete IdiomEus of Idiom = CatEus ** open Prelude, ResEus in {
|
||||
|
||||
-- This module defines constructions that are formed in fixed ways,
|
||||
-- often different even in closely related languages.
|
||||
|
||||
lin
|
||||
{-
|
||||
ImpersCl : VP -> Cl ; -- it is hot
|
||||
GenericCl : VP -> Cl ; -- one sleeps
|
||||
|
||||
CleftNP : NP -> RS -> Cl ; -- it is I who did it
|
||||
CleftAdv : Adv -> S -> Cl ; -- it is here she slept
|
||||
|
||||
ExistNP : NP -> Cl ; -- there is a house
|
||||
ExistIP : IP -> QCl ; -- which houses are there
|
||||
|
||||
-- 7/12/2012 generalizations of these
|
||||
|
||||
ExistNPAdv : NP -> Adv -> Cl ; -- there is a house in Paris
|
||||
ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
|
||||
-}
|
||||
-- : VP -> VP ; -- garbitzen ari ziren
|
||||
ProgrVP vp = vp ** { prc = \\tns => vp.prc ! Pres ++ "ari" } ;
|
||||
|
||||
-- : VP -> Utt ; -- let's go
|
||||
ImpPl1 vp = { s = linVPPrc vp } ;
|
||||
{-
|
||||
|
||||
ImpP3 : NP -> VP -> Utt ; -- let John walk
|
||||
|
||||
-- 3/12/2013 non-reflexive uses of "self"
|
||||
|
||||
SelfAdvVP : VP -> VP ; -- is at home himself
|
||||
SelfAdVVP : VP -> VP ; -- is himself at home
|
||||
SelfNP : NP -> NP ; -- the president himself (is at home)
|
||||
-}
|
||||
|
||||
}
|
||||
8
src/basque/LangEus.gf
Normal file
8
src/basque/LangEus.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
concrete LangEus of Lang =
|
||||
GrammarEus,
|
||||
LexiconEus,
|
||||
ConstructionEus
|
||||
|
||||
** {
|
||||
|
||||
} ;
|
||||
436
src/basque/LexiconEus.gf
Normal file
436
src/basque/LexiconEus.gf
Normal file
@@ -0,0 +1,436 @@
|
||||
concrete LexiconEus of Lexicon = CatEus **
|
||||
open ParadigmsEus, Prelude, (R=ResEus) in {
|
||||
|
||||
----
|
||||
-- A
|
||||
|
||||
lin add_V3 = mkV3 "gehitu" ; -- | mkV3 "erantsi" | mkV3 "gaineratu" ; --Apertium
|
||||
lin airplane_N = mkN "hegazkin" ;
|
||||
--lin alas_Interj = mkInterj "" ;
|
||||
lin already_Adv = mkAdv "dagoeneko" ; --Google translate
|
||||
lin animal_N = mkN "animalia" ;
|
||||
lin answer_V2S = mkV2S "erantzun" ;
|
||||
lin apartment_N = mkN "pisu" ; -- | mkN "apartamentu" ; --Apertium
|
||||
lin apple_N = mkN "sagar" ;
|
||||
lin art_N = mkN "arte" ;
|
||||
--lin ashes_N = mkN
|
||||
lin ask_V2Q = mkV2Q "galdetu" ;
|
||||
|
||||
----
|
||||
-- B
|
||||
|
||||
lin baby_N = mkN "haur" ; -- | mkN "ume" | mkN "kreatura" ; --Apertium
|
||||
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 become_VA = mkVA "bihurtu" ;
|
||||
lin beer_N = mkN "garagardo" ;
|
||||
lin beg_V2V = mkV2V "eskatu" ;
|
||||
lin belly_N = mkN "urdail" ; --| mkN "sabel" ; --Apertium
|
||||
lin big_A = mkA "handi" ;
|
||||
lin bike_N = mkN "bizikleta" ;
|
||||
lin bird_N = mkN "txori" ; -- | mkN "hegazti" ; --Apertium
|
||||
lin bite_V2 = mkV2 "ausiki" ; -- mkV2 (mkV "kosk" egin_V) --Apertium
|
||||
lin black_A = mkA "beltz" ;
|
||||
lin blood_N = mkN "odol" ;
|
||||
lin blow_V = mkV "putz" egin_V ;
|
||||
lin blue_A = mkA "urdin" ;
|
||||
lin boat_N = mkN "itsasontzi" ;
|
||||
lin bone_N = mkN "hezur" ; --Apertium
|
||||
lin boot_N = mkN "bota" ; --Apertium
|
||||
lin boss_N = mkN "nagusi" ; --Apertium
|
||||
lin book_N = mkN "liburu" ;
|
||||
lin boy_N = mkN "mutil" ;
|
||||
lin bread_N = mkN "ogi" ; --Apertium
|
||||
lin break_V2 = mkV2 "izorratu" ; --Apertium
|
||||
lin breast_N = mkN "bular" ; --Apertium
|
||||
lin breathe_V = mkV "arnastu" ; --Apertium
|
||||
lin broad_A = mkA "zabal" ; --Apertium
|
||||
lin brother_N2 = mkN2 "anaia" ;
|
||||
lin brown_A = mkA "marroi" ; --Apertium
|
||||
lin burn_V = mkV "erre" ; -- | mkV "kiskali" ; --Apertium
|
||||
lin butter_N = mkN "gurin" ; --Apertium
|
||||
lin buy_V2 = mkV2 "erosi" ;
|
||||
|
||||
----
|
||||
-- C
|
||||
|
||||
lin camera_N = mkN "kamera" ; -- | mkN "ganbera" ; --Apertium
|
||||
lin cap_N = mkN "txapel" ; -- | mkN "tapoi" ; --Apertium
|
||||
lin car_N = mkN "auto" ; --| mkN "automobil" ; --Apertium
|
||||
lin carpet_N = mkN "alfonbra" ; --Apertium
|
||||
lin cat_N = mkN "katu" ;
|
||||
lin ceiling_N = mkN "sabai" ; --Apertium
|
||||
lin chair_N = mkN "aulki" ; --Apertium
|
||||
lin cheese_N = mkN "gazta" ; --Apertium
|
||||
lin child_N = mkN "ume" ; --| mkN "umetxo" ; --Apertium
|
||||
lin church_N = mkN "eliza" ; --Apertium
|
||||
lin city_N = mkN "hiri" ; --Apertium
|
||||
lin clean_A = mkA "garbi" ; --Apertium
|
||||
lin clever_A = mkA "azkar" ; --Apertium
|
||||
lin close_V2 = mkV2 "gerturatu" ; -- | mkV2 "itxi" | mkV2 "zarratu" ; --Apertium
|
||||
lin cloud_N = mkN "hodei" ; --Apertium
|
||||
lin coat_N = mkN "beroki" ; -- | mkN "kapa" ; --Apertium
|
||||
lin cold_A = mkA "hotz" ;
|
||||
lin come_V = etorri_V ;
|
||||
lin computer_N = mkN "ordenagailu" ; --| mkN "ordenatzaile" ; --Apertium
|
||||
lin correct_A = mkA "zuzen" ; --Apertium
|
||||
lin count_V2 = mkV2 "kontatu" ; -- | mkV2 "zenbatu" ; --Apertium
|
||||
lin country_N = mkN "herri" ; --Apertium
|
||||
lin cousin_N = mkN "lehengusu" ; --Apertium
|
||||
lin cow_N = mkN "behi" ; --Apertium
|
||||
lin cut_V2 = mkV2 "ebaki" ; -- | mkV2 "moztu" ; --Apertium
|
||||
|
||||
----
|
||||
-- D
|
||||
|
||||
lin day_N = mkN "egun" ; --Apertium
|
||||
lin die_V = izanV "hil" ; -- | mkV "zendu" ; --Apertium
|
||||
lin dig_V = mkV "zulatu" ; --Apertium
|
||||
lin dirty_A = mkA "likits" ; --| mkA "zikin" ; --Apertium
|
||||
-- lin distance_N3 = mkN3 (mkN "distantzia") fromP toP ; --Apertium
|
||||
lin do_V2 = lin V2 egin_V ;
|
||||
lin doctor_N = mkN "mediku" ; --| mkN "doktore" ; --Apertium
|
||||
lin dog_N = mkN "txakur" ;
|
||||
lin door_N = mkN "ate" ;
|
||||
lin drink_V2 = mkV2 "edan" ;
|
||||
lin dry_A = mkA "lehor" ; --Apertium
|
||||
lin dull_A = mkA "aspergarri" ; --Apertium
|
||||
lin dust_N = mkN "hauts" ; --Apertium
|
||||
|
||||
----
|
||||
-- E
|
||||
|
||||
lin ear_N = mkN "belarri" ; --Apertium
|
||||
lin earth_N = mkN "lur" ; --Apertium
|
||||
lin eat_V2 = mkV2 "jan" ; -- | mkV2 "bazkaldu" ; --Apertium
|
||||
lin egg_N = mkN "arrautza" ; --Apertium
|
||||
lin empty_A = mkA "huts" ; --| mkA "bakarti" ; --Apertium
|
||||
lin enemy_N = mkN "etsai" ; --| mkN "arerio" ; --Apertium
|
||||
lin eye_N = mkN "begi" ;
|
||||
|
||||
----
|
||||
-- F
|
||||
|
||||
lin factory_N = mkN "fabrika" ; --| mkN "lantegi" ; --Apertium
|
||||
lin fall_V = mkV "amildu" ; -- | mkV "erori" ; --Apertium
|
||||
lin far_Adv = mkAdv "urrun" ;
|
||||
lin fat_N = mkN "gantz" ; --| mkN "koipe" ; --Apertium
|
||||
lin father_N2 = mkN2 "aita" ; --genitive
|
||||
lin fear_V2 = ukanV "beldur" ; -- beldur nauzu `you are afraid of me'
|
||||
lin fear_VS = izanV "beldur" ; -- beldur naiz [ez datorrela] `I'm afraid s/he won't come'
|
||||
lin feather_N = mkN "luma" ; --Apertium
|
||||
lin fight_V2 = mkV2 "borrokatu" ; --Apertium
|
||||
lin find_V2 = mkV2 "aurkitu" ; -- | mkV2 "topatu" ; --Apertium
|
||||
lin fingernail_N = mkN "azazkal" ; --Apertium
|
||||
lin fire_N = mkN "su" ; --Apertium
|
||||
lin fish_N = mkN "arrain" ; --Apertium
|
||||
lin float_V = mkV "flotatu" ; --Apertium
|
||||
lin floor_N = mkN "lurzoru" ; -- | mkN "solairu" ; --Apertium
|
||||
lin flow_V = mkV "jariatu" ; --Apertium
|
||||
lin flower_N = mkN "lore" ; --Apertium
|
||||
lin fly_V = mkV "hegan" egin_V ; -- | mkV "pilotatu" ; --Apertium
|
||||
lin fog_N = mkN "laino" ; --Apertium
|
||||
lin foot_N = mkN "oin" ; --Apertium
|
||||
lin forest_N = mkN "baso" ; --Apertium
|
||||
lin forget_V2 = mkV2 "ahaztu" ; --Apertium
|
||||
lin freeze_V = mkV "izoztu" ; --Apertium
|
||||
lin fridge_N = mkN "elurtegi" ; --Apertium
|
||||
lin friend_N = mkN "lagun" ; --| mkN "adiskide" ; --Apertium
|
||||
lin fruit_N = mkN "fruta" ; --Apertium
|
||||
lin full_A = mkA "bete" ; --Apertium
|
||||
--lin fun_AV
|
||||
|
||||
----
|
||||
-- G
|
||||
|
||||
lin garden_N = mkN "lorategi" ; --Apertium
|
||||
lin girl_N = mkN "neska" ;
|
||||
lin give_V3 = mkV3 "eman" ; --Apertium
|
||||
lin glove_N = mkN "eskularru" | mkN "eskularru" ; --Apertium
|
||||
lin go_V = joan_V ;
|
||||
lin gold_N = mkN "urre" ; --Apertium
|
||||
lin good_A = mkA "ongi" (mkA "on") ; -- Irregular adverb form
|
||||
lin grammar_N = mkN "gramatika" ; --Apertium
|
||||
lin grass_N = mkN "belar" ; --Apertium
|
||||
lin green_A = mkA "berde" ; --Apertium
|
||||
|
||||
----
|
||||
-- H
|
||||
|
||||
lin hair_N = mkN "ile" ; -- | mkN "adats" ; --Apertium
|
||||
lin hand_N = mkN "esku" ; --Apertium
|
||||
lin harbour_N = mkN "portu" ; --| mkN "kai" | mkN "mendate" ; --Apertium
|
||||
lin hat_N = mkN "kapela" ; --Apertium
|
||||
lin hate_V2 = mkV2 "gorrotatu" ; --Apertium
|
||||
lin head_N = mkN "buru" ; --Apertium
|
||||
lin hear_V2 = mkV2 "entzun" ; --Apertium
|
||||
lin heart_N = mkN "bihotz" ; --Apertium
|
||||
lin heavy_A = mkA "astun" ; --Apertium
|
||||
lin hill_N = mkN "muino" ; --Apertium
|
||||
lin hit_V2 = mkV2 "jo" ; --Apertium
|
||||
lin hold_V2 = mkV2 "eutsi" ; --Apertium
|
||||
lin hope_VS = lin VS (egonV "zain") ; --Apertium
|
||||
lin horn_N = mkN "adar" ; --Apertium
|
||||
lin horse_N = mkN "zaldi" ; --Apertium
|
||||
lin hot_A = mkA "bero" ; --Apertium
|
||||
lin house_N = mkN "etxe" ; --Apertium
|
||||
lin hunt_V2 = mkV2 "ehizatu" ;
|
||||
lin husband_N = mkN "senar" ; --Apertium
|
||||
|
||||
----
|
||||
-- I
|
||||
|
||||
lin ice_N = mkN "izotz" ; --Apertium ; --Apertium
|
||||
lin industry_N = mkN "industria" ; --Apertium
|
||||
lin iron_N = mkN "burdina" ; -- | mkN "plantxa" ; --Apertium
|
||||
|
||||
--------
|
||||
-- J - K
|
||||
|
||||
lin jump_V = mkV "jauzi" egin_V ; --Apertium
|
||||
lin kill_V2 = mkV2 "hil" ; --Apertium
|
||||
lin king_N = mkN "errege" ; --Apertium
|
||||
lin knee_N = mkN "belaun" ; --Apertium
|
||||
lin know_V2 = lin V2 jakin_V2 ; -- synthetic verb
|
||||
lin know_VQ = lin VQ jakin_V2 ; -- synthetic verb
|
||||
|
||||
lin know_VS = ukanV "uste" ;
|
||||
|
||||
|
||||
----
|
||||
-- L
|
||||
|
||||
lin lake_N = mkN "aintzira" ; --Apertium
|
||||
lin lamp_N = mkN "lanpara" ; --Apertium
|
||||
lin language_N = mkN "hizkuntza" ; --Apertium
|
||||
lin laugh_V = mkV "barre" egin_V ; --Apertium
|
||||
lin leaf_N = mkN "orri" ; -- | mkN "hosto" ; --Apertium
|
||||
lin learn_V2 = mkV2 "ikasi" ; --Apertium
|
||||
lin leather_N = mkN "larru" ; --Apertium
|
||||
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<per>" ; --Apertium
|
||||
-- lin like_V2 = mkV2 "gogoko8izan<per>" ; --Apertium
|
||||
lin listen_V2 = mkV2 "entzun" ; --Apertium
|
||||
lin live_V = izanV "bizi" ;
|
||||
lin liver_N = mkN "gibel" ; --Apertium
|
||||
lin long_A = mkA "luze" ; --Apertium
|
||||
lin lose_V2 = mkV2 "galdu" ; --Apertium
|
||||
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 meat_N = mkN "haragi" ; -- | mkN "mami" ; --Apertium
|
||||
lin milk_N = mkN "esne" ; --Apertium
|
||||
lin moon_N = mkN "ilargi" ; --Apertium
|
||||
lin mother_N2 = mkN2 "ama" ;
|
||||
lin mountain_N = mkN "mendi" ; --Apertium
|
||||
lin mouth_N = mkN "aho" ; --Apertium
|
||||
lin music_N = mkN "musika" ; --Apertium
|
||||
|
||||
----
|
||||
-- N
|
||||
|
||||
lin name_N = mkN "izen" ; --Apertium
|
||||
lin narrow_A = mkA "estu" ; --Apertium
|
||||
lin near_A = mkA "hurbil" ; --Apertium
|
||||
lin neck_N = mkN "lepo" ; --Apertium
|
||||
lin new_A = mkA "berri" ; --Apertium
|
||||
lin newspaper_N = mkN "egunkari" ; -- | mkN "kazeta" ; --Apertium
|
||||
lin night_N = mkN "gau" ; --Apertium
|
||||
lin nose_N = mkN "sudur" ; --Apertium
|
||||
lin now_Adv = mkAdv "orain" ;
|
||||
lin number_N = mkN "zenbaki" ; --Apertium
|
||||
|
||||
--------
|
||||
-- O - P
|
||||
|
||||
|
||||
lin oil_N = mkN "olio" ; --Apertium
|
||||
lin old_A = mkA "zahar" ; --Apertium
|
||||
lin open_V2 = mkV2 "ireki" ; -- | mkV2 "zabaldu" ; --Apertium
|
||||
lin paint_V2A = mkV2A "margotu" ; -- | mkV2A "pintatu" ; --Apertium
|
||||
lin paper_N = mkN "paper" ; --Apertium
|
||||
lin paris_PN = mkPN "Paris" ;
|
||||
lin peace_N = mkN "bake" ; -- | mkN "sosegu" ; --Apertium
|
||||
lin pen_N = mkN "boligrafo" ; --Apertium
|
||||
lin person_N = mkN "pertsona" ; --| mkN "gizakume" | mkN "jende" ; --Apertium
|
||||
lin planet_N = mkN "planeta" ; --Apertium
|
||||
lin plastic_N = mkN "plastiko" ; --Apertium
|
||||
lin play_V = mkV "jokatu" ; -- | mkV "jolastu" ; --Apertium
|
||||
lin policeman_N = mkN "ertzain" ; --Apertium
|
||||
lin priest_N = mkN "apaiz" ; -- | mkN "artzain" ; --Apertium -- FIXME: split
|
||||
lin pull_V2 = mkV2 "tenkatu" ; -- | mkV2 "tiratu" ; --Apertium
|
||||
lin push_V2 = mkV2 "bultzatu" ; -- | mkV2 "estutu" ; --Apertium
|
||||
lin put_V2 = mkV2 "ezarri" ; -- | mkV2 "jarri" ; --Apertium
|
||||
|
||||
--------
|
||||
-- Q - R
|
||||
|
||||
lin queen_N = mkN "erregina" ; --Apertium
|
||||
lin question_N = mkN "galdera" ; --Apertium
|
||||
lin radio_N = mkN "erradio" ; --| mkN "irrati" ; --Apertium
|
||||
lin rain_N = mkN "euri" ; --Apertium
|
||||
lin rain_V0 = mkV "euria ari" (mkV "edun") ; --Apertium
|
||||
lin read_V2 = mkV2 "irakurri" ; --Apertium
|
||||
lin ready_A = mkA "prest" ; --Apertium
|
||||
lin reason_N = mkN "arrazoi" ; --| mkN "motibo" | mkN "zergati" ; --Apertium
|
||||
lin red_A = mkA "gorri" ; --Apertium
|
||||
lin religion_N = mkN "erlijio" ; --Apertium
|
||||
lin restaurant_N = mkN "janetxe" ; --| mkN "jatetxe" ; --Apertium
|
||||
lin river_N = mkN "ibai" ; --Apertium
|
||||
lin road_N = mkN "kale" ; --| mkN "errepide" ; --Apertium
|
||||
lin rock_N = mkN "harri" ; --| mkN "arroka" ; --Apertium
|
||||
lin roof_N = mkN "teilatu" ; --| mkN "sabai" ; --Apertium
|
||||
lin root_N = mkN "erro" ; --Apertium
|
||||
lin rope_N = mkN "korda" ; --| mkN "soka" ; --Apertium
|
||||
lin rotten_A = mkA "ustel" ; --Apertium
|
||||
lin round_A = mkA "biribil" ; --Apertium
|
||||
lin rub_V2 = mkV2 "igurtzi" ; --Apertium
|
||||
lin rubber_N = mkN "goma" ; --Apertium
|
||||
lin rule_N = mkN "arautegi" ; --| mkN "erregela" ; --Apertium
|
||||
lin run_V = mkV "korritu" ; --Apertium
|
||||
|
||||
----
|
||||
-- S
|
||||
|
||||
lin salt_N = mkN "gatz" ; --Apertium
|
||||
lin sand_N = mkN "harea" ; --Apertium
|
||||
lin say_VS = mkVS "esan" ; --Apertium
|
||||
lin school_N = mkN "eskola" ; --| mkN "ikastola" ; --Apertium
|
||||
lin science_N = mkN "zientzia" ; --Apertium
|
||||
lin scratch_V2 = mkV2 "urratu" ; --Apertium
|
||||
lin sea_N = mkN "itsaso" ;
|
||||
lin see_V2 = mkV2 "ikusi" ;
|
||||
lin seed_N = mkN "hazi" ; --Apertium
|
||||
lin seek_V2 = mkV2 "bilatu" ; --Apertium
|
||||
lin sell_V3 = mkV3 "saldu" ; --Apertium
|
||||
lin send_V3 = mkV3 "bidali" ; --| mkV3 "igorri" ; --Apertium
|
||||
lin sew_V = mkV "josi" ; --Apertium
|
||||
lin sharp_A = mkA "zorrotz" ; -- | mkA "sarkor" | mkA "zoli" ; --Apertium
|
||||
lin sheep_N = mkN "ardi" ; --Apertium
|
||||
lin ship_N = mkN "ontzi" ; --| mkN "itsasontzi" ; --Apertium
|
||||
lin shirt_N = mkN "alkandora" ; --Apertium
|
||||
lin shoe_N = mkN "zapata" ; --Apertium
|
||||
lin shop_N = mkN "denda" ; --| mkN "saltoki" ; --Apertium
|
||||
lin short_A = mkA "apal" ; --| mkA "baxu" | mkA "labur" | mkA "motz" ; --Apertium
|
||||
lin silver_N = mkN "zilar" ; --Apertium
|
||||
lin sing_V = mkV "kantatu" ; --Apertium
|
||||
lin sister_N = mkN "aizpa" ; --| mkN "arreba" ; --Apertium -- FIXME: Depends on gender of 'possessor'
|
||||
lin sit_V = mkV "eseri" ; --| mkV "jarri" ; --Apertium
|
||||
lin skin_N = mkN "larru" ; --Apertium
|
||||
lin sky_N = mkN "zeru" ; --Apertium
|
||||
lin sleep_V = mkV "lo" egin_V ;
|
||||
lin small_A = mkA "txiki" ; --| mkA "apur" | mkA "xume" ; --Apertium
|
||||
lin smell_V = izanV "usain" ; --Apertium
|
||||
lin smoke_N = mkN "ke" ; --Apertium
|
||||
lin smooth_A = mkA "leun" ; --| mkA "liso" ; --Apertium
|
||||
lin snake_N = mkN "suge" ; --Apertium
|
||||
lin snow_N = mkN "elur" ; --Apertium
|
||||
lin sock_N = mkN "galtzetin" ; --Apertium
|
||||
lin song_N = mkN "abesti" ; --| mkN "kanta" | mkN "kantu" ; --Apertium
|
||||
lin speak_V2 = lin V2 (mkV "hitz" egin_V) ; --Apertium
|
||||
lin spit_V = mkV "txistua bota" ; --Apertium
|
||||
lin split_V2 = mkV2 "pitzatu" ; --| mkV2 "zatitu" ; --Apertium
|
||||
lin squeeze_V2 = mkV2 "estutu" ; --Apertium
|
||||
lin stab_V2 = mkV2 "sastatu" ; --Apertium
|
||||
lin stand_V = mkV "egon" ; --| mkV "eutsi" | mkV "jarri" ; --Apertium
|
||||
lin star_N = mkN "izar" ; --Apertium
|
||||
lin steel_N = mkN "altzairu" ; --Apertium
|
||||
lin stick_N = mkN "palo" ; --Apertium
|
||||
lin stone_N = mkN "harri" ; --| mkN "hezur" ; --Apertium
|
||||
lin stop_V = mkV "gelditu" ; --| mkV "geratu" | mkV "atxilotu" | mkV "geldiarazi" ; --Apertium
|
||||
lin stove_N = mkN "berogailu" ; --| mkN "sukalde" ; --Apertium
|
||||
lin straight_A = mkA "zuzen" ; --Apertium
|
||||
lin student_N = mkN "ikasle" ; --Apertium
|
||||
lin stupid_A = mkA "ergel" ; -- | mkA "tonto" ; --Apertium
|
||||
lin suck_V2 = mkV2 "edoski" ; --| mkV2 "xurgatu" | mkV2 "zupatu" ; --Apertium
|
||||
lin sun_N = mkN "eguzki" ; --Apertium
|
||||
lin swell_V = mkV "handitu" ; --Apertium
|
||||
lin swim_V = mkV "igeri" egin_V ; --Apertium
|
||||
|
||||
----
|
||||
-- T
|
||||
|
||||
|
||||
lin table_N = mkN "mahai" ; --| mkN "taula" ; --Apertium
|
||||
lin tail_N = mkN "buztan" ; --| mkN "kola" ; --Apertium
|
||||
lin talk_V3 = mkV3 "mintzatu" ; --Apertium
|
||||
lin teach_V2 = mkV2 "erakutsi" ; --| mkV2 "irakatsi" ; --Apertium
|
||||
lin teacher_N = mkN "irakasle" ; --Apertium
|
||||
lin television_N = mkN "telebista" ; --Apertium
|
||||
lin thick_A = mkA "lodi" ; --Apertium
|
||||
lin thin_A = mkA "argal" ; -- | mkA "mehe" ; --Apertium
|
||||
lin think_V = mkV "iritzi" ; --| mkV "pentsatu" ; --Apertium
|
||||
lin throw_V2 = mkV2 "aurtiki" ; -- | mkV2 "jaurti" | mkV2 "tiratu" ; --Apertium
|
||||
lin tie_V2 = mkV2 "lotu" ; --Apertium
|
||||
lin today_Adv = mkAdv "gaur" ;
|
||||
lin tongue_N = mkN "mihi" ; --| mkN "mizto" ; --Apertium
|
||||
lin tooth_N = mkN "hortz" ; --Apertium
|
||||
lin train_N = mkN "tren" ; --Apertium
|
||||
lin travel_V = mkV "bidaiatu" ; --Apertium
|
||||
lin tree_N = mkN "zuhaitz" ; --Apertium
|
||||
lin turn_V = mkV "biratu" ; --| mkV "jiratu" ; --Apertium
|
||||
|
||||
--------
|
||||
-- U - V
|
||||
|
||||
lin ugly_A = mkA "itsusi" ; --Apertium
|
||||
lin uncertain_A = mkA "gezur" ; --Apertium
|
||||
lin understand_V2 = mkV2 "aditu" ; --| mkV2 "ulertu" ; --Apertium
|
||||
lin university_N = mkN "unibertsitate" ; --Apertium
|
||||
lin village_N = mkN "herrixka" ; --Apertium
|
||||
lin vomit_V = mkV2 "oka" egin_V ; --Apertium
|
||||
|
||||
--------
|
||||
-- W - Y
|
||||
|
||||
lin wait_V2 = mkV2 "itxaron" ; --| mkV2 "zain egon" ; --Apertium
|
||||
lin walk_V = ibili_V ; --Apertium
|
||||
lin war_N = mkN "gerra" ; --Apertium
|
||||
lin warm_A = mkA "bero" ; --Apertium
|
||||
lin wash_V2 = mkV2 "garbitu" ; --Apertium
|
||||
lin watch_V2 = mkV2 "begiratu" ; --Apertium
|
||||
lin water_N = mkN "ura" ; --Definite form is ura, not urra ('hazelnut')
|
||||
lin wet_A = mkA "busti" ; --Apertium
|
||||
lin white_A = mkA "zuri" ; --| mkA "txuri" ; --Apertium
|
||||
lin wide_A = mkA "zabal" ; --Apertium
|
||||
lin wife_N = mkN "emazte" ; --Apertium
|
||||
lin win_V2 = mkV2 "garaitu" ; --| mkV2 "irabazi" ; --Apertium
|
||||
lin wind_N = mkN "haize" ; --Apertium
|
||||
lin window_N = mkN "leiho" ;
|
||||
lin wine_N = mkN "ardo" ; --Apertium
|
||||
lin wing_N = mkN "hegal" ; --Apertium
|
||||
lin wipe_V2 = mkV2 "garbitu" ; --Apertium
|
||||
lin woman_N = mkN "emakume" animate ;
|
||||
lin wonder_VQ = mkVQ "galdetu" ; -- galdetu = ask
|
||||
lin wood_N = mkN "zur" ; --| mkN "baso" ; --Apertium -- leña, bosque
|
||||
lin worm_N = mkN "har" ; --| mkN "zizare" ; --Apertium
|
||||
lin write_V2 = mkV2 "idatzi" ; --Apertium
|
||||
lin year_N = mkN "urte" ; --| mkN "urtebete" ; --Apertium
|
||||
lin yellow_A = mkA "hori" ; --Apertium
|
||||
lin young_A = mkA "gazte" ; --Apertium
|
||||
|
||||
|
||||
|
||||
|
||||
oper
|
||||
|
||||
egin_V : V = mkV "egin" ;
|
||||
|
||||
-- Some synthetic verbs
|
||||
etorri_V : R.Verb = R.syntVerbDa "etorri" R.Etorri ;
|
||||
|
||||
ibili_V : R.Verb = R.syntVerbDa "ibili" R.Ibili ;
|
||||
|
||||
jakin_V2 : R.Verb = R.syntVerbDu "jakin" R.Jakin ;
|
||||
|
||||
joan_V : R.Verb = R.syntVerbDa "joan" R.Joan ;
|
||||
}
|
||||
24
src/basque/MissingEus.gf
Normal file
24
src/basque/MissingEus.gf
Normal file
@@ -0,0 +1,24 @@
|
||||
resource MissingEus = open GrammarEus, Prelude in {
|
||||
|
||||
-- temporary definitions to enable the compilation of RGL API
|
||||
oper AddAdvQVP : QVP -> IAdv -> QVP = notYet "AddAdvQVP" ;
|
||||
oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ;
|
||||
oper AdvQVP : VP -> IAdv -> QVP = notYet "AdvQVP" ;
|
||||
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
|
||||
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
|
||||
oper ComparAdvAdjS : CAdv -> A -> S -> Adv = notYet "ComparAdvAdjS" ;
|
||||
oper ComplSlashIP : VPSlash -> IP -> QVP = notYet "ComplSlashIP" ;
|
||||
oper ExistIP : IP -> QCl = notYet "ExistIP" ;
|
||||
oper ExistIPAdv : IP -> Adv -> QCl = notYet "ExistIPAdv" ;
|
||||
oper ExistNP : NP -> Cl = notYet "ExistNP" ;
|
||||
oper ExistNPAdv : NP -> Adv -> Cl= notYet "ExistNPAdv" ;
|
||||
oper GenericCl : VP -> Cl = notYet "GenericCl" ;
|
||||
oper ImpP3 : NP -> VP -> Utt = notYet "ImpP3" ;
|
||||
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
|
||||
oper QuestQVP : IP -> QVP -> QCl = notYet "QuestQVP" ;
|
||||
oper SelfAdVVP : VP -> VP = notYet "SelfAdVVP" ;
|
||||
oper SelfAdvVP : VP -> VP = notYet "SelfAdvVP" ;
|
||||
oper SelfNP : NP -> NP = notYet "SelfNP" ;
|
||||
oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ;
|
||||
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
|
||||
}
|
||||
263
src/basque/NounEus.gf
Normal file
263
src/basque/NounEus.gf
Normal file
@@ -0,0 +1,263 @@
|
||||
concrete NounEus of Noun = CatEus ** open ResEus, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
--2 Noun phrases
|
||||
|
||||
-- The three main types of noun phrases are
|
||||
-- - common nouns with determiners
|
||||
-- - proper names
|
||||
-- - pronouns
|
||||
|
||||
-- : Det -> CN -> NP
|
||||
DetCN det cn =
|
||||
let ag : Agr = case det.nbr of {
|
||||
Sg => Hau ;
|
||||
Pl => Hauek
|
||||
} ;
|
||||
s : Case => Str =
|
||||
\\c => cn.heavyMod ! ag -- e.g. rel clause, adverb
|
||||
++ det.pref -- nire
|
||||
++ cn.s ! ag -- baso handi
|
||||
++ det.s ! c ! cn.ph -- bat, &+a
|
||||
++ cn.comp ; -- ardo gorri
|
||||
in { s = s ;
|
||||
stem = s ! Abs ; -- This really shouldn't become relevant:
|
||||
agr = ag ; -- stem is only used in ApposCN, which makes sense
|
||||
anim = cn.anim ; -- with NPs formed out of PNs or Symbs.
|
||||
isDef = det.isDef
|
||||
} ;
|
||||
|
||||
-- : PN -> NP ;
|
||||
UsePN pn = { s = \\c => pn.s ++ artIndef ! c ! pn.ph;
|
||||
stem = pn.s ;
|
||||
agr = Hau ;
|
||||
anim = pn.anim ;
|
||||
isDef = True } ; --in Extra : add UsePNIndef to allow "hemen ez dago Olatzik"
|
||||
|
||||
-- : Pron -> NP ;
|
||||
UsePron pron = lin NP pron ;
|
||||
|
||||
|
||||
-- : Predet -> NP -> NP ; -- only the man
|
||||
PredetNP predet np = np ** { s = \\cas => predet.s ++ np.s ! cas } ; --TODO: test
|
||||
|
||||
|
||||
-- A noun phrase can also be postmodified by the past participle of a
|
||||
-- verb, by an adverb, or by a relative clause
|
||||
|
||||
|
||||
-- : NP -> V2 -> NP ; -- the man seen / ikusi gizona (sounds weird but so does English)
|
||||
PPartNP np v2 = np ** { s = \\c => v2.prc ! Past ++ np.s ! c } ;
|
||||
|
||||
-- : NP -> Adv -> NP ; -- Paris today ; boys, such as ..
|
||||
AdvNP,ExtAdvNP = \np,adv -> np ** { s = \\c => adv.s ++ np.s ! c } ;
|
||||
|
||||
|
||||
-- : NP -> RS -> NP ; -- Paris, which is here
|
||||
RelNP np rs = np ** { s = \\c => rs.s ! np.agr ++ np.s ! c } ;
|
||||
|
||||
-- Determiners can form noun phrases directly.
|
||||
|
||||
-- : Det -> NP ; -- nirea ?
|
||||
DetNP det =
|
||||
let f : Case => Str =
|
||||
\\c => if_then_Str det.indep
|
||||
(det.pref ++ det.s ! c ! FinalCons)
|
||||
nonExist ; -- To prevent forms that start with BIND
|
||||
in { s = f ;
|
||||
stem = f ! Abs ;
|
||||
agr = case det.nbr of {Sg => Hau ; Pl => Hauek } ;
|
||||
anim = Inan ;
|
||||
isDef = det.isDef } ;
|
||||
|
||||
-- MassNP : CN -> NP ;
|
||||
MassNP cn =
|
||||
let s : Case => Str =
|
||||
\\c => cn.heavyMod ! Hau -- e.g. rel clause, adverb
|
||||
++ cn.s ! Hau -- baso handi
|
||||
++ artIndef ! c ! cn.ph -- no -a in Abs
|
||||
++ cn.comp ; -- ardo gorri
|
||||
in { s = s ;
|
||||
stem = s ! Abs ;
|
||||
agr = Hau ;
|
||||
anim = Inan ;
|
||||
isDef = False } ;
|
||||
|
||||
|
||||
--2 Determiners
|
||||
|
||||
-- The determiner has a fine-grained structure, in which a 'nucleus'
|
||||
-- quantifier and an optional numeral can be discerned.
|
||||
|
||||
-- : Quant -> Num -> Det ;
|
||||
DetQuant quant num = quant **
|
||||
{ s = \\c,ph => case <num.isNum,num.n> of { --numeral 1 ("bat") goes after NP!
|
||||
<True,Sg> => num.s ++ quant.s ! num.n ! c ! FinalCons ;
|
||||
_ => quant.s ! num.n ! c ! ph
|
||||
} ;
|
||||
nbr = num.n ;
|
||||
pref = case num.n of {
|
||||
Sg => quant.pref ;
|
||||
Pl => quant.pref ++ num.s
|
||||
} ;
|
||||
isDef = orB quant.isDef num.isNum } ;
|
||||
|
||||
-- : Quant -> Num -> Ord -> Det ; -- these five best
|
||||
DetQuantOrd quant num ord =
|
||||
let theseFive = DetQuant quant num
|
||||
in theseFive ** { s = \\c,ph => theseFive.s ! c ! ph ++ ord.s } ; --TODO: dummy implementation
|
||||
|
||||
-- Whether the resulting determiner is singular or plural depends on the
|
||||
-- cardinal.
|
||||
|
||||
-- All parts of the determiner can be empty, except $Quant$, which is
|
||||
-- the "kernel" of a determiner. It is, however, the $Num$ that determines
|
||||
-- the inherent number.
|
||||
|
||||
NumSg = { s = [] ; n = Sg ; isNum = False } ;
|
||||
NumPl = { s = [] ; n = Pl ; isNum = False } ;
|
||||
|
||||
-- : Card -> Num ;
|
||||
NumCard card = (card ** { isNum = True }) ;
|
||||
|
||||
-- : Digits -> Card ;
|
||||
NumDigits dig = { s = dig.s ! NCard ; n = dig.n } ;
|
||||
|
||||
-- : Numeral -> Card ;
|
||||
NumNumeral num = num ;
|
||||
|
||||
-- : AdN -> Card -> Card ;
|
||||
AdNum adn card = card ** { s = adn.s ++ card.s } ;
|
||||
|
||||
-- : Digits -> Ord ;
|
||||
OrdDigits digs = digs ** { s = digs.s ! NOrd } ;
|
||||
|
||||
-- : Numeral -> Ord ;
|
||||
OrdNumeral num = num ;
|
||||
|
||||
-- : A -> Ord ;
|
||||
OrdSuperl a = { s = a.s ! AF Superl ; n = Sg } ; -- why force Sg?
|
||||
|
||||
-- One can combine a numeral and a superlative.
|
||||
|
||||
-- : Numeral -> A -> Ord ; -- third largest
|
||||
OrdNumeralSuperl num a = num ** { s = num.s ++ a.s ! AF Superl } ; --TODO: is the word order correct?
|
||||
|
||||
-- : Quant
|
||||
DefArt = { s = artDef ;
|
||||
indep = False ;
|
||||
pref = [] ;
|
||||
isDef = True } ;
|
||||
-- : Quant
|
||||
IndefArt = { s = artDef ;
|
||||
indep = False ;
|
||||
pref = [] ;
|
||||
isDef = False } ; --has suffix, but turns into partitive in negative!
|
||||
|
||||
-- : Pron -> Quant
|
||||
PossPron pron = { s = artDef ;
|
||||
indep = True ;
|
||||
pref = pron.s ! Gen ;
|
||||
isDef = True } ;
|
||||
|
||||
--2 Common nouns
|
||||
|
||||
-- : N -> CN
|
||||
-- : N2 -> CN ;
|
||||
UseN,UseN2 = ResEus.useN ;
|
||||
|
||||
|
||||
-- : N2 -> NP -> CN ; -- mother of the king
|
||||
ComplN2 n2 np =
|
||||
let compl = applyPost n2.compl1 np ;
|
||||
in useN n2 ** { s = \\agr => compl ++ n2.s } ;
|
||||
|
||||
-- : N3 -> NP -> N2 ; -- distance from this city (to Paris)
|
||||
ComplN3 n3 np =
|
||||
let compl = applyPost n3.compl2 np ;
|
||||
in n3 ** {s = compl ++ n3.s } ;
|
||||
|
||||
-- : N3 -> N2 ; -- distance (from this city)
|
||||
Use2N3 n3 = lin N2 n3 ** { compl1 = n3.compl2 } ;
|
||||
|
||||
-- : N3 -> N2 ; -- distance (to Paris)
|
||||
Use3N3 n3 = lin N2 n3 ;
|
||||
|
||||
-- : AP -> CN -> CN
|
||||
AdjCN ap cn =
|
||||
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 ;
|
||||
ph = cn.ph } ;
|
||||
Bare => { s = \\agr => cn.s ! agr ++ a ++ ap.s ;
|
||||
ph = ap.ph }
|
||||
} ;
|
||||
in cn ** { s = result.s ;
|
||||
ph = result.ph } ;
|
||||
|
||||
-- : CN -> RS -> CN ;
|
||||
RelCN cn rs = cn ** { heavyMod = \\agr => cn.heavyMod ! agr ++ rs.s ! agr } ;
|
||||
|
||||
|
||||
-- : CN -> Adv -> CN ;
|
||||
AdvCN cn adv = cn ** { heavyMod = \\agr => cn.heavyMod ! agr ++ adv.s } ;
|
||||
|
||||
-- Nouns can also be modified by embedded sentences and questions.
|
||||
-- For some nouns this makes little sense, but we leave this for applications
|
||||
-- to decide. Sentential complements are defined in VerbEus.
|
||||
|
||||
-- : CN -> SC -> CN ; -- question where she sleeps
|
||||
SentCN cn sc = cn ** { heavyMod = \\agr => cn.heavyMod ! agr ++ sc.s } ;
|
||||
|
||||
|
||||
--2 Apposition
|
||||
|
||||
-- This is certainly overgenerating.
|
||||
|
||||
-- : CN -> NP -> CN ; -- city Paris (, numbers x and y)
|
||||
ApposCN cn np = cn ** { s = \\agr => np.stem ++ cn.s ! agr } ;
|
||||
|
||||
|
||||
--2 Possessive and partitive constructs
|
||||
|
||||
-- : PossNP : CN -> NP -> CN ; -- (mutilaren / taberna honetako) garagardo
|
||||
PossNP cn np =
|
||||
let npPoss = applyPost (case np.anim of {
|
||||
Anim => mkPost [] Gen False ;
|
||||
Inan => mkPost "ko" LocStem True
|
||||
}) np ;
|
||||
in cn ** { s = \\agr => npPoss ++ cn.s ! agr } ;
|
||||
|
||||
-- : CN -> NP -> CN ; -- glass of wine / baso bat ardo beltz
|
||||
-- two kilos of red apples / bi kilo sagar gorri
|
||||
PartNP cn np =
|
||||
let baso = cn ;
|
||||
sagarGorri = np.stem
|
||||
in baso ** { comp = sagarGorri } ;
|
||||
|
||||
|
||||
|
||||
-- This is different from the partitive, as shown by many languages.
|
||||
|
||||
-- : Det -> NP -> NP ; -- gutarik zenbait
|
||||
CountNP det np = np **
|
||||
{ s = \\c => elative np
|
||||
++ det.pref
|
||||
++ det.s ! c ! FinalCons } ; -- Nonsense for DefArt or IndefArt
|
||||
|
||||
--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 } ;
|
||||
|
||||
-- : Det -> DAP ; -- this (or that)
|
||||
DetDAP det = det ;
|
||||
|
||||
oper
|
||||
elative : NP -> Str = \np -> glue (np.s ! LocStem) "rik" ;
|
||||
|
||||
}
|
||||
116
src/basque/NumeralEus.gf
Normal file
116
src/basque/NumeralEus.gf
Normal file
@@ -0,0 +1,116 @@
|
||||
concrete NumeralEus of Numeral = CatEus [Numeral,Digits] ** open Prelude, ResEus, ParamX in {
|
||||
|
||||
oper LinDigit : Type = { s : DForm => Str ;
|
||||
n : Number ;
|
||||
even20 : Even20 } ;
|
||||
|
||||
oper mk20Ten : Str -> Str -> Str -> Str -> LinDigit = \tri,t,fiche,h ->
|
||||
{ s = table { Unit => tri ;
|
||||
Teen => t ;
|
||||
Twenty => fiche ;
|
||||
Hund => h + "ehun"} ;
|
||||
even20 = Ten ;
|
||||
n = Pl } ;
|
||||
|
||||
oper mkeven20 : Str -> Str -> Str -> Str -> LinDigit = \se,t,trifichid,h ->
|
||||
{ s = table { Unit => se ;
|
||||
Teen => t ;
|
||||
Twenty => trifichid ;
|
||||
Hund => h + "ehun" } ;
|
||||
even20 = Even ;
|
||||
n = Pl } ;
|
||||
|
||||
param Even20 = Ten | Even ;
|
||||
param DForm = Unit | Teen | Twenty | Hund ;
|
||||
|
||||
--lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : Str ; n : Number } ;
|
||||
lincat Sub1000 = {s : Str ; n : Number ; isHundred : Bool } ;
|
||||
lincat Sub1000000 = {s : Str ; n : Number } ;
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
|
||||
-- num : Sub1000000 -> Numeral ;
|
||||
lin num x0 = lin Numeral x0 ;
|
||||
|
||||
lin n2 = mkeven20 "bi" "hamabi" "hogei" "berr" ;
|
||||
lin n3 = mk20Ten "hiru" "hamahiru"{-"hamahirur"-} "hogei" "hirur";
|
||||
lin n4 = mkeven20 "lau" "hamalau"{-"hamalaur"-} "berrogei" "laur";
|
||||
lin n5 = mk20Ten "bost" "hamabost"{-"hamabortz"-} "berrogei" "bost";
|
||||
lin n6 = mkeven20 "sei" "hamasei" "hirurogei" "seir" ;
|
||||
lin n7 = mk20Ten "zazpi" "hamazazpi" "hirurogei" "zazpi" ;
|
||||
lin n8 = mkeven20 "zortzi" "hemezortzi" "laurogei" "zortzi" ;
|
||||
lin n9 = mk20Ten "bederatzi" "hemeretzi" "laurogei" "bederatzi" ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {Unit => "bat" ; Hund => "ehun" ; _ => []} ; even20 = Ten ; n = Sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "hamar" ; n = Pl} ;
|
||||
lin pot111 = {s = variants {"hamaika" ; "hameka"} ; n = Pl} ;
|
||||
lin pot1to19 d = {s = d.s ! Teen ; n = Pl} ;
|
||||
lin pot0as1 n = {s = n.s ! Unit ; n = n.n} ;
|
||||
lin pot1 d =
|
||||
{s = case d.even20 of {
|
||||
Even => d.s ! Twenty ;
|
||||
Ten => glue (d.s ! Twenty) "tahamar" } ;
|
||||
n = Pl} ;
|
||||
lin pot1plus d e =
|
||||
{s = case d.even20 of {
|
||||
Even => d.s ! Twenty ++ "ta" ++ e.s ! Unit ;
|
||||
Ten => d.s ! Twenty ++ "ta" ++ e.s ! Teen } ;
|
||||
n = Pl} ;
|
||||
|
||||
lin pot1as2 n = n ** { isHundred = False } ;
|
||||
lin pot2 d = {s = d.s ! Hund ; n = Pl ; isHundred = True } ;
|
||||
lin pot2plus d e =
|
||||
{ s = d.s ! Hund ++ "ta" ++ e.s ;
|
||||
n = Pl ;
|
||||
isHundred = True } ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n =
|
||||
{s = table {Sg => [] ; Pl => n.s } ! n.n ++ "mila" ;
|
||||
n = n.n } ;
|
||||
|
||||
|
||||
lin pot3plus n m =
|
||||
let ta = if_then_Str m.isHundred [] "ta" ; --no `ta' between 1000 and 100
|
||||
in
|
||||
{ s = table {Sg => [] ; Pl => n.s } ! n.n ++ "mila" ++ ta ++ m.s ;
|
||||
n = n.n } ;
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
lincat Dig = TDigit ;
|
||||
|
||||
oper
|
||||
TDigit : Type = { s : CardOrd => Str ; n : Number } ;
|
||||
mkDig : Str -> TDigit = \c -> mk2Dig c Pl ;
|
||||
|
||||
mk2Dig : Str -> Number -> TDigit = \c,num ->
|
||||
{ s = table { NCard => c ;
|
||||
NOrd => c + "garren" } ;--TODO: make it more noun-like?
|
||||
n = num } ;
|
||||
|
||||
|
||||
|
||||
lin D_0 = mkDig "0" ;
|
||||
lin D_1 = mk2Dig "1" Sg ;
|
||||
lin D_2 = mkDig "2" ;
|
||||
lin D_3 = mkDig "3" ;
|
||||
lin D_4 = mkDig "4" ;
|
||||
lin D_5 = mkDig "5" ;
|
||||
lin D_6 = mkDig "6" ;
|
||||
lin D_7 = mkDig "7" ;
|
||||
lin D_8 = mkDig "8" ;
|
||||
lin D_9 = mkDig "9" ;
|
||||
|
||||
-- : Dig -> Digits ;
|
||||
lin IDig dig = dig ;
|
||||
-- : Dig -> Digits -> Digits ;
|
||||
lin IIDig dig digs = digs ** {s = \\co => glue (dig.s ! co) (digs.s ! co) } ;
|
||||
|
||||
}
|
||||
177
src/basque/ParadigmsEus.gf
Normal file
177
src/basque/ParadigmsEus.gf
Normal file
@@ -0,0 +1,177 @@
|
||||
resource ParadigmsEus = open CatEus, ResEus, Prelude in {
|
||||
|
||||
oper
|
||||
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over number, valency and (some) case names,
|
||||
-- we define the following identifiers. The application programmer
|
||||
-- should always use these constants instead of the constructors
|
||||
-- defined in $ResEus$.
|
||||
Number : Type ;
|
||||
sg : Number ;
|
||||
pl : Number ;
|
||||
|
||||
-- Only restricted to izan and ukan, no other synthetic verbs.
|
||||
-- If you need to add a new synthetic verb, see syntVerbNor and syntVerbNork in ResEus.
|
||||
AuxType : Type ;
|
||||
da : AuxType ;
|
||||
du : AuxType ;
|
||||
zaio : AuxType ;
|
||||
dio : AuxType ;
|
||||
|
||||
Case : Type ;
|
||||
absolutive : Case ;
|
||||
ergative : Case ;
|
||||
dative : Case ;
|
||||
genitive : Case ;
|
||||
partitive : Case ;
|
||||
inessive : Case ;
|
||||
instrumental : Case ; -- Instrumental :
|
||||
sociative : Case ; -- Sociative/comitative : txakurrarekin `with the dog'
|
||||
|
||||
Animacy : Type ;
|
||||
animate : Animacy ;
|
||||
inanim : Animacy ;
|
||||
|
||||
--2 Nouns
|
||||
|
||||
mkN = overload {
|
||||
mkN : Str -> N = \s -> lin N (mkNoun s) ;
|
||||
mkN : Str -> Bizi -> N = \s,bizi -> lin N (mkNoun s ** { anim = bizi }) ;
|
||||
} ;
|
||||
|
||||
mkPN : Str -> PN = \s -> lin PN (mkPNoun s) ;
|
||||
|
||||
mkN2 = overload {
|
||||
mkN2 : Str -> N2 = \s -> lin N2 (mkNoun2 s genitive) ;
|
||||
mkN2 : Str -> Case -> N2 = \s,cas -> lin N2 (mkNoun2 s cas) ;
|
||||
} ;
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
mkA = overload {
|
||||
mkA : Str -> A = \s -> lin A (regAdj s) ;
|
||||
mkA : Str -> A -> A = \s,a -> irregAdvAdj s a
|
||||
} ;
|
||||
|
||||
-- mkA2 : Str -> A2 = \s -> lin A2 (mkAdj s) ;
|
||||
|
||||
|
||||
|
||||
--2 Verbs
|
||||
|
||||
mkV = overload {
|
||||
|
||||
mkV : Str -> V = \s -> lin V (mkVerbDa s) ; --
|
||||
|
||||
mkV : Str -> V -> V = \lo,egin ->
|
||||
lin V (egin ** { prc = \\t => lo ++ egin.prc ! t }) ;
|
||||
|
||||
} ;
|
||||
|
||||
-- For verbs with non-inflecting participle, see izanV, egonV and ukanV.
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : Str -> V2 = \s -> lin V2 (mkVerbDu s) ;
|
||||
|
||||
mkV2 : Str -> AuxType -> V2 = \s,val -> lin V2 (mkVerbDa s ** { val = val }) ;
|
||||
|
||||
mkV2 : Str -> V -> V2 = \lo,egin ->
|
||||
lin V2 (egin ** { prc = \\t => lo ++ egin.prc ! t ;
|
||||
val = Du Ukan }) ;
|
||||
|
||||
} ;
|
||||
|
||||
mkVA : Str -> VA = \s -> lin VA (mkVerbDa s) ; -- Nor
|
||||
|
||||
mkV2A : Str -> V2A = \s -> lin V2A (mkVerbDu s) ; -- Nor-nork
|
||||
mkVQ : Str -> VQ = \s -> lin VQ (mkVerbDu s) ; -- Nor-nork
|
||||
mkVS : Str -> VS = \s -> lin VS (mkVerbDu s) ; -- Nor-nork
|
||||
|
||||
|
||||
mkV2V : Str -> V2V = \s -> lin V2V (mkVerbDio s) ; -- ??? TODO check valency
|
||||
mkV2S : Str -> V2S = \s -> lin V2S (mkVerbDio s) ; -- Nor-nori-nork: (mutilari) (neska datorrela) erantzun diot
|
||||
mkV2Q : Str -> V2Q = \s -> lin V2Q (mkVerbDio s) ; -- Nor-nori-nork: (mutilari) (neska datorren) galdetu diot
|
||||
mkV3 : Str -> V3 = \s -> lin V3 (mkVerbDio s) ; -- Nor-nori-nork: (mutilari) (garagardoa) edan diot
|
||||
|
||||
|
||||
-----
|
||||
-- Verbs with non-inflecting participle
|
||||
-- These are just Verb, use izanV or egonV for intransitive and ukanV for transitive.
|
||||
|
||||
izanV : Str -> Verb = \bizi ->
|
||||
mkVerbDa bizi ** { prc = \\_ => bizi } ; -- Non-inflecting participle, auxtype is Da (nor): e.g. "bizi naiz", "beldur naiz"
|
||||
|
||||
egonV : Str -> Verb = \zain ->
|
||||
mkVerbDaEgon zain ** { prc = \\_ => zain } ; -- Non-inflecting participle, auxtype is Da (nor), but with egon: e.g. "zain nago"
|
||||
|
||||
|
||||
ukanV : Str -> Verb = \maite ->
|
||||
mkVerbDu maite ** { prc = \\_ => maite } ; -- Non-inflecting participle, auxtype is Du (nor-nork): e.g, "maite zaitut"
|
||||
|
||||
|
||||
--2 Structural categories
|
||||
|
||||
mkPrep = overload {
|
||||
mkPrep : Str -> Prep = \s ->
|
||||
lin Prep (mkPost s genitive False) ; -- Default postposition: complement case genitive, not affixed; e.g. "nire atzean"
|
||||
|
||||
mkPrep : Str -> (complCase : Case) -> Prep = \s,compl ->
|
||||
lin Prep (mkPost s compl False) ; -- Specify complement case; not affixed
|
||||
|
||||
mkPrep : Str -> (complCase : Case) -> (affixed : Bool) -> Prep = \s,compl,konf ->
|
||||
lin Prep (mkPost s compl konf) ; -- Specify complement case and whether it is affixed
|
||||
} ;
|
||||
|
||||
affixPrep : Str -> Case -> Prep = \str,cas ->
|
||||
mkPrep str cas True ; -- Specify case, affix postposition to chosen case; e.g. neskaren+tzat `for the girl'
|
||||
|
||||
|
||||
locPrep : Str -> Prep = \str ->
|
||||
affixPrep str ResEus.LocStem ; -- Locative postpositions/cases attach to the same stem: mutile+tik, mutile+ra. Inessive is split into its own case, because of its behaviour with nouns ending in A.
|
||||
|
||||
|
||||
mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num -> lin Conj { s1 = s1 ; s2 = s2 ; nbr = num } ;
|
||||
mkSubj : Str -> Bool -> Subj = \s,b -> lin Subj { s = s ; isPre = b } ;
|
||||
|
||||
mkAdv : Str -> Adv = \s -> lin Adv {s = s} ;
|
||||
|
||||
mkAdV : Str -> AdV = \s -> lin AdV {s = s} ;
|
||||
|
||||
mkAdA : Str -> AdA = \s -> lin AdA {s = s} ;
|
||||
|
||||
|
||||
--.
|
||||
-------------------------------------------------------------------------------
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
|
||||
Number = ResEus.Number ;
|
||||
sg = Sg ;
|
||||
pl = Pl ;
|
||||
|
||||
AuxType = ResEus.AuxType ;
|
||||
da = Da Izan ;
|
||||
du = Du Ukan ;
|
||||
zaio = Zaio ;
|
||||
dio = Dio ;
|
||||
|
||||
Case = ResEus.Case ;
|
||||
absolutive = Abs ;
|
||||
ergative = Erg ;
|
||||
dative = Dat ;
|
||||
genitive = Gen ;
|
||||
partitive = Par ;
|
||||
inessive = Ine ;
|
||||
instrumental = Ins ;
|
||||
sociative = Soc ;
|
||||
|
||||
Animacy = ResEus.Bizi ;
|
||||
animate = Anim ;
|
||||
inanim = Inan ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
||||
101
src/basque/ParamEus.gf
Normal file
101
src/basque/ParamEus.gf
Normal file
@@ -0,0 +1,101 @@
|
||||
resource ParamEus = ParamX ** open Prelude in {
|
||||
|
||||
|
||||
param
|
||||
|
||||
ClType = Stat | Indir | Qst ;
|
||||
|
||||
|
||||
-- Every verb has some fully inflecting part:
|
||||
-- if the whole verb is one of these synthetic verbs, then there won't be a participle
|
||||
-- (or it's only in some tenses/persons/something).
|
||||
-- AditzTrinkoak has all the inflection tables fully spelt out,
|
||||
-- and here we just make nice neat set of parameters that go into the verbs.
|
||||
SyntVerb1 = Izan | Egon | Ibili | Etorri | Joan ;
|
||||
SyntVerb2 = Ukan | Jakin | Eduki ; --TODO others
|
||||
|
||||
|
||||
AuxType = Da SyntVerb1
|
||||
| Du SyntVerb2
|
||||
| Zaio | Dio ; --always Ukan ?
|
||||
|
||||
|
||||
|
||||
{-
|
||||
Type of adjectival phrase, e.g.
|
||||
|
||||
kale txiki+a [APType = Bare]
|
||||
itsaso+ra+ko kale+a [APType = Ko]
|
||||
-}
|
||||
APType = Ko | Bare ;
|
||||
|
||||
AForm = AF Degree | AAdv ;
|
||||
|
||||
Bizi = Inan | Anim ;
|
||||
|
||||
Case = Abs | Erg | Dat | Par -- Core argument cases
|
||||
| Gen | Soc | Ins | Ine -- Irregular stems
|
||||
| LocStem ; -- LocStem is inessive without -an; many other cases use same stem!
|
||||
|
||||
|
||||
-- Degree = Posit | Compar | Superl | Excess ;
|
||||
CardOrd = NCard | NOrd ;
|
||||
|
||||
Gender = Masc | Fem ;
|
||||
|
||||
Agr = Ni | Hi Gender | Zu | Hau | Gu | Zuek | Hauek ;
|
||||
|
||||
Phono = FinalA | FinalR | FinalCons | FinalVow ;
|
||||
|
||||
|
||||
oper
|
||||
-- Opers to manipulate params.
|
||||
|
||||
sgAgr : Agr -> Agr = \agr ->
|
||||
case agr of { Gu => Ni ;
|
||||
Zuek => Zu ;
|
||||
Hauek => Hau ;
|
||||
agr => agr } ;
|
||||
|
||||
plAgr : Agr -> Agr = \agr ->
|
||||
case agr of { Ni => Gu ;
|
||||
Zu => Zuek ;
|
||||
Hi _ => Zuek ;
|
||||
Hau => Hauek ;
|
||||
agr => agr } ;
|
||||
|
||||
getNum : Agr -> Number = \np ->
|
||||
case np of {
|
||||
(Ni|Hi _|Zu|Hau) => Sg ;
|
||||
(Gu|Zuek|Hauek) => Pl
|
||||
} ;
|
||||
|
||||
getPers : Agr -> Person = \np ->
|
||||
case np of {
|
||||
(Ni|Gu) => P1 ;
|
||||
(Hi _ |Zu|Zuek) => P2 ;
|
||||
(Hau|Hauek) => P3
|
||||
} ;
|
||||
|
||||
subjCase : AuxType -> Case = \val ->
|
||||
case val of {
|
||||
Da _ => Abs ;
|
||||
Zaio => Dat ;
|
||||
_ => Erg } ;
|
||||
|
||||
|
||||
isSynthetic : AuxType -> Bool = \val ->
|
||||
case val of {
|
||||
Da Izan => False ;
|
||||
Du Ukan => False ;
|
||||
Zaio => False ;
|
||||
Dio => False ;
|
||||
_ => True } ;
|
||||
|
||||
defaultAux : AuxType -> AuxType = \val ->
|
||||
case val of {
|
||||
Da _ => Da Izan ;
|
||||
Du _ => Du Ukan ;
|
||||
x => x } ;
|
||||
|
||||
}
|
||||
32
src/basque/PhraseEus.gf
Normal file
32
src/basque/PhraseEus.gf
Normal file
@@ -0,0 +1,32 @@
|
||||
concrete PhraseEus of Phrase = CatEus ** open Prelude, ResEus in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = { s = s.s.beforeAux ++ s.s.aux.indep ++ s.s.afterAux } ;
|
||||
UttQS qs = { s = let s = qs.s ! Qst
|
||||
in s.beforeAux ++ s.aux.indep ++ s.afterAux } ;
|
||||
|
||||
UttImpSg pol imp =
|
||||
let ez = case pol.p of { Pos => [] ; Neg => "ez" }
|
||||
in { s = ez ++ imp.s } ;
|
||||
UttImpPl = UttImpSg ;
|
||||
UttImpPol = UttImpSg ;
|
||||
|
||||
UttIP ip = { s = ip.s ! Abs} ;
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np = { s = np.s ! Abs} ;
|
||||
UttVP vp = { s = linVP vp } ;
|
||||
UttAdv adv = adv ;
|
||||
UttCN n = {s = n.s ! Hau ++ artDef ! Sg ! Abs ! n.ph } ;
|
||||
UttCard n = n ;
|
||||
UttAP ap = ap ;
|
||||
UttInterj i = i ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
PConjConj conj = { s = conj.s1 ++ conj.s2 } ;
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
VocNP np = { s = "," ++ np.s ! Abs } ;
|
||||
|
||||
}
|
||||
81
src/basque/QuestionEus.gf
Normal file
81
src/basque/QuestionEus.gf
Normal file
@@ -0,0 +1,81 @@
|
||||
concrete QuestionEus of Question = CatEus ** open ResEus, (VE=VerbEus), (NE=NounEus), (AE=AdverbEus) in {
|
||||
|
||||
-- A question can be formed from a clause ('yes-no question') or
|
||||
-- with an interrogative.
|
||||
|
||||
lin
|
||||
-- : Cl -> QCl ;
|
||||
QuestCl cl = cl ; --Cl and QCl are both ResEus.Clause :
|
||||
-- { s : Tense => Anteriority => Polarity => Sentence } ;
|
||||
|
||||
-- : IP -> VP -> QCl ;
|
||||
QuestVP = qclFromVP ;
|
||||
|
||||
-- : IP -> ClSlash -> QCl ; -- whom does John love / mutilak nor maite du
|
||||
QuestSlash = clFromSlash ;
|
||||
|
||||
-- : IAdv -> Cl -> QCl ; -- why does John walk
|
||||
-- nola (how), zerbait (how much), noiz (when), non (where), zergatik (why)
|
||||
QuestIAdv iadv cl =
|
||||
{ s = \\t,a,p,c =>
|
||||
let sent = cl.s ! t ! a ! p ! Indir ; -- no "al" with a wh-word!
|
||||
in { beforeAux = iadv.s ++ sent.beforeAux ;
|
||||
aux = sent.aux ;
|
||||
afterAux = sent.afterAux }
|
||||
} ;
|
||||
|
||||
-- : IComp -> NP -> QCl ; -- John non da ; TODO maybe other word order, non da John?
|
||||
QuestIComp icomp np = qclFromVP np (insertComp icomp.s (VE.copulaVP Izan)) ;
|
||||
|
||||
-- Interrogative pronouns can be formed with interrogative
|
||||
-- determiners, with or without a noun.
|
||||
|
||||
-- : IDet -> CN -> IP ; -- which five songs
|
||||
IdetCN = NE.DetCN ;
|
||||
|
||||
-- : IDet -> IP ; -- which five
|
||||
IdetIP = NE.DetNP ;
|
||||
|
||||
-- They can be modified with adverbs.
|
||||
-- : IP -> Adv -> IP ; -- who in Paris
|
||||
AdvIP = NE.AdvNP ;
|
||||
|
||||
-- Interrogative quantifiers have number forms and can take number modifiers.
|
||||
|
||||
-- : IQuant -> Num -> IDet ; -- which (five)
|
||||
IdetQuant = NE.DetQuant ;
|
||||
|
||||
-- Interrogative adverbs can be formed prepositionally.
|
||||
-- : Prep -> IP -> IAdv ; -- with whom
|
||||
PrepIP = AE.PrepNP ;
|
||||
|
||||
-- They can be modified with other adverbs.
|
||||
|
||||
-- : IAdv -> Adv -> IAdv ; -- where in Paris
|
||||
AdvIAdv = AE.AdAdv ;
|
||||
|
||||
-- Interrogative complements to copulas can be both adverbs and
|
||||
-- pronouns.
|
||||
|
||||
-- : IAdv -> IComp ;
|
||||
CompIAdv iadv = iadv ; -- where (is it)
|
||||
|
||||
-- : IP -> IComp ;
|
||||
CompIP ip = { s = ip.s ! Abs } ; -- who (is it)
|
||||
|
||||
{-
|
||||
-- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$.
|
||||
|
||||
-- Wh questions with two or more question words require a new, special category.
|
||||
|
||||
cat
|
||||
QVP ; -- buy what where
|
||||
fun
|
||||
ComplSlashIP : VPSlash -> IP -> QVP ; -- buys what
|
||||
AdvQVP : VP -> IAdv -> QVP ; -- lives where
|
||||
AddAdvQVP : QVP -> IAdv -> QVP ; -- buys what where
|
||||
|
||||
QuestQVP : IP -> QVP -> QCl ; -- who buys what where
|
||||
-}
|
||||
|
||||
}
|
||||
62
src/basque/RelativeEus.gf
Normal file
62
src/basque/RelativeEus.gf
Normal file
@@ -0,0 +1,62 @@
|
||||
concrete RelativeEus of Relative = CatEus ** open ResEus, Prelude, (NE=NounEus), (SE=StructuralEus) in {
|
||||
|
||||
|
||||
lin
|
||||
-- : Cl -> RCl ; -- such that John loves her ????
|
||||
RelCl cl = { -- TODO: this is likely horribly wrong!
|
||||
s = \\t,a,pol,agr =>
|
||||
let sent = cl.s ! t ! a ! pol ! Stat ;
|
||||
in sent.beforeAux ++ sent.aux.indep ++ sent.afterAux } ;
|
||||
|
||||
-- : RP -> VP -> RCl ;
|
||||
RelVP rp vp = ResEus.rclFromVP rp.s vp ;
|
||||
|
||||
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
||||
RelSlash rp cls = ResEus.rclFromSlash rp.s cls ;
|
||||
|
||||
|
||||
-- : RP ;
|
||||
IdRP = { s = BIND ++ "n" } ;
|
||||
|
||||
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
|
||||
FunRP prep np rp = { s = applyPost prep whom ++ np.s ! Abs }
|
||||
where { num = case np.agr of {
|
||||
Hau => NE.NumSg ;
|
||||
_ => NE.NumPl } ;
|
||||
whom = NE.DetNP (NE.DetQuant SE.which_IQuant num) } ;
|
||||
|
||||
{-
|
||||
12:18:16 < inariksit> or "the dog, to whom I sing"
|
||||
12:18:25 < inariksit> or "the dog, with whom I walk"
|
||||
12:18:55 < spectei> "the mother of whom?" = "la madre de quien?" = "noren ama?"
|
||||
12:19:37 < olatz> txakurra, zeinari abesten diodan. Would be the tranlsation, but....
|
||||
12:20:35 < inariksit> it's just like "the dog who loves beer" = "garagardoa maite duten txakurra", but now with a preposition; "the dog to whom the owner sings"
|
||||
12:21:04 < olatz> spectei, yes! and "zeinen ama?" too
|
||||
12:21:39 < olatz> jabeak abesten dion txakurra
|
||||
|
||||
12:22:36 < olatz> those are very complicated sentences!!
|
||||
12:22:37 < olatz> hahah
|
||||
12:23:02 < olatz> "the dog, to whom I sing" -> abesten diodan txakurra
|
||||
12:24:11 < inariksit> aah yeah, you have to change the copula too
|
||||
|
||||
12:27:23 < olatz> the dog, with whom I walk -> txakurra, zeinarekin ibiltzen naizen (this is absolutely not natural for basque :-S)
|
||||
12:29:27 < olatz> I walk with you -> zurekin ibiltzen naiz
|
||||
12:29:40 < olatz> I walk with the dog -> Txakurrarekin ibiltzen naiz
|
||||
12:30:40 < olatz> so..... walk with -> -kin ibili. but..... the dog,.... must be absolutive
|
||||
12:32:18 < spectei> yeah, you are missing a kind of word
|
||||
12:32:36 < spectei> that kind of word is a pro-NP that stands in place of the thing that the relative is modifying
|
||||
12:32:46 < olatz> txakurra, zeinarekin ibiltzen naizen
|
||||
12:32:53 < spectei> like HARGLE-kin ibiltzen naizen txakurra
|
||||
12:32:53 < begiak> bargle!
|
||||
12:33:02 < inariksit> so this kind of clause wouldn't come before the txakurra?
|
||||
12:33:41 < inariksit> like (nik) maite duten txakurra or (nik) abesten diodan txakurra
|
||||
12:34:18 < olatz> yes.... zeinarekin....
|
||||
12:35:54 < spectei> olatz, so "zeinarekin ibiltzen naizen txakurra" would be syntactically well formed?
|
||||
12:38:18 < olatz> I would say... txakurra, zeinarekin ibiltzen naizen
|
||||
12:39:20 < spectei> ok
|
||||
12:39:28 < olatz> I'm not a linguist so I'm not sure about the syntactic correctness of the one above, but I would correct it if one my
|
||||
students writes it.
|
||||
|
||||
-}
|
||||
|
||||
}
|
||||
618
src/basque/ResEus.gf
Normal file
618
src/basque/ResEus.gf
Normal file
@@ -0,0 +1,618 @@
|
||||
resource ResEus = ParamEus ** open TenseX, AditzTrinkoak, Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
coding=utf8 ;
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Articles
|
||||
oper
|
||||
|
||||
artDef : Number => Case => Phono => Str =
|
||||
let artASg = table {Abs => finalR "a" ; --itsaso+a ; txakur+ra
|
||||
Erg => finalR "ak" ;
|
||||
Dat => finalR "ari" ;
|
||||
Gen => finalR "aren" ;
|
||||
Soc => finalR "arekin" ;
|
||||
Ins => finalR "az" ;
|
||||
|
||||
Par => table {FinalA => BIND ++ "arik" ; --nesk+arik
|
||||
FinalCons => BIND ++ "ik" ; --mutil+ik
|
||||
_ => BIND ++ "rik" } ; --txakur+rik, itsaso+rik
|
||||
|
||||
Ine => table {FinalCons => BIND ++ "ean" ; --mutil+ean
|
||||
FinalR => BIND ++ "rean" ; --txakur+rean
|
||||
_ => BIND ++ "an" } ;--itsaso+an, nesk+an
|
||||
|
||||
LocStem => table {FinalCons => BIND ++ "e" ; --mutile+tik
|
||||
FinalR => BIND ++ "re" ; --txakurre+tik
|
||||
FinalA => BIND ++ "a" ; --neska+tik
|
||||
_ => [] } --itsaso+tik
|
||||
};
|
||||
in table {Sg => artASg ;
|
||||
Pl => table {Abs => finalR "ak" ;
|
||||
Erg => finalR "ek" ;
|
||||
Dat => finalR "ei" ;
|
||||
Gen => finalR "en" ;
|
||||
Soc => finalR "ekin" ;
|
||||
Ins => finalR "ez" ;
|
||||
Ine => finalR "etan" ;
|
||||
LocStem => finalR "eta" ; --txakur+ret+atik
|
||||
Par => artASg ! Par --invariant number in partitive
|
||||
}
|
||||
} ;
|
||||
|
||||
artIndef : Case => Phono => Str =
|
||||
\\cas,pho => case <cas,pho> of {
|
||||
<Abs,FinalA> => artDef ! Sg ! Abs ! FinalA ;
|
||||
<Abs> => [] ;
|
||||
<c,ph> => artDef ! Pl ! c ! ph } ;
|
||||
|
||||
|
||||
finalR : Str -> (Phono => Str) = \ak ->
|
||||
let rak : Str = "r" + ak ;
|
||||
in table {FinalR => BIND ++ rak ;
|
||||
_ => BIND ++ ak } ;
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Det, Quant
|
||||
|
||||
Determiner : Type = BaseDet **
|
||||
{ s : Case => Phono => Str ; -- hauek
|
||||
nbr : Number } ;
|
||||
|
||||
indefDet : Str -> Number -> Determiner = \zenbait,num ->
|
||||
{ s = artIndef ;
|
||||
indep = True ;
|
||||
nbr = num ;
|
||||
pref = zenbait ;
|
||||
isDef = False } ;
|
||||
|
||||
defDet : Str -> Number -> Determiner = \s,n ->
|
||||
indefDet s n ** { isDef = True } ;
|
||||
|
||||
Quant : Type = BaseDet ** { s : Number => Case => Phono => Str } ;
|
||||
|
||||
BaseDet : Type = { indep : Bool ;
|
||||
pref : Str ; -- nire
|
||||
isDef : Bool } ;
|
||||
|
||||
quantHau : Number => Case => Phono => Str =
|
||||
\\num,cas,ph =>
|
||||
let a = case ph of { FinalA => BIND ++ "a" ; _ => [] } ;
|
||||
in case <num,cas> of {
|
||||
<Sg,Abs> => a ++ "hau" ;
|
||||
<Sg,Erg> => a ++ "honek" ;
|
||||
<Sg,Dat> => a ++ "honi" ;
|
||||
<Sg,Gen> => a ++ "honen" ;
|
||||
<Sg,Soc> => a ++ "honekin" ;
|
||||
<Sg,Ins> => a ++ "honetaz" ;
|
||||
<Sg,Ine> => a ++ "honetan" ;
|
||||
<Sg,LocStem> => a ++ "honeta" ;
|
||||
<Pl,Abs> => a ++ "hauek" ;
|
||||
<Pl,Erg> => a ++ "hauek" ;
|
||||
<Pl,Dat> => a ++ "hauei" ;
|
||||
<Pl,Gen> => a ++ "hauen" ;
|
||||
<Pl,Soc> => a ++ "hauekin" ;
|
||||
<Pl,Ins> => a ++ "hauetaz" ;
|
||||
<Pl,Ine> => a ++ "hauetan" ;
|
||||
<Pl,LocStem> => a ++ "haueta" ;
|
||||
<_,Par> => artIndef ! Par ! ph ++ "hau" --TODO: check how to handle partitive
|
||||
} ;
|
||||
|
||||
quantHori : Number => Case => Phono => Str =
|
||||
\\num,cas,ph =>
|
||||
let a = case ph of { FinalA => BIND ++ "a" ; _ => [] } ;
|
||||
in case <num,cas> of {
|
||||
<Sg,Abs> => a ++ "hori" ;
|
||||
<Sg,Erg> => a ++ "horrek" ;
|
||||
<Sg,Dat> => a ++ "horri" ;
|
||||
<Sg,Gen> => a ++ "horren" ;
|
||||
<Sg,Soc> => a ++ "horrekin" ;
|
||||
<Sg,Ins> => a ++ "horretaz" ;
|
||||
<Sg,Ine> => a ++ "horretan" ;
|
||||
<Sg,LocStem> => a ++ "horreta" ;
|
||||
<Pl,Abs> => a ++ "horiek" ;
|
||||
<Pl,Erg> => a ++ "horiek" ;
|
||||
<Pl,Dat> => a ++ "horiei" ;
|
||||
<Pl,Gen> => a ++ "horien" ;
|
||||
<Pl,Soc> => a ++ "horiekin" ;
|
||||
<Pl,Ins> => a ++ "horietaz" ;
|
||||
<Pl,Ine> => a ++ "horietan" ;
|
||||
<Pl,LocStem> => a ++ "horieta" ;
|
||||
<_,Par> => artIndef ! Par ! ph ++ "hori"
|
||||
} ;
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Nouns and NPs
|
||||
|
||||
Noun : Type = { s : Str ; --for nouns ending in -a, we chop off the -a, and add it in the article + cases.
|
||||
ph : Phono ;
|
||||
anim : Bizi } ;
|
||||
|
||||
Noun2 : Type = Noun ** { compl1 : Postposizio } ; -- "mother of X": genitive?
|
||||
Noun3 : Type = Noun2 ** { compl2 : Postposizio } ; -- "mother of X": genitive?
|
||||
|
||||
PNoun : Type = Noun ** { nbr : Number } ;
|
||||
|
||||
mkNoun : Str -> Noun = \s ->
|
||||
let stem : Str = case last s of {
|
||||
"a" => init s ;
|
||||
_ => s } ;
|
||||
phono : Phono = case last s of {
|
||||
"a" => FinalA ;
|
||||
"r" => FinalR ;
|
||||
("e"|"i"|"o"|"u") => FinalVow ;
|
||||
_ => FinalCons }
|
||||
in { s = stem ; ph = phono ; anim=Inan } ;
|
||||
|
||||
mkNoun2 : Str -> Case -> Noun2 = \s,cas -> mkNoun s ** { compl1 = mkPost [] cas False } ;
|
||||
|
||||
mkPNoun : Str -> PNoun = \s -> mkNoun s ** {nbr = Sg ; anim=Anim} ;
|
||||
|
||||
|
||||
|
||||
CNoun : Type = { s : Agr => Str ; -- When we combine CN with RS, we introduce Agr distinction
|
||||
comp : Str ; -- For PartNP; "s = baso | bat | comp = ardo gorri"
|
||||
ph : Phono ;
|
||||
anim : Bizi ;
|
||||
heavyMod : Agr => Str } ; -- Relative clause or adverbial
|
||||
-- If it's "heavy", numbers and possessives come after.
|
||||
-- "Light" modifiers attach directly to the s.
|
||||
|
||||
linCNIndef : CNoun -> Str = linCN False ;
|
||||
linCNDef : CNoun -> Str = linCN True ;
|
||||
|
||||
linCN : Bool -> CNoun -> Str = \isDef,cn ->
|
||||
let art = if_then_else (Case => Phono => Str) isDef (artDef ! Sg) artIndef ;
|
||||
in cn.heavyMod ! Hau -- e.g. rel clause, adverb
|
||||
++ cn.s ! Hau -- baso handi
|
||||
++ art ! Abs ! cn.ph -- &+a / bat / -
|
||||
++ cn.comp ; -- ardo gorri
|
||||
|
||||
|
||||
|
||||
useN : Noun -> CNoun = \n -> n ** { s = \\_ => n.s ;
|
||||
comp = [] ;
|
||||
heavyMod = \\_ => [] } ;
|
||||
|
||||
Complement : Type = { s : Agr => Str ;
|
||||
copula : SyntVerb1 } ;
|
||||
|
||||
|
||||
NounPhrase : Type = { s : Case => Str ;
|
||||
stem : Str ; -- without article, used in ApposCN
|
||||
agr : Agr ;
|
||||
anim : Bizi ;
|
||||
isDef : Bool } ;
|
||||
|
||||
-- NounPhrase is a record
|
||||
-- a record is a thing with fields
|
||||
-- fields can be any type
|
||||
-- exempelvis, NounPhrase is a record with two fields
|
||||
-- the two fields are .s. and .agr.
|
||||
-- the field .s. is a table from Case => Str ... e.g. it has two columns, first column is Case and second column is Str
|
||||
-- last column is return type, all other columns are arguments
|
||||
-- exempelvis:
|
||||
--- { Abs => "hargle"; Erg => "bargle" }
|
||||
-- the field .agr. is of type Agr.
|
||||
|
||||
buru_NP : NounPhrase = { s = \\_ => "buru" ;
|
||||
stem = "buru" ;
|
||||
agr = Hau ;
|
||||
anim = Anim ;
|
||||
isDef = True } ;
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Postpositions
|
||||
|
||||
Postposizio : Type = { s : Str ;
|
||||
complCase : Case ; -- dirurik gabe : Par
|
||||
-- hormaren kontra : Gen
|
||||
affixed : Bool } ;
|
||||
|
||||
mkPost : Str -> Case -> Bool -> Postposizio = \ko,loc,b ->
|
||||
{ s = ko ; complCase = loc ; affixed = b } ;
|
||||
|
||||
noPost : Postposizio = mkPost [] Abs False ;
|
||||
|
||||
glueIf : Bool -> (_,_ : Str) -> Str = \affixed,a,b ->
|
||||
if_then_Str affixed (glue a b) (a ++ b) ;
|
||||
|
||||
applyPost : Postposizio -> NounPhrase -> Str = \post,np ->
|
||||
glueIf post.affixed (np.s ! post.complCase) post.s ;
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Pronoun
|
||||
|
||||
Pronoun : Type = NounPhrase ;
|
||||
|
||||
persPron : (x1,_,_,_,x5 : Str) -> Agr -> Pronoun = \nor,nori,nork,nore,zertaz,a->
|
||||
{ s = table { Erg => nork ;
|
||||
Abs => nor ;
|
||||
Dat => nori ;
|
||||
Par => nonExist ;
|
||||
Gen => nore ;
|
||||
Soc => nore + "kin" ;
|
||||
Ins => zertaz ;
|
||||
Ine => init zertaz + "n" ;
|
||||
LocStem => init zertaz
|
||||
} ;
|
||||
stem = nor ;
|
||||
agr = a ;
|
||||
anim = Anim ;
|
||||
isDef = True } ;
|
||||
|
||||
inanPron : (x1,_,_,_,x5 : Str) -> Agr -> Pronoun = \zer,zeri,zerk,zere,zertaz,a ->
|
||||
persPron zer zeri zerk zere zertaz a ** { anim = Inan } ;
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Adjective and AP
|
||||
|
||||
Adjective : Type = {s : AForm => Str ; ph : Phono} ;
|
||||
|
||||
Adjective2 : Type = Adjective ** { compl : Postposizio } ;
|
||||
|
||||
AdjPhrase : Type = {s : Str ; ph : Phono ; typ : APType} ;
|
||||
|
||||
regAdj : Str -> Adjective = \s ->
|
||||
let stem : Str = case last s of {
|
||||
"a" => init s ;
|
||||
_ => s } ;
|
||||
phono : Phono = case last s of {
|
||||
"a" => FinalA ;
|
||||
"r" => FinalR ;
|
||||
("e"|"i"|"o"|"u") => FinalVow ;
|
||||
_ => FinalCons }
|
||||
in { s = table { AF Posit => stem ;
|
||||
AF Compar => stem + "ago" ;
|
||||
AF Superl => stem + "en" ;
|
||||
AAdv => stem + "ki" } ;
|
||||
-- Excess => stem + "egi" } ;
|
||||
ph = phono } ;
|
||||
irregAdvAdj : Str -> Adjective -> Adjective = \adv,a ->
|
||||
a ** { s = table { AAdv => adv ;
|
||||
x => a.s ! x } } ;
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Verbs
|
||||
|
||||
|
||||
oper
|
||||
|
||||
Verb : Type = { prc : Tense => Str ;
|
||||
nstem : Str ; -- Nominal stem : ibiltze
|
||||
val : AuxType --TODO change name of the field
|
||||
} ;
|
||||
|
||||
mkVerbDa : Str -> Verb = \s -> { val = Da Izan ;
|
||||
nstem = mkNStem s ;
|
||||
prc = mkPrc s } ;
|
||||
|
||||
mkVerbDaEgon : Str -> Verb = \s -> { val = Da Egon ;
|
||||
nstem = mkNStem s ;
|
||||
prc = mkPrc s } ;
|
||||
|
||||
mkVerbDu : Str -> Verb = \s -> { val = Du Ukan ;
|
||||
nstem = mkNStem s ;
|
||||
prc = mkPrc s } ;
|
||||
|
||||
mkVerbDio : Str -> Verb = \s -> { val = Dio ;
|
||||
nstem = mkNStem s ;
|
||||
prc = mkPrc s } ;
|
||||
|
||||
-- Synthetic verbs
|
||||
syntVerbDa : Str -> SyntVerb1 -> Verb = \sEtorri,pEtorri ->
|
||||
mkVerbDa sEtorri ** { val = Da pEtorri } ;
|
||||
|
||||
syntVerbDu : Str -> SyntVerb2 -> Verb = \sJakin,pJakin ->
|
||||
mkVerbDu sJakin ** { val = Du pJakin } ;
|
||||
|
||||
mkNStem : Str -> Str = \ikusi ->
|
||||
let ikus : Str = case ikusi of {
|
||||
_ + ("du"|"tu") => init (init ikusi) ; -- ager+tu
|
||||
_ + ("p"|"t"|"k"
|
||||
|"b"|"d"|"g")
|
||||
+ "i" => ikusi ; -- jaiki
|
||||
_ + "ri" => init (init ikusi) ; -- etor+ri
|
||||
_ + "i" => init ikusi ; -- ibil+i
|
||||
_ + "l" => ikusi ; -- hil
|
||||
_ + "n" => ikusi ; --init ikusi ; -- jan
|
||||
_ => init ikusi } ;
|
||||
in case ikus of { x + "n" => x + "te" ;
|
||||
x + "ts" => x + "ste" ;
|
||||
_ + ("s"|"z") => ikus + "te" ;
|
||||
_ => ikus + "tze" } ;
|
||||
|
||||
mkPrc : Str -> (ResEus.Tense => Str) = \ikusi ->
|
||||
let ikuste = mkNStem ikusi ;
|
||||
ikusiko : Str = case last ikusi of {
|
||||
"n" => ikusi + "go" ;
|
||||
_ => ikusi + "ko" } ;
|
||||
in table { Pres => ikuste + "n" ;
|
||||
Fut => ikusiko ;
|
||||
_ => ikusi } ;
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- VP and VPSlash
|
||||
|
||||
DObj : Type = Polarity => Str ;
|
||||
|
||||
VerbPhrase : Type =
|
||||
Verb ** { dobj : { s : DObj ;
|
||||
agr : Agr ;
|
||||
isDef : Bool } ; --Indefinite direct object turns into Partitive with negative polarity.
|
||||
iobj : { s : Str ;
|
||||
agr : Agr } ;
|
||||
comp : Agr => Str ; -- Comps depend on Agr; AuxType is always Nor.
|
||||
adv : Str } ;
|
||||
|
||||
|
||||
VPSlash : Type = --VPSlashPrep may specify a postposition to use (for adv slot)
|
||||
VerbPhrase ** { post : Postposizio ;
|
||||
missing : MissingArg } ;
|
||||
|
||||
|
||||
param
|
||||
MissingArg = MissingAdv | MissingDObj | MissingIObj ;
|
||||
|
||||
oper
|
||||
--to be used in linref, PhraseEus ... anything where a VP is turned into string!
|
||||
linVP : VerbPhrase -> Str = linVPTense Pres Pres ;
|
||||
|
||||
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 } ;
|
||||
in
|
||||
vp.adv
|
||||
++ vp.iobj.s ++ vp.dobj.s ! Pos ++ vp.comp ! Hau --all the compls!
|
||||
++ prc
|
||||
++ (chooseAux vp ! tnsAux ! Hau).indep ;
|
||||
|
||||
-- Used in ComplVV : does not include aux!
|
||||
linVPPrc : VerbPhrase -> Str = \vp -> --TODO make it less of a hack.
|
||||
vp.adv
|
||||
++ vp.iobj.s ++ vp.dobj.s ! Pos ++ vp.comp ! Hau --all the compls!
|
||||
++ vp.prc ! Past ; --If we choose Past, then it will work with Jakin ...
|
||||
|
||||
|
||||
-----
|
||||
-- Create VP or VPSlash from various Verbs
|
||||
|
||||
useV : Verb -> VerbPhrase = \v ->
|
||||
v ** { dobj = { agr = Hau ; -- This will be used for *all* V* becoming VP!
|
||||
-- e.g. VQ, VS, ... will use a Du copula, but
|
||||
-- the sentence complement will be stored in comp field.
|
||||
-- This is because of V2Q, V2S versions you need both!
|
||||
--
|
||||
-- In the VQ, VS... version, dObj agreement is always Hau. (No exceptions?)
|
||||
-- So this function, while looking dangerous, should do the Right Thing.
|
||||
s = \\agr => [] ;
|
||||
isDef = True } ; --so that we don't choose singular agreement with negative polarity
|
||||
iobj = { s = [] ;
|
||||
agr = Hau } ;
|
||||
adv = [] ;
|
||||
comp = \\agr => [] } ;
|
||||
|
||||
slashV : MissingArg -> Verb -> VPSlash = \missingArg,vstar -> useV vstar **
|
||||
{ post = noPost ;
|
||||
missing = missingArg } ;
|
||||
|
||||
slashDObj : Verb -> VPSlash = slashV MissingDObj ; --works for V2, V2V, V2S, V2Q, V2A.
|
||||
|
||||
slashIObj : Verb -> VPSlash = slashV MissingIObj ; --only Slash3V3
|
||||
|
||||
-----
|
||||
-- Modify existing VPs
|
||||
|
||||
insertAdv : SS -> VerbPhrase -> VerbPhrase = \a,vp ->
|
||||
vp ** { adv = vp.adv ++ a.s } ;
|
||||
|
||||
|
||||
insertComp = overload {
|
||||
|
||||
insertComp : (Agr => Str) -> VerbPhrase -> VerbPhrase = \c,vp ->
|
||||
vp ** { comp = \\agr => vp.comp ! agr ++ c ! agr } ;
|
||||
|
||||
insertComp : Str -> VerbPhrase -> VerbPhrase = \cStr,vp ->
|
||||
vp ** { comp = \\agr => vp.comp ! agr ++ cStr } ;
|
||||
} ;
|
||||
|
||||
-----
|
||||
-- Complete VPSlash into VP
|
||||
|
||||
complSlash : VPSlash -> NounPhrase -> VerbPhrase = \vps,np ->
|
||||
case vps.missing of {
|
||||
MissingAdv => vps ** { adv = applyPost vps.post np } ;
|
||||
MissingIObj => vps ** { iobj = np ** { s = np.s ! Dat }} ;
|
||||
MissingDObj => vps ** { dobj = np ** { s = mkDObj np }}
|
||||
} ;
|
||||
|
||||
mkDObj : NounPhrase -> DObj = \np ->
|
||||
table { Pos => np.s ! Abs ;
|
||||
Neg => np.s ! negCase }
|
||||
where { negCase = if_then_else Case np.isDef Abs Par } ;
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Clause and sentence
|
||||
|
||||
Sentence : Type = { beforeAux : Str ;
|
||||
aux : VForms ; -- Need to keep this open for SubjS
|
||||
afterAux : Str } ;
|
||||
|
||||
-- to be used for linref, PhraseEus, etc.
|
||||
linS : Sentence -> Str = \sent ->
|
||||
sent.beforeAux ++ sent.aux.indep ++ sent.afterAux ;
|
||||
|
||||
linSSub : Sentence -> Str -> Str = \sent,subj ->
|
||||
sent.beforeAux ++ glue sent.aux.stem subj ++ sent.afterAux ;
|
||||
|
||||
Clause : Type = { s : Tense => Anteriority => Polarity => ClType => Sentence } ;
|
||||
|
||||
linCl : Clause -> Str = \clause ->
|
||||
linS (clause.s ! Pres ! Simul ! Pos ! Stat) ;
|
||||
|
||||
-- ez al duzu katu beltza ikusi? / ez al duzu katu beltzik ikusi? (MassNP)
|
||||
-- ez dut katu beltza ikusi / ez dut katu beltzik ikusi (MassNP)
|
||||
-- ibiltzen al zara ; garagardoa edaten al duzu? ; nor dabil?
|
||||
-- mutilari garagardoa ematen al diozu?
|
||||
-- txakurrari abesten al diozu?
|
||||
|
||||
|
||||
qclFromVP = mkClause True ;
|
||||
clFromVP = mkClause False ;
|
||||
|
||||
clFromSlash : NounPhrase -> ClSlash -> Clause = \o,cls ->
|
||||
let obj = o ** { s = mkDObj o } ;
|
||||
vp = cls ** { dobj = obj } ; --Insert the object's agr into the cls's dobj!
|
||||
subj = buru_NP ** cls.subj ; -- Just a dummy NP, we won't use more than is in cls.subj
|
||||
in mkClause True subj vp ;
|
||||
|
||||
mkClause : (isIP : Bool) -> NounPhrase -> VerbPhrase -> Clause = \isIP,subj,vp ->
|
||||
{ s = \\t,a,pol =>
|
||||
let verb = case isSynthetic vp.val of {
|
||||
True => verbformSynthetic t a vp ;
|
||||
False => verbformPeriphrastic t a vp
|
||||
} ;
|
||||
sc : Case = subjCase vp.val ;
|
||||
in wordOrder isIP
|
||||
{ pol = pol ;
|
||||
adv = vp.adv ;
|
||||
subj = subj.s ! sc ;
|
||||
compl = vp.iobj.s -- mutilari
|
||||
++ vp.dobj.s ! pol -- garagardoa / garagardorik
|
||||
++ vp.comp ! subj.agr ; -- etorriko dela / nor den / handi(ak) / ...
|
||||
prc = verb.prc ;
|
||||
aux = verb.aux ! subj.agr }
|
||||
} ;
|
||||
|
||||
verbformPeriphrastic : Tense -> Anteriority -> VerbPhrase -> {aux : Agr => VForms ; prc : Str} = \t,a,vp ->
|
||||
let adl : IntransV = chooseAux vp ;
|
||||
in case <t,a> of {
|
||||
<Pres,Simul> => {aux = adl ! Pres ; prc = vp.prc ! Pres} ; --noa / lo egiten da
|
||||
<Pres,Anter> => {aux = adl ! Pres ; prc = vp.prc ! Past} ; --joan da / lo egin da
|
||||
<Past,Simul> => {aux = adl ! Past ; prc = vp.prc ! Pres} ; --nindoan / lo egiten zen
|
||||
<Past,Anter> => {aux = adl ! Past ; prc = vp.prc ! Past} ; --joan nintzen / ...
|
||||
<Fut,Simul> => {aux = adl ! Pres ; prc = vp.prc ! Fut} ; --joango da
|
||||
<Fut,Anter> => {aux = adl ! Pres ; prc = vp.prc ! Fut} ; --joango nintzen
|
||||
<Cond,Simul> => {aux = adl ! Cond ; prc = vp.prc ! Fut} ; --joango nintzateke
|
||||
<Cond,Anter> => {aux = adl ! Cond ; prc = vp.prc ! Past} } ;--joan nintzateke
|
||||
|
||||
--TODO: write a fallback for synthetic verbs without all forms
|
||||
verbformSynthetic : Tense -> Anteriority -> VerbPhrase -> {aux : Agr => VForms ; prc : Str} = \t,a,vp ->
|
||||
let adt : IntransV = chooseAux vp ;
|
||||
in case <t,a> of {
|
||||
<Pres,Simul> => {aux = adt ! Pres ; prc = []} ; --noa
|
||||
<Past,Simul> => {aux = adt ! Past ; prc = []} ; --nindoan
|
||||
_ => verbformPeriphrastic t a (vp ** {val = defaultAux vp.val}) } ;
|
||||
|
||||
|
||||
|
||||
chooseAux : VerbPhrase -> IntransV = chooseAuxPol Pos ;
|
||||
|
||||
--TODO: add other synthetic transitive verbs
|
||||
chooseAuxPol : Polarity -> VerbPhrase -> IntransV = \pol,vp ->
|
||||
case vp.val of {
|
||||
Da x => AditzTrinkoak.syntIntransVerb (Da x) ;
|
||||
|
||||
Zaio => AditzTrinkoak.ukanZaio ! vp.iobj.agr ; --are there other Zaio (nor-nori) verbs?
|
||||
|
||||
Du x =>
|
||||
let aux = AditzTrinkoak.syntTransVerb (Du x)
|
||||
in case <pol,vp.dobj.isDef> of {
|
||||
<Neg,False> => aux ! sgAgr vp.dobj.agr;
|
||||
_ => aux ! vp.dobj.agr } ;
|
||||
|
||||
Dio =>
|
||||
case <pol,vp.dobj.isDef> of {
|
||||
<Neg,False> => AditzTrinkoak.ukanDio ! vp.iobj.agr ! sgAgr vp.dobj.agr ;
|
||||
_ => AditzTrinkoak.ukanDio ! vp.iobj.agr ! vp.dobj.agr} } ;
|
||||
|
||||
|
||||
wordOrder : (isIP : Bool) -> SentenceLight -> (ClType => Sentence) = \isIP,s ->
|
||||
\\ct =>
|
||||
let al = case ct of { Qst => if_then_Str isIP [] "al" ;
|
||||
_ => [] } ;
|
||||
in case s.pol of {
|
||||
Pos => { beforeAux = s.adv ++ s.subj ++ s.compl ++ s.prc ++ al ;
|
||||
aux = s.aux ;
|
||||
afterAux = [] } ;
|
||||
Neg => { beforeAux = s.adv ++ s.subj ++ "ez" ++ al ;
|
||||
aux = s.aux ;
|
||||
afterAux = s.compl ++ s.prc }
|
||||
} ;
|
||||
|
||||
--just an internal type, to give as an argument to wordOrder
|
||||
SentenceLight : Type = { pol : Polarity ;
|
||||
adv : Str ; --heavyAdv and lightAdv?
|
||||
subj : Str ;
|
||||
compl : Str ;
|
||||
prc : Str ;
|
||||
aux : VForms } ;
|
||||
|
||||
|
||||
------------------------------------------------
|
||||
-- ClSlash: has verb and subject, missing object
|
||||
ClSlash : Type = VerbPhrase ** { subj : {s : Case => Str ; agr : Agr } } ;
|
||||
|
||||
|
||||
mkClSlash : NounPhrase -> VPSlash -> ClSlash = \np,vps ->
|
||||
let sc : Case = subjCase vps.val ;
|
||||
in vps ** { subj = np };
|
||||
|
||||
------------------------------------------------
|
||||
-- Relative clause
|
||||
-- We need to keep agreement, because a RS may be attached to a CN or NP,
|
||||
-- and we need to produce correct agreement:
|
||||
-- `gorria den txakurra' vs. `gorriak diren txakurrak'
|
||||
|
||||
RClause : Type = {s : Tense => Anteriority => Polarity => Agr => Str } ;
|
||||
|
||||
rclFromVP : Str -> VerbPhrase -> RClause = \en,vp ->
|
||||
mkRCl en (vp ** { subj = { s = \\_ => [] ; agr = Hau } ; -- Subj agr will change later
|
||||
objFixed = True }) ;
|
||||
|
||||
rclFromSlash : Str -> ClSlash -> RClause = \en,cls ->
|
||||
mkRCl en (cls ** { objFixed = False }) ;
|
||||
|
||||
|
||||
mkRCl : Str -> (ClSlash ** {objFixed : Bool}) -> RClause = \en,cls ->
|
||||
{ s = \\t,a,pol,agr =>
|
||||
let ez = case pol of { Neg => "ez" ; _ => [] } ;
|
||||
objAgr : Agr = case cls.objFixed of {
|
||||
True => cls.dobj.agr ;
|
||||
False => agr } ;
|
||||
subjAgr : Agr = case cls.objFixed of {
|
||||
True => agr ;
|
||||
False => cls.subj.agr } ;
|
||||
sc : Case = subjCase cls.val ;
|
||||
|
||||
-- We make sure that the agr param in RS affects the right argument
|
||||
cls' = cls ** { dobj = cls.dobj ** { agr = objAgr } ;
|
||||
subj = cls.subj ** { agr = subjAgr } } ;
|
||||
|
||||
verb = case isSynthetic cls.val of {
|
||||
True => verbformSynthetic t a cls' ;
|
||||
False => verbformPeriphrastic t a cls' } ;
|
||||
in cls'.adv
|
||||
--- One of the following ---
|
||||
++ cls'.iobj.s -- mutilari (If coming from ClSlash,
|
||||
++ cls'.dobj.s ! pol -- garagardoa these are empty)
|
||||
++ cls'.comp ! agr
|
||||
|
||||
++ cls'.subj.s ! sc -- mutilak (If coming from VP, this is empty)
|
||||
|
||||
--- Common to VP and ClSlash ---
|
||||
++ verb.prc -- maite
|
||||
++ ez -- (ez)
|
||||
++ (verb.aux ! subjAgr).stem -- d(it)u
|
||||
++ en -- en
|
||||
} ;
|
||||
}
|
||||
95
src/basque/SentenceEus.gf
Normal file
95
src/basque/SentenceEus.gf
Normal file
@@ -0,0 +1,95 @@
|
||||
concrete SentenceEus of Sentence = CatEus ** open TenseX, ResEus, AditzTrinkoak, (AE=AdverbEus), Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
--2 Clauses
|
||||
|
||||
-- : NP -> VP -> Cl
|
||||
PredVP = clFromVP ;
|
||||
|
||||
-- : SC -> VP -> Cl ; -- that she goes is good
|
||||
PredSCVP sc vp =
|
||||
let subjSC = invarNP sc.s
|
||||
in clFromVP subjSC vp ;
|
||||
|
||||
--2 Clauses missing object noun phrases
|
||||
-- : NP -> VPSlash -> ClSlash ;
|
||||
SlashVP = mkClSlash ;
|
||||
|
||||
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
|
||||
AdvSlash cls adv = cls ** insertAdv adv cls ;
|
||||
|
||||
-- SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks
|
||||
|
||||
-- : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves
|
||||
-- SlashVS np vs ss = {} ;
|
||||
|
||||
|
||||
-- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen
|
||||
UseSlash t p cls =
|
||||
let emptyObj = invarNP [] ; --TODO: object agr is Hau, might this cause problems later?
|
||||
cl = clFromSlash emptyObj cls
|
||||
in UseCl t p cl ;
|
||||
|
||||
--2 Imperatives
|
||||
-- : VP -> Imp ;
|
||||
ImpVP vp = { s = linVPPrc vp } ; --TODO: check negation
|
||||
|
||||
--2 Embedded sentences
|
||||
|
||||
|
||||
-- : S -> SC ;
|
||||
EmbedS s = { s = linSSub s.s "la" } ; -- datorrela
|
||||
|
||||
-- : QS -> SC ;
|
||||
EmbedQS qs = { s = linSSub (qs.s ! Indir) "la" } ; --???
|
||||
|
||||
-- : VP -> SC ; -- ikusi
|
||||
EmbedVP vp = { s = linVPPrc vp } ;
|
||||
|
||||
--2 Sentences
|
||||
|
||||
|
||||
-- : Temp -> Pol -> Cl -> S ;
|
||||
UseCl temp pol cl = { s = cl.s ! temp.t ! temp.a ! pol.p ! Stat } ;
|
||||
|
||||
-- : Temp -> Pol -> RCl -> RS ;
|
||||
UseRCl temp pol cl = { s = cl.s ! temp.t ! temp.a ! pol.p } ;
|
||||
|
||||
-- : Temp -> Pol -> QCl -> QS ;
|
||||
UseQCl temp pol qcl = { s = qcl.s ! temp.t ! temp.a ! pol.p } ;
|
||||
|
||||
-- An adverb can be added to the beginning of a sentence, either with comma ("externally")
|
||||
-- or without:
|
||||
|
||||
-- : Adv -> S -> S ; -- then I will go home
|
||||
AdvS adv = insertBeforeAux adv.s ;
|
||||
|
||||
-- : Adv -> S -> S ; -- next week, I will go home
|
||||
ExtAdvS adv = insertBeforeAux (adv.s ++ SOFT_BIND ++ ",") ;
|
||||
|
||||
-- There's an SubjS already in AdverbEus -- should this be deprecated?
|
||||
-- : S -> Subj -> S -> S ;
|
||||
SSubjS s1 subj s2 = AdvS (AE.SubjS subj s2) s1 ;
|
||||
|
||||
|
||||
-- A sentence can be modified by a relative clause referring to its contents.
|
||||
|
||||
-- : S -> RS -> S ; -- she sleeps, which is good
|
||||
RelS sent rs = insertBeforeAux (rs.s ! Hau ++ SOFT_BIND ++ ",") sent ;
|
||||
|
||||
oper
|
||||
insertBeforeAux : Str -> { s : Sentence } -> { s : Sentence } = \str,sent ->
|
||||
let newS = sent.s ** { beforeAux = str ++ sent.s.beforeAux } ;
|
||||
in { s = newS };
|
||||
|
||||
invarNP : Str -> NounPhrase = \str ->
|
||||
{ s = \\c => str ;
|
||||
stem = str ;
|
||||
agr = Hau ;
|
||||
anim = Inan ;
|
||||
isDef = True } ;
|
||||
|
||||
}
|
||||
179
src/basque/StructuralEus.gf
Normal file
179
src/basque/StructuralEus.gf
Normal file
@@ -0,0 +1,179 @@
|
||||
concrete StructuralEus of Structural = CatEus **
|
||||
open Prelude, (R=ResEus), (N=NounEus), ParadigmsEus in {
|
||||
|
||||
|
||||
|
||||
-------
|
||||
-- Ad*
|
||||
|
||||
lin almost_AdA = mkAdA "ia" ;
|
||||
lin almost_AdN = ss "ia" ;
|
||||
lin at_least_AdN = ss "gutxienez" ;
|
||||
lin at_most_AdN = ss "gehienez" ;
|
||||
lin so_AdA = ss "hain" ;
|
||||
lin too_AdA = ss "gehiegi" ;
|
||||
lin very_AdA = mkAdA "oso" ;
|
||||
|
||||
lin as_CAdv = { s = "bezain" ; p = [] } ;
|
||||
lin less_CAdv = { s = "gutxiago" ; p = [] } ;
|
||||
lin more_CAdv = { s = "gehiago" ; p = [] } ;
|
||||
|
||||
lin how_IAdv = ss "nola" ;
|
||||
lin how8much_IAdv = ss "zerbait" ;
|
||||
lin when_IAdv = ss "noiz" ;
|
||||
lin where_IAdv = ss "non" ;
|
||||
lin why_IAdv = ss "zergatik" ;
|
||||
|
||||
lin always_AdV = ss "beti" ;
|
||||
|
||||
lin everywhere_Adv = ss "nonahi" ;
|
||||
lin here7from_Adv = ss "hemendik" ;
|
||||
lin here7to_Adv = ss "hona" ;
|
||||
lin here_Adv = ss "hemen" ;
|
||||
lin quite_Adv = ss "nahiko" ;
|
||||
lin somewhere_Adv = ss "nonbait" ;
|
||||
lin there7from_Adv = ss "hortik" ;
|
||||
lin there7to_Adv = ss "horra" ;
|
||||
lin there_Adv = ss "hor" ;
|
||||
|
||||
|
||||
-------
|
||||
-- Conj
|
||||
|
||||
lin and_Conj = mkConj [] "eta" pl ;
|
||||
lin or_Conj = mkConj [] "edo" sg ;
|
||||
lin if_then_Conj = mkConj [] "orduan" sg ; --TODO: is there even a way to say this? "if boys then girls"
|
||||
lin both7and_DConj = mkConj "bai" "eta" pl ;
|
||||
lin either7or_DConj = mkConj "bai" "edo" pl ;
|
||||
|
||||
lin but_PConj = ss "baina" ;
|
||||
lin otherwise_PConj = ss "bestela" ;
|
||||
--lin therefore_PConj
|
||||
|
||||
|
||||
-----------------
|
||||
-- *Det and Quant
|
||||
|
||||
lin how8many_IDet = R.indefDet "zenbat" pl ;
|
||||
|
||||
--TODO: fix predets in NounEus, figure out whether Predet should inflect
|
||||
lin all_Predet = { s = "guzti" } ;
|
||||
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 few_Det = R.indefDet "gutxi" pl ;
|
||||
lin many_Det = R.indefDet "asko" pl ;
|
||||
lin much_Det = R.indefDet "asko" sg ;
|
||||
lin somePl_Det = R.indefDet "zenbait" pl ;
|
||||
lin someSg_Det = R.indefDet "zenbait" sg ;
|
||||
|
||||
lin no_Quant = R.indefDet "ez" sg ** { s = R.artDef } ; --TODO: this is just the word for "no"; not even sure if it's possible to have no_Quant
|
||||
|
||||
lin that_Quant = R.defDet [] sg ** { s = R.quantHori } ;
|
||||
lin this_Quant = R.defDet [] sg ** { s = R.quantHau } ;
|
||||
lin which_IQuant = R.defDet "zein" sg ** { s = R.artDef } ;
|
||||
|
||||
|
||||
-----
|
||||
-- NP
|
||||
|
||||
lin everybody_NP = defNP "dena" N.NumPl ;
|
||||
lin everything_NP = defNP "dena" N.NumSg ;
|
||||
lin nobody_NP = defNP "ez inor" N.NumSg ; --TODO: negation should be in the verb; "ez da inor"
|
||||
lin nothing_NP = defNP "ezer" N.NumSg ;
|
||||
--lin somebody_NP =
|
||||
--lin something_NP =
|
||||
|
||||
oper
|
||||
defNP : Str -> Num -> NP = \dena,num ->
|
||||
N.DetCN (N.DetQuant N.DefArt num)
|
||||
(N.UseN (R.mkNoun dena)) ;
|
||||
-------
|
||||
-- Prep
|
||||
|
||||
lin above_Prep = mkPrep "gainean" ;
|
||||
lin after_Prep = mkPrep "ondoan" ;
|
||||
lin before_Prep = mkPrep "gabe" absolutive ;
|
||||
lin behind_Prep = mkPrep "atzean" ;
|
||||
lin between_Prep = mkPrep "artean" ; --`bitartean' for time
|
||||
lin by8agent_Prep = mkPrep [] ergative ; -- choose just case, no separate postposition
|
||||
lin by8means_Prep = mkPrep [] instrumental ;
|
||||
lin during_Prep = mkPrep [] inessive ; --- ???
|
||||
lin except_Prep = mkPrep "gain" sociative ;
|
||||
lin for_Prep = affixPrep "tzat" genitive ;
|
||||
lin from_Prep = locPrep "tik" ; --- ?
|
||||
lin in8front_Prep = mkPrep "aurrean" ;
|
||||
lin in_Prep = mkPrep [] inessive ;
|
||||
lin on_Prep = mkPrep "gainean" ;
|
||||
lin part_Prep = mkPrep [] partitive ;
|
||||
lin possess_Prep = mkPrep [] ; --Genitive. TODO add locative genitive in extra
|
||||
lin through_Prep = mkPrep "barrena" inessive ; -- ?
|
||||
lin to_Prep = mkPrep [] dative ; --"I gave it to Fran", not "I went to school"
|
||||
lin under_Prep = mkPrep "azpian" ;
|
||||
lin with_Prep = mkPrep [] sociative ;
|
||||
lin without_Prep = mkPrep "gabe" partitive ; --absolutive ;
|
||||
|
||||
|
||||
-------
|
||||
-- Pron
|
||||
|
||||
-- Pronouns are closed class, no constructor in ParadigmsEus.
|
||||
|
||||
lin i_Pron = R.persPron "ni" "niri" "nik" "nire" "nitaz" R.Ni ;
|
||||
lin we_Pron = R.persPron "gu" "guri" "guk" "gure" "gutaz" R.Gu ;
|
||||
lin youSg_Pron = R.persPron "zu" "zuri" "zuk" "zure" "zutaz" R.Zu ; -- in Extra: hi/hire
|
||||
lin youPl_Pron = R.persPron "zuek" "zuei" "zuen" "zuen" "zuetaz" R.Zuek ;
|
||||
lin youPol_Pron = R.persPron "zu" "zuri" "zuk" "zure" "zutaz" R.Zu ;
|
||||
lin he_Pron = R.persPron "hura" "hari" "hark" "haren" "hartaz" R.Hau ;
|
||||
lin she_Pron = R.persPron "hura" "hari" "hark" "haren" "hartaz" R.Hau ;
|
||||
lin it_Pron = R.persPron "hau" "honi" "honek" "bere" "honetaz" R.Hau ;
|
||||
lin they_Pron = R.persPron "hauek" "hauei" "hauek" "beren" "hauetaz" R.Hauek ; -- in Extra: other forms
|
||||
|
||||
lin whatPl_IP = R.inanPron "zertzuk" "zertzuei" "zertzuek" "zertzuen" "zertzuetaz" R.Hauek ;
|
||||
lin whatSg_IP = R.inanPron "zer" "zeri" "zerk" "zeren" "zertaz" R.Hau ;
|
||||
lin whoPl_IP = R.persPron "nortzuk" "nortzuei" "nortzuek" "nortzuen" "nortzuetaz" R.Hauek ;
|
||||
lin whoSg_IP = R.persPron "nor" "nori" "nork" "noren" "zertaz" R.Hau ;
|
||||
|
||||
|
||||
|
||||
|
||||
-------
|
||||
-- Subj
|
||||
|
||||
lin although_Subj = mkSubj "en arren" False ; -- askotan ez dirudien arren
|
||||
lin because_Subj = mkSubj "lako" False ;
|
||||
lin if_Subj = mkSubj "ba" True ;
|
||||
lin that_Subj = mkSubj "n" False ;
|
||||
lin when_Subj = mkSubj "nean" False ;
|
||||
|
||||
|
||||
|
||||
------
|
||||
-- Utt
|
||||
|
||||
lin language_title_Utt = ss "euskara" ;
|
||||
lin no_Utt = ss "ez" ; --?
|
||||
lin yes_Utt = ss "bai" ;
|
||||
|
||||
|
||||
-------
|
||||
-- Verb
|
||||
|
||||
lin have_V2 = R.syntVerbDu "eduki" R.Eduki ;
|
||||
|
||||
lin can8know_VV = ukanV "ahal" ; -- can (capacity)
|
||||
lin can_VV = ukanV "ahal" ; -- can (possibility)
|
||||
lin must_VV = ukanV "behar" ;
|
||||
lin want_VV = ukanV "nahi" ;
|
||||
|
||||
|
||||
------
|
||||
-- Voc
|
||||
|
||||
lin please_Voc = ss "mesedez" ;
|
||||
|
||||
}
|
||||
51
src/basque/SymbolEus.gf
Normal file
51
src/basque/SymbolEus.gf
Normal file
@@ -0,0 +1,51 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete SymbolEus of Symbol = CatEus ** open Prelude, ParadigmsEus, ResEus, (NE=NounEus) in {
|
||||
|
||||
lin
|
||||
|
||||
-- : Symb -> PN ; -- x
|
||||
SymbPN i = mkPNoun i.s ;
|
||||
|
||||
-- : Int -> PN ; -- 27
|
||||
IntPN i = mkPNoun i.s ;
|
||||
|
||||
-- : Float -> PN ; -- 3.14159
|
||||
FloatPN i = mkPNoun i.s ;
|
||||
|
||||
-- : Card -> PN ; -- twelve [as proper name]
|
||||
NumPN i = mkPNoun i.s ;
|
||||
|
||||
-- CNIntNP cn i = {} ;
|
||||
|
||||
-- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
|
||||
CNSymbNP det cn xs =
|
||||
let cnSymb = cn ** { comp = cn.comp ++ xs.s }
|
||||
in NE.DetCN det cnSymb ;
|
||||
|
||||
-- : CN -> Card -> NP ; -- level five ; level 5
|
||||
CNNumNP cn i = NE.MassNP (cn ** { comp = cn.comp ++ i.s }) ;
|
||||
|
||||
-- : Symb -> S ;
|
||||
SymbS sy = {s = { beforeAux = sy.s ;
|
||||
aux = {indep = "da" ; stem = "de" } ;
|
||||
afterAux = [] } } ;
|
||||
-- : Symb -> Card ;
|
||||
SymbNum sy = { s = sy.s ; n = Pl } ;
|
||||
|
||||
-- : Symb -> Ord ;
|
||||
SymbOrd sy = { s = sy.s ++ BIND ++ "garren" ; n = Pl } ;
|
||||
|
||||
lincat
|
||||
|
||||
Symb, [Symb] = SS ;
|
||||
|
||||
lin
|
||||
MkSymb s = s ;
|
||||
|
||||
BaseSymb = infixSS "eta" ;
|
||||
ConsSymb = infixSS "," ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
168
src/basque/VerbEus.gf
Normal file
168
src/basque/VerbEus.gf
Normal file
@@ -0,0 +1,168 @@
|
||||
concrete VerbEus of Verb = CatEus ** open ResEus, AditzTrinkoak, Prelude in {
|
||||
|
||||
|
||||
lin
|
||||
|
||||
-----
|
||||
-- VP
|
||||
|
||||
UseV = ResEus.useV ;
|
||||
|
||||
-- : VV -> VP -> VP ; -- [lo egin/neska ikusi/jakin] nahi/ahal/behar dut
|
||||
ComplVV vv vp =
|
||||
let vcomp : Str = linVPPrc vp ;
|
||||
in ResEus.insertComp vcomp (useV vv) ;
|
||||
|
||||
|
||||
-- : VS -> S -> VP ; -- uste dut [neska etorriko dela]
|
||||
-- The subordinator suffix -la is hardcoded in ComplVS
|
||||
-- In Extra: ComplVS that takes the S with other suffixes (-en,-tzera)
|
||||
ComplVS vs s =
|
||||
let scomp : Str = linSSub s.s "la" ;
|
||||
in ResEus.insertComp scomp (useV vs) ;
|
||||
|
||||
-- : VQ -> QS -> VP ; -- ez dakit [nor den]
|
||||
ComplVQ vq qs =
|
||||
let qi : Sentence = qs.s ! Indir ; -- choose the version without al
|
||||
qcomp : Str = linSSub qi "n" ;
|
||||
in ResEus.insertComp qcomp (useV vq) ;
|
||||
|
||||
-- : VA -> AP -> VP ; -- they become red
|
||||
ComplVA va ap = ResEus.insertComp (CompAP ap).s (useV va) ;
|
||||
|
||||
|
||||
--------
|
||||
-- Slash
|
||||
|
||||
-- : V2 -> VPSlash
|
||||
SlashV2a = ResEus.slashDObj ;
|
||||
|
||||
|
||||
-- : V3 -> NP -> VPSlash ; -- give it (to her)
|
||||
Slash2V3 v3 npNori = slashDObj v3 **
|
||||
{ iobj = { s = npNori.s ! Dat ;
|
||||
agr = npNori.agr }
|
||||
} ;
|
||||
|
||||
-- : V3 -> NP -> VPSlash ; -- give (it) to her
|
||||
Slash3V3 v3 npNor = slashIObj v3 **
|
||||
{ dobj = npNor ** { s = mkDObj npNor }
|
||||
} ;
|
||||
|
||||
|
||||
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
|
||||
SlashV2V v2v vp = slashDObj v2v ** -- TODO: something wrong in this function!
|
||||
{ comp = \\agr => linVPPrc vp } ; --How about agreement with tense of the main clause???
|
||||
|
||||
|
||||
-- : V2S -> S -> VPSlash ; -- answer (to him) that it is good
|
||||
SlashV2S v2s s = slashDObj v2s **
|
||||
{ comp = \\agr => linSSub s.s "la" } ;
|
||||
|
||||
-- : V2Q -> QS -> VPSlash ; -- ask (him) who came
|
||||
SlashV2Q v2q qs = slashDObj v2q **
|
||||
{ comp = \\agr => linSSub (qs.s ! Indir) "la" } ;
|
||||
|
||||
-- : V2A -> AP -> VPSlash ; -- paint (it) red
|
||||
SlashV2A v2a ap = slashDObj v2a **
|
||||
{ comp = (CompAP ap).s } ;
|
||||
|
||||
|
||||
-- : VPSlash -> NP -> VP
|
||||
ComplSlash vps np = ResEus.complSlash vps np ;
|
||||
|
||||
|
||||
-- : VV -> VPSlash -> VPSlash ; -- [___ ikusi] nahi/ahal/behar dut
|
||||
-- Just like ComplVV except missing subject!
|
||||
SlashVV vv vps = ComplVV vv vps ** { missing = vps.missing ;
|
||||
post = vps.post } ;
|
||||
|
||||
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
|
||||
SlashV2VNP v2v np vps =
|
||||
ComplVV v2v vps **
|
||||
{ missing = vps.missing ;
|
||||
post = vps.post ;
|
||||
iobj = np ** { s = np.s ! Dat } } ;
|
||||
|
||||
--2 Other ways of forming verb phrases
|
||||
|
||||
-- Verb phrases can also be constructed reflexively and from
|
||||
-- copula-preceded complements.
|
||||
|
||||
-- : VPSlash -> VP ;
|
||||
ReflVP vps = complSlash vps buru_NP ; ------ TODO
|
||||
|
||||
-- : Comp -> VP ;
|
||||
UseComp comp = insertComp comp.s (copulaVP comp.copula) ;
|
||||
|
||||
|
||||
-- : V2 -> VP ; -- be loved
|
||||
PassV2 v2 =
|
||||
let kantatuak : Agr => Str = table {
|
||||
(Gu|Zuek|Hauek) => v2.prc ! Past ++ BIND ++ "ak" ;
|
||||
_ => v2.prc ! Past } ;
|
||||
in insertComp kantatuak (copulaVP Izan) ; --TODO: we lose the nstem, but maybe that's okay?
|
||||
|
||||
-- : VP -> Adv -> VP ; -- sleep here
|
||||
AdvVP vp adv = ResEus.insertAdv adv vp ;
|
||||
|
||||
-- : VP -> Adv -> VP ; -- sleep , even though ...
|
||||
ExtAdvVP vp adv = ResEus.insertAdv (postfixSS (SOFT_BIND ++ ",") adv) vp ;
|
||||
|
||||
-- : AdV -> VP -> VP ; -- always sleep
|
||||
AdVVP adv vp = ResEus.insertAdv adv vp ;
|
||||
|
||||
-- : VPSlash -> Adv -> VPSlash ; -- use (it) here
|
||||
AdvVPSlash vps adv = vps ** { adv = vps.adv ++ adv.s } ;
|
||||
|
||||
-- : AdV -> VPSlash -> VPSlash ; -- always use (it)
|
||||
AdVVPSlash adv vps = vps ** { adv = adv.s ++ vps.adv } ;
|
||||
|
||||
-- : VP -> Prep -> VPSlash ; -- live in (it)
|
||||
VPSlashPrep vp prep = vp **
|
||||
{ post = prep ;
|
||||
missing = MissingAdv } ;
|
||||
|
||||
|
||||
lin
|
||||
|
||||
--2 Complements to copula
|
||||
|
||||
-- Adjectival phrases, noun phrases, and adverbs can be used.
|
||||
|
||||
-- the house is big = etxea handia da
|
||||
-- the houses are big = etxeak handiak dira
|
||||
-- I am [a house that sleeps here] = ni [hemen lo egiten den etxea] naiz
|
||||
-- we are [houses that sleep here] = gu [hemen lo egiten diren etxeak] gara
|
||||
|
||||
-- Complement : Type = {s : Agr => Str ; copula : SyntVerb1 } ;
|
||||
|
||||
-- : AP -> Comp ;
|
||||
CompAP ap = { s = \\agr => ap.s ++ artDef ! getNum agr ! Abs ! ap.ph ;
|
||||
copula = Izan };
|
||||
|
||||
-- : CN -> Comp ;
|
||||
CompCN cn = { s = \\agr => cn.s ! agr ++ artDef ! getNum agr ! Abs ! cn.ph ;
|
||||
copula = Izan } ;
|
||||
|
||||
-- NP -> Comp ;
|
||||
CompNP np = { s = \\agr => np.s ! Abs ; copula = Izan } ;
|
||||
|
||||
-- : Adv -> Comp ;
|
||||
CompAdv adv = { s = \\agr => adv.s ; copula = Egon } ;
|
||||
|
||||
|
||||
-- : VP -- Copula alone; intransitive and Izan by default
|
||||
UseCopula = copulaVP Izan ;
|
||||
|
||||
|
||||
oper
|
||||
|
||||
copulaVP : SyntVerb1 -> VerbPhrase = \izan ->
|
||||
ResEus.useV { prc = \\tns => [] ;
|
||||
nstem = case izan of { Izan => "izate" ; _ => "egote" } ; --TODO is this correct?
|
||||
val = Da izan } ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user