carried over Art and Temp changes to next-resource/api/Constructors

This commit is contained in:
aarne
2008-09-05 13:51:59 +00:00
parent 7d82132b9e
commit 7ab51924dc
40 changed files with 2042 additions and 0 deletions

View File

@@ -0,0 +1,190 @@
--1 Combinators: a High-Level Syntax API
-- This module defines some "grammatical functions" that give shortcuts to
-- typical constructions. [``Constructors`` Constructors.html] and the
-- language-specific ``Paradigms`` modules are usually needed
-- to construct arguments of these functions.
incomplete resource Combinators = open Grammar in {
oper
--2 Predication
pred : overload {
pred : V -> NP -> Cl ; -- x converges
pred : V2 -> NP -> NP -> Cl ; -- x intersects y
pred : V3 -> NP -> NP -> NP -> Cl ; -- x intersects y at z
pred : V -> NP -> NP -> Cl ; -- x and y intersect
pred : A -> NP -> Cl ; -- x is even
pred : A2 -> NP -> NP -> Cl ; -- x is divisible by y
pred : A -> NP -> NP -> Cl ; -- x and y are equal
pred : N -> NP -> Cl ; -- x is a maximum
pred : CN -> NP -> Cl ; -- x is a local maximum
pred : NP -> NP -> Cl ; -- x is the neutral element
pred : N -> NP -> NP -> Cl ; -- x and y are inverses
pred : Adv -> NP -> Cl ; -- x is in scope
pred : Prep -> NP -> NP -> Cl -- x is outside y
} ;
--2 Function application
app : overload {
app : N -> NP ;
app : N2 -> NP -> NP ;
app : N3 -> NP -> NP -> NP ;
app : N2 -> NP -> NP -> NP ;
app : N2 -> N -> CN
} ;
--2 Coordination
coord : overload {
coord : Conj -> Adv -> Adv -> Adv ;
coord : Conj -> AP -> AP -> AP ;
coord : Conj -> NP -> NP -> NP ;
coord : Conj -> S -> S -> S ;
coord : Conj -> ListAdv -> Adv ;
coord : Conj -> ListAP -> AP ;
coord : Conj -> ListNP -> NP ;
coord : Conj -> ListS -> S ;
} ;
--2 Modification
mod : overload {
mod : A -> N -> CN ;
mod : AP -> CN -> CN ;
mod : AdA -> A -> AP ;
mod : Det -> N -> NP ;
mod : Det -> CN -> NP ;
mod : Quant -> N -> NP ;
mod : Quant -> CN -> NP ;
mod : Predet -> N -> NP ;
mod : Numeral -> N -> NP
} ;
--2 Negation
neg : overload {
neg : Imp -> Utt ;
neg : Cl -> S ;
neg : QCl -> QS ;
neg : RCl -> RS
};
--2 Text append
-- This is not in ground API, because it would destroy parsing.
appendText : Text -> Text -> Text ;
--.
pred = overload {
pred : V -> NP -> Cl
= \v,np -> PredVP np (UseV v) ;
pred : V2 -> NP -> NP -> Cl
= \v,np,ob -> PredVP np (ComplSlash (SlashV2a v) ob) ;
pred : V3 -> NP -> NP -> NP -> Cl
= \v,np,ob,ob2 ->
PredVP np (ComplSlash (Slash2V3 v ob) ob2) ;
pred : V -> NP -> NP -> Cl
= \v,x,y -> PredVP (ConjNP and_Conj (BaseNP x y)) (UseV v) ;
pred : A -> NP -> Cl
= \a,np -> PredVP np (UseComp (CompAP (PositA a))) ;
pred : A2 -> NP -> NP -> Cl
= \a,x,y -> PredVP x (UseComp (CompAP (ComplA2 a y))) ;
pred : A -> NP -> NP -> Cl
= \a,x,y -> PredVP (ConjNP and_Conj (BaseNP x y)) (UseComp (CompAP (PositA a))) ;
pred : N -> NP -> Cl
= \n,x -> PredVP x (UseComp (CompNP (DetArtSg (IndefArt) (UseN n)))) ;
pred : CN -> NP -> Cl
= \n,x -> PredVP x (UseComp (CompNP (DetArtSg (IndefArt) n))) ;
pred : NP -> NP -> Cl
= \n,x -> PredVP x (UseComp (CompNP n)) ; pred : N2 -> NP -> NP -> Cl
= \n,x,y -> PredVP x (UseComp (CompNP (DetArtSg (IndefArt) (ComplN2 n y)))) ;
pred : N -> NP -> NP -> Cl
= \n,x,y -> PredVP (ConjNP and_Conj (BaseNP x y)) (UseComp (CompNP (DetArtPl (IndefArt) (UseN n)))) ;
pred : Adv -> NP -> Cl
= \a,x -> PredVP x (UseComp (CompAdv a)) ;
pred : Prep -> NP -> NP -> Cl
= \p,x,y -> PredVP x (UseComp (CompAdv (PrepNP p y)))
} ;
app = overload {
app : N -> NP
= \n -> (DetArtSg (DefArt) (UseN n)) ;
app : N2 -> NP -> NP
= \n,x -> (DetArtSg (DefArt) (ComplN2 n x)) ;
app : N3 -> NP -> NP -> NP
= \n,x,y -> (DetArtSg (DefArt) (ComplN2 (ComplN3 n x) y)) ;
app : N2 -> NP -> NP -> NP
= \n,x,y -> (DetArtSg DefArt (ComplN2 n (ConjNP and_Conj (BaseNP x y)))) ;
app : N2 -> N -> CN
= \f,n -> ComplN2 f (DetArtPl (IndefArt) (UseN n))
} ;
coord = overload {
coord : Conj -> Adv -> Adv -> Adv
= \c,x,y -> ConjAdv c (BaseAdv x y) ;
coord : Conj -> AP -> AP -> AP
= \c,x,y -> ConjAP c (BaseAP x y) ;
coord : Conj -> NP -> NP -> NP
= \c,x,y -> ConjNP c (BaseNP x y) ;
coord : Conj -> S -> S -> S
= \c,x,y -> ConjS c (BaseS x y) ;
coord : Conj -> ListAdv -> Adv
= \c,xy -> ConjAdv c xy ;
coord : Conj -> ListAP -> AP
= \c,xy -> ConjAP c xy ;
coord : Conj -> ListNP -> NP
= \c,xy -> ConjNP c xy ;
coord : Conj -> ListS -> S
= \c,xy -> ConjS c xy
} ;
mod = overload {
mod : A -> N -> CN
= \a,n -> AdjCN (PositA a) (UseN n) ;
mod : AP -> CN -> CN
= \a,n -> AdjCN a n ;
mod : AdA -> A -> AP
= \m,a -> AdAP m (PositA a) ;
mod : Det -> N -> NP
= \d,n -> DetCN d (UseN n) ;
mod : Det -> CN -> NP
= \d,n -> DetCN d n ;
mod : Quant -> N -> NP
= \q,n -> DetCN (DetQuant (q) NumSg) (UseN n) ;
mod : Quant -> CN -> NP
= \q,n -> DetCN (DetQuant (q) NumSg) n ;
mod : Predet -> N -> NP
= \q,n -> PredetNP q (DetArtPl (IndefArt) (UseN n)) ;
mod : Numeral -> N -> NP
= \nu,n -> DetCN (DetArtCard (IndefArt) (NumNumeral nu)) (UseN n)
} ;
neg = overload {
neg : Imp -> Utt
= UttImpSg PNeg ;
neg : Cl -> S
= UseCl TPres ASimul PNeg;
neg : QCl -> QS
= UseQCl TPres ASimul PNeg;
neg : RCl -> RS
= UseRCl TPres ASimul PNeg
};
-- This is not in ground API, because it would destroy parsing.
appendText : Text -> Text -> Text
= \x,y -> {s = x.s ++ y.s ; lock_Text = <>} ;
}

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource CombinatorsEng = Combinators with (Grammar = GrammarEng) ;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsBul = Constructors with (Grammar = GrammarBul) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsCat = Constructors with (Grammar = GrammarCat) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsDan = Constructors with (Grammar = GrammarDan) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsEng = Constructors with (Grammar = GrammarEng) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsFin = Constructors with (Grammar = GrammarFin) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsFre = Constructors with (Grammar = GrammarFre) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsGer = Constructors with (Grammar = GrammarGer) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsIta = Constructors with (Grammar = GrammarIta) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsNor = Constructors with (Grammar = GrammarNor) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsRus = Constructors with (Grammar = GrammarRus) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsSpa = Constructors with (Grammar = GrammarSpa) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsSwe = Constructors with (Grammar = GrammarSwe) ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
interface Syntax = Constructors, Cat, Structural, Numeral ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxBul of Syntax = ConstructorsBul, CatBul, StructuralBul, NumeralBul ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxCat of Syntax = ConstructorsCat, CatCat, StructuralCat, NumeralCat ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxDan of Syntax = ConstructorsDan, CatDan, StructuralDan, NumeralDan ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxEng of Syntax = ConstructorsEng, CatEng, StructuralEng, NumeralEng ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxFin of Syntax = ConstructorsFin, CatFin, StructuralFin, NumeralFin ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxFre of Syntax = ConstructorsFre, CatFre, StructuralFre, NumeralFre ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxGer of Syntax = ConstructorsGer, CatGer, StructuralGer, NumeralGer ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxIta of Syntax = ConstructorsIta, CatIta, StructuralIta, NumeralIta ;

View File

@@ -0,0 +1,5 @@
--# -path=.:alltenses:prelude
instance SyntaxNor of Syntax = ConstructorsNor, CatNor, StructuralNor, NumeralNor
;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxRus of Syntax = ConstructorsRus, CatRus, StructuralRus, NumeralRus ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxSpa of Syntax = ConstructorsSpa, CatSpa, StructuralSpa, NumeralSpa ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxSwe of Syntax = ConstructorsSwe, CatSwe, StructuralSwe, NumeralSwe ;

View File

@@ -0,0 +1,13 @@
--# -path=.:alltenses:prelude
resource TryBul = SyntaxBul, LexiconBul, ParadigmsBul - [mkAdv] **
open (P = ParadigmsBul), in {
oper
mkAdv = overload SyntaxBul {
mkAdv : Str -> Adv = P.mkAdv ;
} ;
}

View File

@@ -0,0 +1,13 @@
--# -path=.:alltenses:prelude
resource TryCat = SyntaxCat, LexiconCat, ParadigmsCat - [mkAdv] **
open (P = ParadigmsCat), in {
oper
mkAdv = overload SyntaxCat {
mkAdv : Str -> Adv = P.mkAdv ;
} ;
}

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryDan = SyntaxDan, LexiconDan, ParadigmsDan - [mkAdv] ;

View File

@@ -0,0 +1,13 @@
--# -path=.:alltenses:prelude
resource TryEng = SyntaxEng, LexiconEng, ParadigmsEng - [mkAdv] **
open (P = ParadigmsEng), in {
oper
mkAdv = overload SyntaxEng {
mkAdv : Str -> Adv = P.mkAdv ;
} ;
}

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryFin = SyntaxFin, LexiconFin-[mkOrd], ParadigmsFin - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryFre = SyntaxFre, LexiconFre, ParadigmsFre - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryGer = SyntaxGer, LexiconGer, ParadigmsGer - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryIta = SyntaxIta, LexiconIta, ParadigmsIta - [mkAdv,in_Prep] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryNor = SyntaxNor, LexiconNor, ParadigmsNor - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryRus = SyntaxRus, LexiconRus, ParadigmsRus - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TrySpa = SyntaxSpa, LexiconSpa, ParadigmsSpa - [mkAdv] ;

View File

@@ -0,0 +1,12 @@
--# -path=.:alltenses:prelude
resource TrySwe = SyntaxSwe, LexiconSwe, ParadigmsSwe - [mkAdv] **
open (P = ParadigmsSwe), in {
oper
mkAdv = overload SyntaxSwe {
mkAdv : Str -> Adv = P.mkAdv ;
} ;
}