restored Symbolic in 1.4, moved to mathematical; Int and Float don't work properly

This commit is contained in:
aarne
2008-06-20 10:12:50 +00:00
parent b0c3dfb213
commit 392b11ba78
12 changed files with 107 additions and 3 deletions

View File

@@ -62,6 +62,8 @@ make xx = do
ifx "math" $ do
mapM_ (gfc False [] . math) langsMath
system $ "cp mathematical/*.gfo ../mathematical"
mapM_ (gfc False [] . symbolic) langsMath
system $ "cp mathematical/Symbolic*.gfo ../mathematical"
ifxx "pgf" $ do
system $ "gfc -s --make --name=langs --parser=off --output-dir=" ++ dir ++ " " ++
unwords [dir ++ "/Lang" ++ la ++ ".gfo" | (_,la) <- langsPGF] ++
@@ -88,6 +90,7 @@ treeb = "rf -lines -tree -file=" ++ treebankExx ++
lang (lla,la) = lla ++ "/Lang" ++ la ++ ".gf"
try (lla,la) = "api/Try" ++ la ++ ".gf"
math (lla,la) = "mathematical/Mathematical" ++ la ++ ".gf"
symbolic (lla,la) = "mathematical/Symbolic" ++ la ++ ".gf"
except ls es = filter (flip notElem es . snd) ls
only ls es = filter (flip elem es . snd) ls

View File

@@ -12,8 +12,8 @@ fun
SymbPN : Symb -> PN ; -- x
IntPN : Int -> PN ; -- 27
FloatPN : Float -> PN ; -- 3.14159
NumPN : Num -> PN ;
CNNumNP : CN -> Num -> NP ; -- level five ; level 5
NumPN : Card -> PN ;
CNNumNP : CN -> Card -> NP ; -- level five ; level 5
CNSymbNP : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
@@ -23,7 +23,7 @@ fun
--2 Symbols as numerals
SymbNum : Symb -> Num ; -- n
SymbNum : Symb -> Card ; -- n
SymbOrd : Symb -> Ord ; -- n'th
--2 Symbol lists

View File

@@ -0,0 +1,56 @@
--1 Symbolic: Noun Phrases with mathematical symbols
incomplete resource Symbolic = open Symbol, Grammar in {
oper
symb : overload {
symb : Str -> NP ; -- x
symb : Integer -> 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 -> Num -> NP ; -- the number four
symb : Det -> CN -> Num -> 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
} ;
mkSymb : Str -> Symb ;
mkInteger : Predef.Int -> Integer ;
mkFloating : Predef.Float -> Floating ;
--.
symb = overload {
symb : Str -> NP
= \s -> UsePN (SymbPN (mkSymb s)) ;
symb : Integer -> NP
= \i -> UsePN (IntPN i) ;
symb : Floating -> NP
= \i -> UsePN (FloatPN i) ;
symb : N -> Digits -> NP
= \c,i -> CNNumNP (UseN c) (NumDigits i) ;
symb : N -> Num -> NP
= \c,n -> CNNumNP (UseN c) n ;
symb : CN -> Num -> NP
= \c,n -> CNNumNP c n ;
symb : Det -> N -> Num -> NP
= \d,n,x -> DetCN d (ApposCN (UseN n) (UsePN (NumPN x))) ;
symb : Det -> CN -> Num -> NP
= \d,n,x -> DetCN d (ApposCN n (UsePN (NumPN x))) ;
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
} ;
mkSymb : Str -> Symb = \s -> {s = s ; lock_Symb = <>} ;
mkInteger i = {s = Predef.show Predef.Int i ; lock_Int = <>} ;
mkFloating f = {s = Predef.show Predef.Float f ; lock_Float = <>} ;
Integer : Type = {s : Str ; lock_Int : {}} ;
Floating : Type = {s : Str ; lock_Float : {}} ;
}

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicDan = Symbolic with
(Symbol = SymbolDan),
(Grammar = GrammarDan) ;

View File

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

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicFin = Symbolic with
(Symbol = SymbolFin),
(Grammar = GrammarFin) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicFre = Symbolic with
(Symbol = SymbolFre),
(Grammar = GrammarFre) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicGer = Symbolic with
(Symbol = SymbolGer),
(Grammar = GrammarGer) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicIta = Symbolic with
(Symbol = SymbolIta),
(Grammar = GrammarIta) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicNor = Symbolic with
(Symbol = SymbolNor),
(Grammar = GrammarNor) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicSpa = Symbolic with
(Symbol = SymbolSpa),
(Grammar = GrammarSpa) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicSwe = Symbolic with
(Symbol = SymbolSwe),
(Grammar = GrammarSwe) ;