summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Speech
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2015-08-28 13:59:43 +0000
committerhallgren <hallgren@chalmers.se>2015-08-28 13:59:43 +0000
commit5bfaf10de597af504e6d2784309e533b09a6451c (patch)
treec0aacba9c492304cb3b0f905aa05bbefa1599d2c /src/compiler/GF/Speech
parentf2952768d578309a8f75c7da417e3602c4d5e9e9 (diff)
Comment out some dead code found with -fwarn-unused-binds
Also fixed some warnings and tightened some imports
Diffstat (limited to 'src/compiler/GF/Speech')
-rw-r--r--src/compiler/GF/Speech/FiniteState.hs14
-rw-r--r--src/compiler/GF/Speech/GSL.hs4
-rw-r--r--src/compiler/GF/Speech/SLF.hs4
-rw-r--r--src/compiler/GF/Speech/SRG.hs6
-rw-r--r--src/compiler/GF/Speech/SRGS_ABNF.hs4
-rw-r--r--src/compiler/GF/Speech/VoiceXML.hs16
6 files changed, 24 insertions, 24 deletions
diff --git a/src/compiler/GF/Speech/FiniteState.hs b/src/compiler/GF/Speech/FiniteState.hs
index 4eaf3873a..cb5247755 100644
--- a/src/compiler/GF/Speech/FiniteState.hs
+++ b/src/compiler/GF/Speech/FiniteState.hs
@@ -36,7 +36,7 @@ module GF.Speech.FiniteState (FA(..), State, NFA, DFA,
import Data.List
import Data.Maybe
-import Data.Map (Map)
+--import Data.Map (Map)
import qualified Data.Map as Map
import Data.Set (Set)
import qualified Data.Set as Set
@@ -246,8 +246,8 @@ fixIncoming cs c@((n,()),es) = (cs'', ((n,Nothing),es'):newContexts)
++ [ (y,x,()) | (f,_,l') <- cyc, l == l', (y,_) <- newNodes]
newContexts = [ (v, to v) | v <- newNodes ]
-alphabet :: Eq b => Graph n a (Maybe b) -> [b]
-alphabet = nub . catMaybes . map edgeLabel . edges
+--alphabet :: Eq b => Graph n a (Maybe b) -> [b]
+--alphabet = nub . catMaybes . map edgeLabel . edges
determinize :: Ord a => NFA a -> DFA a
determinize (FA g s f) = let (ns,es) = h (Set.singleton start) Set.empty Set.empty
@@ -309,8 +309,8 @@ dfa2nfa = mapTransitions Just
prFAGraphviz :: (Eq n,Show n) => FA n String String -> String
prFAGraphviz = Dot.prGraphviz . faToGraphviz
-prFAGraphviz_ :: (Eq n,Show n,Show a, Show b) => FA n a b -> String
-prFAGraphviz_ = Dot.prGraphviz . faToGraphviz . mapStates show . mapTransitions show
+--prFAGraphviz_ :: (Eq n,Show n,Show a, Show b) => FA n a b -> String
+--prFAGraphviz_ = Dot.prGraphviz . faToGraphviz . mapStates show . mapTransitions show
faToGraphviz :: (Eq n,Show n) => FA n String String -> Dot.Graph
faToGraphviz (FA (Graph _ ns es) s f)
@@ -325,5 +325,5 @@ faToGraphviz (FA (Graph _ ns es) s f)
-- * Utilities
--
-lookups :: Ord k => [k] -> Map k a -> [a]
-lookups xs m = mapMaybe (flip Map.lookup m) xs
+--lookups :: Ord k => [k] -> Map k a -> [a]
+--lookups xs m = mapMaybe (flip Map.lookup m) xs
diff --git a/src/compiler/GF/Speech/GSL.hs b/src/compiler/GF/Speech/GSL.hs
index ca49afb61..d9d6af0cc 100644
--- a/src/compiler/GF/Speech/GSL.hs
+++ b/src/compiler/GF/Speech/GSL.hs
@@ -78,8 +78,8 @@ keepSymbol _ = True
showToken :: Token -> Doc
showToken = pp . map toLower
-isPunct :: Char -> Bool
-isPunct c = c `elem` "-_.:;.,?!()[]{}"
+--isPunct :: Char -> Bool
+--isPunct c = c `elem` "-_.:;.,?!()[]{}"
comment :: String -> Doc
comment s = ";" <+> s
diff --git a/src/compiler/GF/Speech/SLF.hs b/src/compiler/GF/Speech/SLF.hs
index 1992baaec..16f8f0461 100644
--- a/src/compiler/GF/Speech/SLF.hs
+++ b/src/compiler/GF/Speech/SLF.hs
@@ -51,7 +51,7 @@ mkFAs pgf cnc = (slfStyleFA main, [(c,slfStyleFA n) | (c,n) <- subs])
slfStyleFA :: Eq a => DFA a -> FA State (Maybe a) ()
slfStyleFA = renameStates [0..] . removeTrivialEmptyNodes . oneFinalState Nothing ()
. moveLabelsToNodes . dfa2nfa
-
+{-
-- | Give sequential names to subnetworks.
renameSubs :: MFA -> MFA
renameSubs (MFA start subs) = MFA (newName start) subs'
@@ -59,7 +59,7 @@ renameSubs (MFA start subs) = MFA (newName start) subs'
newName s = lookup' s newNames
subs' = [(newName s,renameLabels n) | (s,n) <- subs]
renameLabels = mapTransitions (mapSymbol newName id)
-
+-}
--
-- * SLF graphviz printing (without sub-networks)
--
diff --git a/src/compiler/GF/Speech/SRG.hs b/src/compiler/GF/Speech/SRG.hs
index d5bedc797..a0a616561 100644
--- a/src/compiler/GF/Speech/SRG.hs
+++ b/src/compiler/GF/Speech/SRG.hs
@@ -37,7 +37,7 @@ import qualified Data.Map as Map
import Data.Set (Set)
import qualified Data.Set as Set
-import Debug.Trace
+--import Debug.Trace
data SRG = SRG { srgName :: String -- ^ grammar name
, srgStartCat :: Cat -- ^ start category name
@@ -88,13 +88,13 @@ setDefaultCFGTransform opts t b = setCFGTransform t b `addOptions` opts
maybeTransform :: Options -> CFGTransform -> (CFG -> CFG) -> (CFG -> CFG)
maybeTransform opts t f = if cfgTransform opts t then f else id
-
+{-
traceStats s g = trace ("---- " ++ s ++ ": " ++ stats g {- ++ "\n" ++ prCFRules g ++ "----" -}) g
stats g = "Categories: " ++ show (countCats g)
++ ", External categories: " ++ show (Set.size (cfgExternalCats g))
++ ", Rules: " ++ show (countRules g)
-
+-}
makeNonRecursiveSRG :: Options
-> PGF
-> CId -- ^ Concrete syntax name.
diff --git a/src/compiler/GF/Speech/SRGS_ABNF.hs b/src/compiler/GF/Speech/SRGS_ABNF.hs
index f5e163951..75d206a0c 100644
--- a/src/compiler/GF/Speech/SRGS_ABNF.hs
+++ b/src/compiler/GF/Speech/SRGS_ABNF.hs
@@ -99,10 +99,10 @@ tag (Just fmt) t =
isPunct :: Char -> Bool
isPunct c = c `elem` "-_.;.,?!"
-
+{-
comment :: String -> Doc
comment s = "//" <+> s
-
+-}
alts :: [Doc] -> Doc
alts = fsep . prepunctuate ("| ")
diff --git a/src/compiler/GF/Speech/VoiceXML.hs b/src/compiler/GF/Speech/VoiceXML.hs
index 79c904f49..84264c4d7 100644
--- a/src/compiler/GF/Speech/VoiceXML.hs
+++ b/src/compiler/GF/Speech/VoiceXML.hs
@@ -151,13 +151,13 @@ prompt = Tag "prompt" []
promptString :: String -> XML
promptString p = prompt [Data p]
-
+{-
reprompt :: XML
reprompt = ETag "reprompt" []
-
+-}
assign :: String -> String -> XML
assign n e = ETag "assign" [("name",n),("expr",e)]
-
+{-
value :: String -> XML
value expr = ETag "value" [("expr",expr)]
@@ -174,7 +174,7 @@ cond ((c,b):rest) els = Tag "if" [("cond",c)] (b ++ es)
goto_item :: String -> XML
goto_item nextitem = ETag "goto" [("nextitem",nextitem)]
-
+-}
return_ :: [String] -> XML
return_ names = ETag "return" [("namelist", unwords names)]
@@ -183,7 +183,7 @@ block = Tag "block" []
blockCond :: String -> [XML] -> XML
blockCond cond = Tag "block" [("cond", cond)]
-
+{-
throw :: String -> String -> XML
throw event msg = Tag "throw" [("event",event),("message",msg)] []
@@ -192,20 +192,20 @@ nomatch = Tag "nomatch" []
help :: [XML] -> XML
help = Tag "help" []
-
+-}
param :: String -> String -> XML
param name expr = ETag "param" [("name",name),("expr",expr)]
var :: String -> Maybe String -> XML
var name expr = ETag "var" ([("name",name)]++e)
where e = maybe [] ((:[]) . (,) "expr") expr
-
+{-
script :: String -> XML
script s = Tag "script" [] [CData s]
scriptURI :: String -> XML
scriptURI uri = Tag "script" [("uri", uri)] []
-
+-}
--
-- * ECMAScript stuff
--