mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
reimplemented Combinators with Constructors in next-resource
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
-- language-specific ``Paradigms`` modules are usually needed
|
-- language-specific ``Paradigms`` modules are usually needed
|
||||||
-- to construct arguments of these functions.
|
-- to construct arguments of these functions.
|
||||||
|
|
||||||
incomplete resource Combinators = open Grammar in {
|
incomplete resource Combinators = open Cat, Structural, Constructors in {
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
@@ -90,110 +90,104 @@ incomplete resource Combinators = open Grammar in {
|
|||||||
|
|
||||||
pred = overload {
|
pred = overload {
|
||||||
pred : V -> NP -> Cl
|
pred : V -> NP -> Cl
|
||||||
= \v,np -> PredVP np (UseV v) ;
|
= \v,np -> mkCl np v ;
|
||||||
pred : V2 -> NP -> NP -> Cl
|
pred : V2 -> NP -> NP -> Cl
|
||||||
= \v,np,ob -> PredVP np (ComplSlash (SlashV2a v) ob) ;
|
= \v,np,ob -> mkCl np v ob ;
|
||||||
pred : V3 -> NP -> NP -> NP -> Cl
|
pred : V3 -> NP -> NP -> NP -> Cl
|
||||||
= \v,np,ob,ob2 ->
|
= \v,np,ob,ob2 -> mkCl np v ob ob2 ;
|
||||||
PredVP np (ComplSlash (Slash2V3 v ob) ob2) ;
|
|
||||||
pred : V -> NP -> NP -> Cl
|
pred : V -> NP -> NP -> Cl
|
||||||
= \v,x,y -> PredVP (ConjNP and_Conj (BaseNP x y)) (UseV v) ;
|
= \v,x,y -> mkCl (mkNP and_Conj x y) v ;
|
||||||
pred : A -> NP -> Cl
|
pred : A -> NP -> Cl
|
||||||
= \a,np -> PredVP np (UseComp (CompAP (PositA a))) ;
|
= \a,np -> mkCl np a ;
|
||||||
pred : A2 -> NP -> NP -> Cl
|
pred : A2 -> NP -> NP -> Cl
|
||||||
= \a,x,y -> PredVP x (UseComp (CompAP (ComplA2 a y))) ;
|
= \a,x,y -> mkCl x a y ;
|
||||||
pred : A -> NP -> NP -> Cl
|
pred : A -> NP -> NP -> Cl
|
||||||
= \a,x,y -> PredVP (ConjNP and_Conj (BaseNP x y)) (UseComp (CompAP (PositA a))) ;
|
= \a,x,y -> mkCl (mkNP and_Conj x y) a ;
|
||||||
pred : N -> NP -> Cl
|
pred : N -> NP -> Cl
|
||||||
= \n,x -> PredVP x (UseComp (CompNP (DetArtSg (IndefArt) (UseN n)))) ;
|
= \n,x -> mkCl x (mkNP a_Art n) ;
|
||||||
pred : CN -> NP -> Cl
|
pred : CN -> NP -> Cl
|
||||||
= \n,x -> PredVP x (UseComp (CompNP (DetArtSg (IndefArt) n))) ;
|
= \n,x -> mkCl x (mkNP a_Art n) ;
|
||||||
pred : NP -> NP -> Cl
|
pred : NP -> NP -> Cl
|
||||||
= \n,x -> PredVP x (UseComp (CompNP n)) ; pred : N2 -> NP -> NP -> Cl
|
= \n,x -> mkCl x n ;
|
||||||
= \n,x,y -> PredVP x (UseComp (CompNP (DetArtSg (IndefArt) (ComplN2 n y)))) ;
|
pred : N2 -> NP -> NP -> Cl
|
||||||
|
= \n,x,y -> mkCl x (mkNP a_Art (mkCN n y)) ;
|
||||||
pred : N -> NP -> NP -> Cl
|
pred : N -> NP -> NP -> Cl
|
||||||
= \n,x,y -> PredVP (ConjNP and_Conj (BaseNP x y)) (UseComp (CompNP (DetArtPl (IndefArt) (UseN n)))) ;
|
= \n,x,y -> mkCl (mkNP and_Conj x y) (mkNP a_Art plNum n) ;
|
||||||
pred : Adv -> NP -> Cl
|
pred : Adv -> NP -> Cl
|
||||||
= \a,x -> PredVP x (UseComp (CompAdv a)) ;
|
= \a,x -> mkCl x a ;
|
||||||
pred : Prep -> NP -> NP -> Cl
|
pred : Prep -> NP -> NP -> Cl
|
||||||
= \p,x,y -> PredVP x (UseComp (CompAdv (PrepNP p y)))
|
= \p,x,y -> mkCl x (mkAdv p y) ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
app = overload {
|
app = overload {
|
||||||
app : N -> NP
|
app : N -> NP
|
||||||
= \n -> (DetArtSg (DefArt) (UseN n)) ;
|
= \n -> mkNP the_Art n ;
|
||||||
app : N2 -> NP -> NP
|
app : N2 -> NP -> NP
|
||||||
= \n,x -> (DetArtSg (DefArt) (ComplN2 n x)) ;
|
= \n,x -> mkNP the_Art (mkCN n x) ;
|
||||||
app : N3 -> NP -> NP -> NP
|
app : N3 -> NP -> NP -> NP
|
||||||
= \n,x,y -> (DetArtSg (DefArt) (ComplN2 (ComplN3 n x) y)) ;
|
= \n,x,y -> mkNP the_Art (mkCN n x y) ;
|
||||||
app : N2 -> NP -> NP -> NP
|
app : N2 -> NP -> NP -> NP
|
||||||
= \n,x,y -> (DetArtSg DefArt (ComplN2 n (ConjNP and_Conj (BaseNP x y)))) ;
|
= \n,x,y -> mkNP the_Art (mkCN n (mkNP and_Conj x y)) ;
|
||||||
app : N2 -> N -> CN
|
app : N2 -> N -> CN
|
||||||
= \f,n -> ComplN2 f (DetArtPl (IndefArt) (UseN n)) ;
|
= \f,n -> mkCN f (mkNP a_Art plNum n) ;
|
||||||
|
app : N2 -> NP -> CN
|
||||||
app : N2 -> NP -> CN = ComplN2 ;
|
= mkCN ;
|
||||||
app : N3 -> NP -> NP -> CN = \n,x,y -> ComplN2 (ComplN3 n x) y ;
|
app : N3 -> NP -> NP -> CN
|
||||||
app : N2 -> NP -> NP -> CN = \n,x,y ->
|
= mkCN ;
|
||||||
ComplN2 n (ConjNP and_Conj (BaseNP x y)) ;
|
app : N2 -> NP -> NP -> CN
|
||||||
|
= \n,x,y -> mkCN n (mkNP and_Conj x y) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
coord = overload {
|
coord = overload {
|
||||||
coord : Conj -> Adv -> Adv -> Adv
|
coord : Conj -> Adv -> Adv -> Adv
|
||||||
= \c,x,y -> ConjAdv c (BaseAdv x y) ;
|
= mkAdv ;
|
||||||
coord : Conj -> AP -> AP -> AP
|
coord : Conj -> AP -> AP -> AP
|
||||||
= \c,x,y -> ConjAP c (BaseAP x y) ;
|
= mkAP ;
|
||||||
coord : Conj -> NP -> NP -> NP
|
coord : Conj -> NP -> NP -> NP
|
||||||
= \c,x,y -> ConjNP c (BaseNP x y) ;
|
= mkNP ;
|
||||||
coord : Conj -> S -> S -> S
|
coord : Conj -> S -> S -> S
|
||||||
= \c,x,y -> ConjS c (BaseS x y) ;
|
= mkS ;
|
||||||
coord : Conj -> ListAdv -> Adv
|
coord : Conj -> ListAdv -> Adv
|
||||||
= \c,xy -> ConjAdv c xy ;
|
= mkAdv ;
|
||||||
coord : Conj -> ListAP -> AP
|
coord : Conj -> ListAP -> AP
|
||||||
= \c,xy -> ConjAP c xy ;
|
= mkAP ;
|
||||||
coord : Conj -> ListNP -> NP
|
coord : Conj -> ListNP -> NP
|
||||||
= \c,xy -> ConjNP c xy ;
|
= mkNP ;
|
||||||
coord : Conj -> ListS -> S
|
coord : Conj -> ListS -> S
|
||||||
= \c,xy -> ConjS c xy
|
= mkS ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mod = overload {
|
mod = overload {
|
||||||
mod : A -> N -> CN
|
mod : A -> N -> CN
|
||||||
= \a,n -> AdjCN (PositA a) (UseN n) ;
|
= mkCN ;
|
||||||
mod : AP -> CN -> CN
|
mod : AP -> CN -> CN
|
||||||
= \a,n -> AdjCN a n ;
|
= mkCN ;
|
||||||
mod : AdA -> A -> AP
|
mod : AdA -> A -> AP
|
||||||
= \m,a -> AdAP m (PositA a) ;
|
= mkAP ;
|
||||||
|
|
||||||
mod : Det -> N -> NP
|
mod : Det -> N -> NP
|
||||||
= \d,n -> DetCN d (UseN n) ;
|
= mkNP ;
|
||||||
mod : Det -> CN -> NP
|
mod : Det -> CN -> NP
|
||||||
= \d,n -> DetCN d n ;
|
= mkNP ;
|
||||||
mod : Quant -> N -> NP
|
mod : Quant -> N -> NP
|
||||||
= \q,n -> DetCN (DetQuant (q) NumSg) (UseN n) ;
|
= mkNP ;
|
||||||
mod : Quant -> CN -> NP
|
mod : Quant -> CN -> NP
|
||||||
= \q,n -> DetCN (DetQuant (q) NumSg) n ;
|
= mkNP ;
|
||||||
mod : Predet -> N -> NP
|
mod : Predet -> N -> NP
|
||||||
= \q,n -> PredetNP q (DetArtPl (IndefArt) (UseN n)) ;
|
= \p,n -> mkNP p (mkNP a_Art n) ;
|
||||||
mod : Numeral -> N -> NP
|
mod : Numeral -> N -> NP
|
||||||
= \nu,n -> DetCN (DetArtCard (IndefArt) (NumNumeral nu)) (UseN n)
|
= mkNP ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
neg = overload {
|
neg = overload {
|
||||||
neg : Imp -> Utt
|
neg : Imp -> Utt
|
||||||
= UttImpSg PNeg ;
|
= mkUtt negativePol ;
|
||||||
neg : Cl -> S
|
neg : Cl -> S
|
||||||
= UseCl TPres ASimul PNeg;
|
= mkS negativePol ;
|
||||||
neg : QCl -> QS
|
neg : QCl -> QS
|
||||||
= UseQCl TPres ASimul PNeg;
|
= mkQS negativePol ;
|
||||||
neg : RCl -> RS
|
neg : RCl -> RS
|
||||||
= UseRCl TPres ASimul PNeg
|
= mkRS negativePol ;
|
||||||
};
|
};
|
||||||
|
|
||||||
-- This is not in ground API, because it would destroy parsing.
|
|
||||||
|
|
||||||
appendText : Text -> Text -> Text
|
|
||||||
= \x,y -> {s = x.s ++ y.s ; lock_Text = <>} ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsAra = Combinators with (Grammar = GrammarAra) ;
|
resource CombinatorsAra = Combinators with
|
||||||
|
(Cat = CatAra),
|
||||||
|
(Structural = StructuralAra),
|
||||||
|
(Constructors = ConstructorsAra) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsBul = Combinators with (Grammar = GrammarBul) ;
|
resource CombinatorsBul = Combinators with
|
||||||
|
(Cat = CatBul),
|
||||||
|
(Structural = StructuralBul),
|
||||||
|
(Constructors = ConstructorsBul) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsCat = Combinators with (Grammar = GrammarCat) ;
|
resource CombinatorsCat = Combinators with
|
||||||
|
(Cat = CatCat),
|
||||||
|
(Structural = StructuralCat),
|
||||||
|
(Constructors = ConstructorsCat) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsDan = Combinators with (Grammar = GrammarDan) ;
|
resource CombinatorsDan = Combinators with
|
||||||
|
(Cat = CatDan),
|
||||||
|
(Structural = StructuralDan),
|
||||||
|
(Constructors = ConstructorsDan) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsEng = Combinators with (Grammar = GrammarEng) ;
|
resource CombinatorsEng = Combinators with
|
||||||
|
(Cat = CatEng),
|
||||||
|
(Structural = StructuralEng),
|
||||||
|
(Constructors = ConstructorsEng) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsFin = Combinators with (Grammar = GrammarFin) ;
|
resource CombinatorsFin = Combinators with
|
||||||
|
(Cat = CatFin),
|
||||||
|
(Structural = StructuralFin),
|
||||||
|
(Constructors = ConstructorsFin) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsFre = Combinators with (Grammar = GrammarFre) ;
|
resource CombinatorsFre = Combinators with
|
||||||
|
(Cat = CatFre),
|
||||||
|
(Structural = StructuralFre),
|
||||||
|
(Constructors = ConstructorsFre) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsGer = Combinators with (Grammar = GrammarGer) ;
|
resource CombinatorsGer = Combinators with
|
||||||
|
(Cat = CatGer),
|
||||||
|
(Structural = StructuralGer),
|
||||||
|
(Constructors = ConstructorsGer) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsHin = Combinators with (Grammar = GrammarHin) ;
|
resource CombinatorsHin = Combinators with
|
||||||
|
(Cat = CatHin),
|
||||||
|
(Structural = StructuralHin),
|
||||||
|
(Constructors = ConstructorsHin) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsIna = Combinators with (Grammar = GrammarIna) ;
|
resource CombinatorsIna = Combinators with
|
||||||
|
(Cat = CatIna),
|
||||||
|
(Structural = StructuralIna),
|
||||||
|
(Constructors = ConstructorsIna) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsIta = Combinators with (Grammar = GrammarIta) ;
|
resource CombinatorsIta = Combinators with
|
||||||
|
(Cat = CatIta),
|
||||||
|
(Structural = StructuralIta),
|
||||||
|
(Constructors = ConstructorsIta) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsNor = Combinators with (Grammar = GrammarNor) ;
|
resource CombinatorsNor = Combinators with
|
||||||
|
(Cat = CatNor),
|
||||||
|
(Structural = StructuralNor),
|
||||||
|
(Constructors = ConstructorsNor) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsRus = Combinators with (Grammar = GrammarRus) ;
|
resource CombinatorsRus = Combinators with
|
||||||
|
(Cat = CatRus),
|
||||||
|
(Structural = StructuralRus),
|
||||||
|
(Constructors = ConstructorsRus) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsSpa = Combinators with (Grammar = GrammarSpa) ;
|
resource CombinatorsSpa = Combinators with
|
||||||
|
(Cat = CatSpa),
|
||||||
|
(Structural = StructuralSpa),
|
||||||
|
(Constructors = ConstructorsSpa) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsSwe = Combinators with (Grammar = GrammarSwe) ;
|
resource CombinatorsSwe = Combinators with
|
||||||
|
(Cat = CatSwe),
|
||||||
|
(Structural = StructuralSwe),
|
||||||
|
(Constructors = ConstructorsSwe) ;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
resource CombinatorsTha = Combinators with (Grammar = GrammarTha) ;
|
resource CombinatorsTha = Combinators with
|
||||||
|
(Cat = CatTha),
|
||||||
|
(Structural = StructuralTha),
|
||||||
|
(Constructors = ConstructorsTha) ;
|
||||||
|
|||||||
@@ -1666,6 +1666,13 @@ incomplete resource Constructors = open Grammar in {
|
|||||||
those_QuantPl : QuantPl ; -- 5. those
|
those_QuantPl : QuantPl ; -- 5. those
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
-- export needed, since not in Cat
|
||||||
|
|
||||||
|
ListAdv : Type = Grammar.ListAdv ;
|
||||||
|
ListAP : Type = Grammar.ListAP ;
|
||||||
|
ListNP : Type = Grammar.ListNP ;
|
||||||
|
ListS : Type = Grammar.ListS ;
|
||||||
|
|
||||||
-- bw to 1.4
|
-- bw to 1.4
|
||||||
|
|
||||||
Art : Type = Quant ;
|
Art : Type = Quant ;
|
||||||
|
|||||||
Reference in New Issue
Block a user