1
0
forked from GitHub/gf-core

next-lib now compiles webalt ; removed subdir mathematical/ for simplicity

This commit is contained in:
aarne
2008-10-06 15:27:14 +00:00
parent e56e6483f6
commit 43dcd61cbf
29 changed files with 157 additions and 15 deletions

View File

@@ -22,6 +22,7 @@ import System.Exit
default_gfc = "../../bin/gfc"
presApiPath = "-path=api:present"
presSymbolPath = "-path=.:abstract:present:common:romance:scandinavian" ----
-- the languages have long directory names and short ISO codes (3 letters)
-- we also give the decodings for postprocessing linearizations, as long as grammars
@@ -84,7 +85,11 @@ make xx = do
ifx "lang" $ do
mapM_ (gfc pres [] . lang) (optl langsLang)
mapM_ (gfc pres presSymbolPath . symbol) (optl langsAPI)
copy "*/*.gfo" dir
ifx "compat" $ do
mapM_ (gfc pres [] . compat) (optl langsCompat)
copy "*/Compatibility*.gfo" dir
ifx "api" $ do
mapM_ (gfc pres presApiPath . try) (optl langsAPI)
mapM_ (gfc pres presApiPath . symbolic) (optl langsAPI)
@@ -128,6 +133,8 @@ demos abstr ls = "gr -number=100 | l -treebank " ++ unlexer abstr ls ++
" | ps -to_html | wf -file=resdemo.html"
lang (lla,la) = lla ++ "/All" ++ la ++ ".gf"
compat (lla,la) = lla ++ "/Compatibility" ++ la ++ ".gf"
symbol (lla,la) = lla ++ "/Symbol" ++ la ++ ".gf"
try (lla,la) = "api/Try" ++ la ++ ".gf"
symbolic (lla,la) = "api/Symbolic" ++ la ++ ".gf"

View File

@@ -0,0 +1,9 @@
abstract Compatibility = Cat ** {
-- from Noun 19/4/2008
fun
NumInt : Int -> Num ; -- 57
OrdInt : Int -> Ord ; -- 57
}

View File

@@ -1,4 +1,4 @@
--# -path=.:alltenses:prelude
--# -path=.:alltenses
resource CombinatorsCat = Combinators with
(Cat = CatCat),

View File

@@ -1,4 +1,4 @@
--# -path=.:alltenses:prelude
--# -path=.:alltenses
resource CombinatorsSpa = Combinators with
(Cat = CatSpa),

View File

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

View File

@@ -1,11 +1,11 @@
--1 Symbolic: Noun Phrases with mathematical symbols
incomplete resource Symbolic = open Symbol, Grammar in {
incomplete resource Symbolic = open Symbol, Grammar, PredefCnc in {
oper
symb : overload {
symb : Str -> NP ; -- x
symb : Integer -> NP ; -- 23
symb : Int -> NP ; -- 23
symb : Float -> NP ; -- 0.99
symb : N -> Digits -> NP ; -- level 4
symb : N -> Card -> NP ; -- level four
@@ -13,7 +13,10 @@ incomplete resource Symbolic = open Symbol, Grammar in {
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 : 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 ;
@@ -25,9 +28,9 @@ incomplete resource Symbolic = open Symbol, Grammar in {
symb = overload {
symb : Str -> NP
= \s -> UsePN (SymbPN (mkSymb s)) ;
symb : Integer -> NP
symb : Int -> NP
= \i -> UsePN (IntPN i) ;
symb : Floating -> NP
symb : Float -> NP
= \i -> UsePN (FloatPN i) ;
symb : N -> Digits -> NP
= \c,i -> CNNumNP (UseN c) (NumDigits i) ;
@@ -42,7 +45,10 @@ incomplete resource Symbolic = open Symbol, Grammar in {
symb : Det -> N -> Str -> Str -> NP
= \c,n,x,y -> CNSymbNP c (UseN n) (BaseSymb (mkSymb x) (mkSymb y)) ;
symb : Det -> CN -> [Symb] -> NP
= CNSymbNP
= CNSymbNP ;
symb : Symb -> S = SymbS ;
symb : Symb -> Card = SymbNum ;
symb : Symb -> Ord = SymbOrd
} ;
mkSymb : Str -> Symb = \s -> {s = s ; lock_Symb = <>} ;

View File

@@ -2,4 +2,4 @@
resource SymbolicCat = Symbolic with
(Symbol = SymbolCat),
(Syntax = SyntaxCat) ;
(Grammar = GrammarCat) ;

View File

@@ -1,4 +1,4 @@
--# -path=.:present:mathematical:prelude
--# -path=.:present:prelude
resource SymbolicSpa = Symbolic with
(Symbol = SymbolSpa),

View File

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

View File

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

View File

@@ -0,0 +1,11 @@
--# -path=.:../romance:../abstract:../common
concrete CompatibilityCat of Compatibility = CatCat ** open Prelude, CommonRomance in {
-- from Noun 19/4/2008
lin
NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ;
OrdInt n = {s = \\_ => n.s ++ "."} ; ---
}

View File

@@ -1,2 +1,4 @@
--# -path=.:romance:abstract:common
concrete SymbolCat of Symbol = CatCat ** SymbolRomance with
(ResRomance = ResCat) ;

View File

@@ -1,2 +1,4 @@
--# -path=.:scandinavian:abstract:common
concrete SymbolDan of Symbol = CatDan ** SymbolScand with
(ResScand = ResDan) ;

View File

@@ -0,0 +1,11 @@
--# -path=.:../romance:../abstract:../common
concrete CompatibilityCat of Compatibility = CatCat ** open Prelude, CommonRomance in {
-- from Noun 19/4/2008
lin
NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ;
OrdInt n = {s = \\_ => n.s ++ "."} ; ---
}

View File

@@ -0,0 +1,11 @@
--# -path=.:../abstract:../common
concrete CompatibilityEng of Compatibility = CatEng ** open Prelude, ResEng in {
-- from Noun 19/4/2008
lin
NumInt n = {s = n.s ; n = Pl ; hasCard = True} ;
OrdInt n = {s = n.s ++ "th"} ;
}

View File

@@ -1,3 +1,5 @@
--# -path=.:abstract:common
concrete SymbolEng of Symbol = CatEng ** open Prelude, ResEng in {
lin

View File

@@ -0,0 +1,11 @@
--# -path=.:../abstract:../common
concrete CompatibilityFin of Compatibility = CatFin ** open Prelude, ResFin in {
-- from Noun 19/4/2008
lin
NumInt n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ;
OrdInt n = {s = \\_ => n.s ++ "."} ;
}

View File

@@ -1,3 +1,5 @@
--# -path=.:abstract:common
concrete SymbolFin of Symbol = CatFin ** open Prelude, NounFin, ResFin in {
lin
@@ -25,7 +27,7 @@ lin
SymbS sy = sy ;
SymbNum n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ;
SymbOrd n = {s = \\_,_ => n.s ++ "."} ;
SymbOrd n = {s = \\_ => n.s ++ "."} ;
lincat

View File

@@ -0,0 +1,11 @@
--# -path=.:../romance:../abstract:../common
concrete CompatibilityFre of Compatibility = CatFre ** open Prelude, CommonRomance in {
-- from Noun 19/4/2008
lin
NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ;
OrdInt n = {s = \\_ => n.s ++ "."} ; ---
}

View File

@@ -1,2 +1,4 @@
--# -path=.:romance:abstract:common
concrete SymbolFre of Symbol = CatFre ** SymbolRomance with
(ResRomance = ResFre) ;

View File

@@ -1,3 +1,5 @@
--# -path=.:abstract:common
concrete SymbolGer of Symbol = CatGer ** open Prelude, ResGer in {
lin

View File

@@ -0,0 +1,11 @@
--# -path=.:../romance:../abstract:../common
concrete CompatibilityIta of Compatibility = CatIta ** open Prelude, CommonRomance in {
-- from Noun 19/4/2008
lin
NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ;
OrdInt n = {s = \\_ => n.s ++ "."} ; ---
}

View File

@@ -1,2 +1,4 @@
--# -path=.:romance:abstract:common
concrete SymbolIta of Symbol = CatIta ** SymbolRomance with
(ResRomance = ResIta) ;

View File

@@ -1,2 +1,4 @@
--# -path=.:scandinavian:abstract:common
concrete SymbolNor of Symbol = CatNor ** SymbolScand with
(ResScand = ResNor) ;

View File

@@ -0,0 +1,11 @@
--# -path=.:../romance:../abstract:../common
concrete CompatibilitySpa of Compatibility = CatSpa ** open Prelude, CommonRomance in {
-- from Noun 19/4/2008
lin
NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ;
OrdInt n = {s = \\_ => n.s ++ "."} ; ---
}

View File

@@ -1,2 +1,4 @@
--# -path=.:romance:abstract:common
concrete SymbolSpa of Symbol = CatSpa ** SymbolRomance with
(ResRomance = ResSpa) ;

View File

@@ -0,0 +1,11 @@
--# -path=.:../scandinavian:../abstract:../common
concrete CompatibilitySwe of Compatibility = CatSwe ** open Prelude, CommonScand in {
-- from Noun 19/4/2008
lin
NumInt n = {s = \\_ => n.s ; isDet = True ; n = Pl} ;
OrdInt n = {s = n.s ++ ":e" ; isDet = True} ;
}

View File

@@ -1,2 +1,4 @@
--# -path=.:scandinavian:abstract:common
concrete SymbolSwe of Symbol = CatSwe ** SymbolScand with
(ResScand = ResSwe) ;

View File

@@ -0,0 +1,11 @@
--# -path=.:../abstract:../common
concrete CompatibilityEng of Compatibility = CatEng ** open Prelude, ResEng in {
-- from Noun 19/4/2008
lin
NumInt n = {s = n.s ; n = Pl ; hasCard = True} ;
OrdInt n = {s = n.s ++ "th"} ;
}