From 76afac499b43bd61a07c53993b3cb1a77a2ea7d0 Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 15 Mar 2014 06:09:58 +0000 Subject: [PATCH] Jordi's addition to Combinators api: appCN and appCNc --- lib/src/api/Combinators.gf | 8 +++++++- lib/src/api/CombinatorsBul.gf | 13 +++++++++++-- lib/src/api/CombinatorsCat.gf | 15 ++++++++++++--- lib/src/api/CombinatorsEng.gf | 13 +++++++++++-- lib/src/api/CombinatorsFin.gf | 14 ++++++++++++-- lib/src/api/CombinatorsFre.gf | 13 +++++++++++-- lib/src/api/CombinatorsGer.gf | 13 +++++++++++-- lib/src/api/CombinatorsIta.gf | 13 +++++++++++-- lib/src/api/CombinatorsSpa.gf | 15 ++++++++++++--- lib/src/api/CombinatorsSwe.gf | 13 +++++++++++-- 10 files changed, 109 insertions(+), 21 deletions(-) diff --git a/lib/src/api/Combinators.gf b/lib/src/api/Combinators.gf index b87f7304f..d4a28c515 100644 --- a/lib/src/api/Combinators.gf +++ b/lib/src/api/Combinators.gf @@ -33,8 +33,9 @@ incomplete resource Combinators = open Cat, Structural, Constructors in { app : N -> NP ; -- the bottom app : N2 -> NP -> NP ; -- the successor of x app : N3 -> NP -> NP -> NP ; -- the distance from x to y + appCN : CN -> NP -> NP ; -- the absolute value of x + appCNc : CN -> [NP] -> NP ; -- the greatest common divisor of x , y and z app : N2 -> NP -> NP -> NP ; -- the sum of x and y - app : N2 -> N -> CN ; -- set of integers app : N2 -> NP -> CN ; -- divisor of x app : N3 -> NP -> NP -> CN ; -- path from x to y @@ -120,6 +121,11 @@ incomplete resource Combinators = open Cat, Structural, Constructors in { = \n,x -> mkNP the_Art (mkCN n x) ; --# notminimal app : N3 -> NP -> NP -> NP --# notminimal = \n,x,y -> mkNP the_Art (mkCN n x y) ; --# notminimal + appCN : CN -> NP -> NP --# notminimal ? + = \cn,x -> mkNP (mkNP the_Art cn) (mkAdv possess_Prep x) ; -- mkNP the_Art (PossNP cn x) ; + appCNc : CN -> [NP] -> NP --# notminimal ? + = \cn,xs -> let np : NP = mkNP and_Conj xs + in mkNP (mkNP the_Art cn) (mkAdv possess_Prep np) ; -- mkNP the_Art (PossNP cn np) ; app : N2 -> NP -> NP -> NP --# notminimal = \n,x,y -> mkNP the_Art (mkCN n (mkNP and_Conj x y)) ; --# notminimal app : N2 -> N -> CN --# notminimal diff --git a/lib/src/api/CombinatorsBul.gf b/lib/src/api/CombinatorsBul.gf index e6dda549f..80c2efbbe 100644 --- a/lib/src/api/CombinatorsBul.gf +++ b/lib/src/api/CombinatorsBul.gf @@ -1,6 +1,15 @@ --# -path=.:alltenses:prelude -resource CombinatorsBul = Combinators with +resource CombinatorsBul = Combinators - [appCN, appCNc] with (Cat = CatBul), (Structural = StructuralBul), - (Constructors = ConstructorsBul) ; + (Noun = NounBul), + (Constructors = ConstructorsBul) ** +{ +oper +appCN : CN -> NP -> NP + = \cn,x -> mkNP the_Art (PossNP cn x) ; +appCNc : CN -> [NP] -> NP + = \cn,xs -> let np : NP = mkNP and_Conj xs + in mkNP the_Art (PossNP cn np) ; +} diff --git a/lib/src/api/CombinatorsCat.gf b/lib/src/api/CombinatorsCat.gf index 473f5bd9b..a83f14a0c 100644 --- a/lib/src/api/CombinatorsCat.gf +++ b/lib/src/api/CombinatorsCat.gf @@ -1,6 +1,15 @@ ---# -path=.:alltenses +--# -path=.:alltenses:prelude -resource CombinatorsCat = Combinators with +resource CombinatorsCat = Combinators - [appCN, appCNc] with (Cat = CatCat), (Structural = StructuralCat), - (Constructors = ConstructorsCat) ; + (Noun = NounCat), + (Constructors = ConstructorsCat) ** +{ +oper +appCN : CN -> NP -> NP + = \cn,x -> mkNP the_Art (PossNP cn x) ; +appCNc : CN -> [NP] -> NP + = \cn,xs -> let np : NP = mkNP and_Conj xs + in mkNP the_Art (PossNP cn np) ; +} diff --git a/lib/src/api/CombinatorsEng.gf b/lib/src/api/CombinatorsEng.gf index a4acf8dd1..4106b22d1 100644 --- a/lib/src/api/CombinatorsEng.gf +++ b/lib/src/api/CombinatorsEng.gf @@ -1,6 +1,15 @@ --# -path=.:alltenses:prelude -resource CombinatorsEng = Combinators with +resource CombinatorsEng = Combinators - [ appCN, appCNc ] with (Cat = CatEng), (Structural = StructuralEng), - (Constructors = ConstructorsEng) ; + (Noun = NounEng), + (Constructors = ConstructorsEng) ** + { + oper + appCN : CN -> NP -> NP + = \cn,x -> mkNP the_Art (PossNP cn x) ; + appCNc : CN -> [NP] -> NP + = \cn,xs -> let np : NP = mkNP and_Conj xs + in mkNP the_Art (PossNP cn np) ; + } diff --git a/lib/src/api/CombinatorsFin.gf b/lib/src/api/CombinatorsFin.gf index 4c5ab7747..097de2851 100644 --- a/lib/src/api/CombinatorsFin.gf +++ b/lib/src/api/CombinatorsFin.gf @@ -1,6 +1,16 @@ --# -path=.:alltenses:prelude -resource CombinatorsFin = Combinators with +resource CombinatorsFin = Combinators - [appCN, appCNc] with (Cat = CatFin), (Structural = StructuralFin), - (Constructors = ConstructorsFin) ; + (Noun = NounFin), + (Constructors = ConstructorsFin) ** +{ +oper +appCN : CN -> NP -> NP + = \cn,x -> mkNP the_Art (PossNP cn x) ; +appCNc : CN -> [NP] -> NP + = \cn,xs -> let np : NP = mkNP and_Conj xs + in mkNP the_Art (PossNP cn np) ; +} + diff --git a/lib/src/api/CombinatorsFre.gf b/lib/src/api/CombinatorsFre.gf index d335875bd..d283924b7 100644 --- a/lib/src/api/CombinatorsFre.gf +++ b/lib/src/api/CombinatorsFre.gf @@ -1,6 +1,15 @@ --# -path=.:alltenses:prelude -resource CombinatorsFre = Combinators with +resource CombinatorsFre = Combinators - [appCN, appCNc] with (Cat = CatFre), (Structural = StructuralFre), - (Constructors = ConstructorsFre) ; + (Noun = NounFre), + (Constructors = ConstructorsFre) ** +{ +oper +appCN : CN -> NP -> NP + = \cn,x -> mkNP the_Art (PossNP cn x) ; +appCNc : CN -> [NP] -> NP + = \cn,xs -> let np : NP = mkNP and_Conj xs + in mkNP the_Art (PossNP cn np) ; +} diff --git a/lib/src/api/CombinatorsGer.gf b/lib/src/api/CombinatorsGer.gf index 82809cec3..2fbed5a41 100644 --- a/lib/src/api/CombinatorsGer.gf +++ b/lib/src/api/CombinatorsGer.gf @@ -1,6 +1,15 @@ --# -path=.:alltenses:prelude -resource CombinatorsGer = Combinators with +resource CombinatorsGer = Combinators - [appCN, appCNc] with (Cat = CatGer), (Structural = StructuralGer), - (Constructors = ConstructorsGer) ; + (Noun = NounGer), + (Constructors = ConstructorsGer) ** +{ +oper +appCN : CN -> NP -> NP + = \cn,x -> mkNP the_Art (PossNP cn x) ; +appCNc : CN -> [NP] -> NP + = \cn,xs -> let np : NP = mkNP and_Conj xs + in mkNP the_Art (PossNP cn np) ; +} diff --git a/lib/src/api/CombinatorsIta.gf b/lib/src/api/CombinatorsIta.gf index a16f634dc..86a41e87f 100644 --- a/lib/src/api/CombinatorsIta.gf +++ b/lib/src/api/CombinatorsIta.gf @@ -1,6 +1,15 @@ --# -path=.:alltenses:prelude -resource CombinatorsIta = Combinators with +resource CombinatorsIta = Combinators - [appCN, appCNc] with (Cat = CatIta), (Structural = StructuralIta), - (Constructors = ConstructorsIta) ; + (Noun = NounIta), + (Constructors = ConstructorsIta) ** +{ +oper +appCN : CN -> NP -> NP + = \cn,x -> mkNP the_Art (PossNP cn x) ; +appCNc : CN -> [NP] -> NP + = \cn,xs -> let np : NP = mkNP and_Conj xs + in mkNP the_Art (PossNP cn np) ; +} diff --git a/lib/src/api/CombinatorsSpa.gf b/lib/src/api/CombinatorsSpa.gf index 778c0fb3e..5c60270cf 100644 --- a/lib/src/api/CombinatorsSpa.gf +++ b/lib/src/api/CombinatorsSpa.gf @@ -1,6 +1,15 @@ ---# -path=.:alltenses +--# -path=.:alltenses:prelude -resource CombinatorsSpa = Combinators with +resource CombinatorsSpa = Combinators - [appCN, appCNc] with (Cat = CatSpa), (Structural = StructuralSpa), - (Constructors = ConstructorsSpa) ; + (Noun = NounSpa), + (Constructors = ConstructorsSpa) ** +{ +oper +appCN : CN -> NP -> NP + = \cn,x -> mkNP the_Art (PossNP cn x) ; +appCNc : CN -> [NP] -> NP + = \cn,xs -> let np : NP = mkNP and_Conj xs + in mkNP the_Art (PossNP cn np) ; +} diff --git a/lib/src/api/CombinatorsSwe.gf b/lib/src/api/CombinatorsSwe.gf index 5cdd1a2a6..f184c0803 100644 --- a/lib/src/api/CombinatorsSwe.gf +++ b/lib/src/api/CombinatorsSwe.gf @@ -1,6 +1,15 @@ --# -path=.:alltenses:prelude -resource CombinatorsSwe = Combinators with +resource CombinatorsSwe = Combinators - [appCN, appCNc] with (Cat = CatSwe), (Structural = StructuralSwe), - (Constructors = ConstructorsSwe) ; + (Noun = NounSwe), + (Constructors = ConstructorsSwe) ** +{ +oper +appCN : CN -> NP -> NP + = \cn,x -> mkNP the_Art (PossNP cn x) ; +appCNc : CN -> [NP] -> NP + = \cn,xs -> let np : NP = mkNP and_Conj xs + in mkNP the_Art (PossNP cn np) ; +}