moved lib/next-resource to next-lib/src, to enable linking with next-lib as value of GF_LIB_PATH

This commit is contained in:
aarne
2008-09-22 11:49:15 +00:00
parent 4862018f14
commit 98665df78b
441 changed files with 125291 additions and 5 deletions

View File

@@ -0,0 +1,193 @@
--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 Cat, Structural, Constructors 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 ;
app : N2 -> NP -> CN ; -- divisor of x
app : N3 -> NP -> NP -> CN ; -- path from x to y
app : N2 -> NP -> NP -> CN ; -- path between x and y
} ;
--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 -> mkCl np v ;
pred : V2 -> NP -> NP -> Cl
= \v,np,ob -> mkCl np v ob ;
pred : V3 -> NP -> NP -> NP -> Cl
= \v,np,ob,ob2 -> mkCl np v ob ob2 ;
pred : V -> NP -> NP -> Cl
= \v,x,y -> mkCl (mkNP and_Conj x y) v ;
pred : A -> NP -> Cl
= \a,np -> mkCl np a ;
pred : A2 -> NP -> NP -> Cl
= \a,x,y -> mkCl x a y ;
pred : A -> NP -> NP -> Cl
= \a,x,y -> mkCl (mkNP and_Conj x y) a ;
pred : N -> NP -> Cl
= \n,x -> mkCl x (mkNP a_Art n) ;
pred : CN -> NP -> Cl
= \n,x -> mkCl x (mkNP a_Art n) ;
pred : NP -> NP -> Cl
= \n,x -> mkCl x n ;
pred : N2 -> NP -> NP -> Cl
= \n,x,y -> mkCl x (mkNP a_Art (mkCN n y)) ;
pred : N -> NP -> NP -> Cl
= \n,x,y -> mkCl (mkNP and_Conj x y) (mkNP a_Art plNum n) ;
pred : Adv -> NP -> Cl
= \a,x -> mkCl x a ;
pred : Prep -> NP -> NP -> Cl
= \p,x,y -> mkCl x (mkAdv p y) ;
} ;
app = overload {
app : N -> NP
= \n -> mkNP the_Art n ;
app : N2 -> NP -> NP
= \n,x -> mkNP the_Art (mkCN n x) ;
app : N3 -> NP -> NP -> NP
= \n,x,y -> mkNP the_Art (mkCN n x y) ;
app : N2 -> NP -> NP -> NP
= \n,x,y -> mkNP the_Art (mkCN n (mkNP and_Conj x y)) ;
app : N2 -> N -> CN
= \f,n -> mkCN f (mkNP a_Art plNum n) ;
app : N2 -> NP -> CN
= mkCN ;
app : N3 -> NP -> NP -> CN
= mkCN ;
app : N2 -> NP -> NP -> CN
= \n,x,y -> mkCN n (mkNP and_Conj x y) ;
} ;
coord = overload {
coord : Conj -> Adv -> Adv -> Adv
= mkAdv ;
coord : Conj -> AP -> AP -> AP
= mkAP ;
coord : Conj -> NP -> NP -> NP
= mkNP ;
coord : Conj -> S -> S -> S
= mkS ;
coord : Conj -> ListAdv -> Adv
= mkAdv ;
coord : Conj -> ListAP -> AP
= mkAP ;
coord : Conj -> ListNP -> NP
= mkNP ;
coord : Conj -> ListS -> S
= mkS ;
} ;
mod = overload {
mod : A -> N -> CN
= mkCN ;
mod : AP -> CN -> CN
= mkCN ;
mod : AdA -> A -> AP
= mkAP ;
mod : Det -> N -> NP
= mkNP ;
mod : Det -> CN -> NP
= mkNP ;
mod : Quant -> N -> NP
= mkNP ;
mod : Quant -> CN -> NP
= mkNP ;
mod : Predet -> N -> NP
= \p,n -> mkNP p (mkNP a_Art n) ;
mod : Numeral -> N -> NP
= mkNP ;
} ;
neg = overload {
neg : Imp -> Utt
= mkUtt negativePol ;
neg : Cl -> S
= mkS negativePol ;
neg : QCl -> QS
= mkQS negativePol ;
neg : RCl -> RS
= mkRS negativePol ;
};
}

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsAra = Combinators with
(Cat = CatAra),
(Structural = StructuralAra),
(Constructors = ConstructorsAra) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsBul = Combinators with
(Cat = CatBul),
(Structural = StructuralBul),
(Constructors = ConstructorsBul) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsCat = Combinators with
(Cat = CatCat),
(Structural = StructuralCat),
(Constructors = ConstructorsCat) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsDan = Combinators with
(Cat = CatDan),
(Structural = StructuralDan),
(Constructors = ConstructorsDan) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsEng = Combinators with
(Cat = CatEng),
(Structural = StructuralEng),
(Constructors = ConstructorsEng) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsFin = Combinators with
(Cat = CatFin),
(Structural = StructuralFin),
(Constructors = ConstructorsFin) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsFre = Combinators with
(Cat = CatFre),
(Structural = StructuralFre),
(Constructors = ConstructorsFre) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsGer = Combinators with
(Cat = CatGer),
(Structural = StructuralGer),
(Constructors = ConstructorsGer) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsHin = Combinators with
(Cat = CatHin),
(Structural = StructuralHin),
(Constructors = ConstructorsHin) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsIna = Combinators with
(Cat = CatIna),
(Structural = StructuralIna),
(Constructors = ConstructorsIna) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsIta = Combinators with
(Cat = CatIta),
(Structural = StructuralIta),
(Constructors = ConstructorsIta) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsNor = Combinators with
(Cat = CatNor),
(Structural = StructuralNor),
(Constructors = ConstructorsNor) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsRus = Combinators with
(Cat = CatRus),
(Structural = StructuralRus),
(Constructors = ConstructorsRus) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsSpa = Combinators with
(Cat = CatSpa),
(Structural = StructuralSpa),
(Constructors = ConstructorsSpa) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsSwe = Combinators with
(Cat = CatSwe),
(Structural = StructuralSwe),
(Constructors = ConstructorsSwe) ;

View File

@@ -0,0 +1,6 @@
--# -path=.:alltenses:prelude
resource CombinatorsTha = Combinators with
(Cat = CatTha),
(Structural = StructuralTha),
(Constructors = ConstructorsTha) ;

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,62 @@
--1 Symbolic: Noun Phrases with mathematical symbols
incomplete resource Symbolic = open
Symbol, Syntax, PredefCnc in {
oper
symb : overload {
symb : Str -> NP ; -- x
symb : Int -> NP ; -- 23
symb : Float -> NP ; -- 0.99
symb : N -> Digits -> NP ; -- level 4
symb : N -> Card -> NP ; -- level four
symb : CN -> Card -> NP ; -- advanced level four
symb : Det -> N -> Card -> NP ; -- the number four
symb : Det -> CN -> Card -> NP ; -- the even number four
symb : Det -> N -> Str -> Str -> NP ; -- the levels i and j
symb : Det -> CN -> [Symb] -> NP ; -- the basic levels i, j, and k
symb : Symb -> S ; -- A
symb : Symb -> Card ; -- n
symb : Symb -> Ord -- n'th
} ;
mkSymb : Str -> Symb ;
mkInt : Str -> PredefCnc.Int ;
mkFloat : Str -> PredefCnc.Float ;
--.
symb = overload {
symb : Str -> NP
= \s -> mkNP (SymbPN (mkSymb s)) ;
symb : Int -> NP
= \i -> mkNP (IntPN i) ;
symb : Float -> NP
= \i -> mkNP (FloatPN i) ;
symb : N -> Digits -> NP
= \c,i -> CNNumNP (mkCN c) (mkCard i) ;
symb : N -> Card -> NP
= \c,n -> CNNumNP (mkCN c) n ;
symb : CN -> Card -> NP
= \c,n -> CNNumNP c n ;
symb : Det -> N -> Card -> NP
= \d,n,x -> mkNP d (mkCN (mkCN n) (mkNP (NumPN x))) ;
symb : Det -> CN -> Card -> NP
= \d,n,x -> mkNP d (mkCN n (mkNP (NumPN x))) ;
symb : Det -> N -> Str -> Str -> NP
= \c,n,x,y -> CNSymbNP c (mkCN n) (BaseSymb (mkSymb x) (mkSymb y)) ;
symb : Det -> CN -> [Symb] -> NP
= CNSymbNP ;
symb : Symb -> S = SymbS ;
symb : Symb -> Card = SymbNum ;
symb : Symb -> Ord = SymbOrd
} ;
mkSymb : Str -> Symb = \s -> {s = s ; lock_Symb = <>} ;
mkInt i = {s = i ; lock_Int = <>} ;
mkFloat f = {s = f ; lock_Float = <>} ;
}

View File

@@ -0,0 +1,5 @@
--# -path=.:present:prelude
resource SymbolicEng = Symbolic with
(Symbol = SymbolEng),
(Syntax = SyntaxEng) ;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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 ;
} ;
}