mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
restored Symbolic in 1.4, moved to mathematical; Int and Float don't work properly
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
56
lib/resource-1.4/mathematical/Symbolic.gf
Normal file
56
lib/resource-1.4/mathematical/Symbolic.gf
Normal 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 : {}} ;
|
||||
|
||||
}
|
||||
5
lib/resource-1.4/mathematical/SymbolicDan.gf
Normal file
5
lib/resource-1.4/mathematical/SymbolicDan.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicDan = Symbolic with
|
||||
(Symbol = SymbolDan),
|
||||
(Grammar = GrammarDan) ;
|
||||
5
lib/resource-1.4/mathematical/SymbolicEng.gf
Normal file
5
lib/resource-1.4/mathematical/SymbolicEng.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicEng = Symbolic with
|
||||
(Symbol = SymbolEng),
|
||||
(Grammar = GrammarEng) ;
|
||||
5
lib/resource-1.4/mathematical/SymbolicFin.gf
Normal file
5
lib/resource-1.4/mathematical/SymbolicFin.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicFin = Symbolic with
|
||||
(Symbol = SymbolFin),
|
||||
(Grammar = GrammarFin) ;
|
||||
5
lib/resource-1.4/mathematical/SymbolicFre.gf
Normal file
5
lib/resource-1.4/mathematical/SymbolicFre.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicFre = Symbolic with
|
||||
(Symbol = SymbolFre),
|
||||
(Grammar = GrammarFre) ;
|
||||
5
lib/resource-1.4/mathematical/SymbolicGer.gf
Normal file
5
lib/resource-1.4/mathematical/SymbolicGer.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicGer = Symbolic with
|
||||
(Symbol = SymbolGer),
|
||||
(Grammar = GrammarGer) ;
|
||||
5
lib/resource-1.4/mathematical/SymbolicIta.gf
Normal file
5
lib/resource-1.4/mathematical/SymbolicIta.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicIta = Symbolic with
|
||||
(Symbol = SymbolIta),
|
||||
(Grammar = GrammarIta) ;
|
||||
5
lib/resource-1.4/mathematical/SymbolicNor.gf
Normal file
5
lib/resource-1.4/mathematical/SymbolicNor.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicNor = Symbolic with
|
||||
(Symbol = SymbolNor),
|
||||
(Grammar = GrammarNor) ;
|
||||
5
lib/resource-1.4/mathematical/SymbolicSpa.gf
Normal file
5
lib/resource-1.4/mathematical/SymbolicSpa.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicSpa = Symbolic with
|
||||
(Symbol = SymbolSpa),
|
||||
(Grammar = GrammarSpa) ;
|
||||
5
lib/resource-1.4/mathematical/SymbolicSwe.gf
Normal file
5
lib/resource-1.4/mathematical/SymbolicSwe.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicSwe = Symbolic with
|
||||
(Symbol = SymbolSwe),
|
||||
(Grammar = GrammarSwe) ;
|
||||
Reference in New Issue
Block a user