summaryrefslogtreecommitdiff
path: root/src/GF/Speech/PrSLF.hs
diff options
context:
space:
mode:
authorbringert <unknown>2005-11-10 13:19:33 +0000
committerbringert <unknown>2005-11-10 13:19:33 +0000
commit5ae8cdc3d08fb1aae74e6da5c647c6c76cb46d15 (patch)
treeff70a3acda1775abc6bae8c52c98741c324d0ee3 /src/GF/Speech/PrSLF.hs
parente322a9e5e367f87955f7f0b53546a7402c8e2f0e (diff)
Moved FA and regular grammar printers to a separate module.
Diffstat (limited to 'src/GF/Speech/PrSLF.hs')
-rw-r--r--src/GF/Speech/PrSLF.hs22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/GF/Speech/PrSLF.hs b/src/GF/Speech/PrSLF.hs
index 33ddf03ca..7a328dd1d 100644
--- a/src/GF/Speech/PrSLF.hs
+++ b/src/GF/Speech/PrSLF.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/09/14 16:08:35 $
+-- > CVS $Date: 2005/11/10 14:19:33 $
-- > CVS $Author: bringert $
--- > CVS $Revision: 1.10 $
+-- > CVS $Revision: 1.11 $
--
-- This module converts a CFG to an SLF finite-state network
-- for use with the ATK recognizer. The SLF format is described
@@ -18,8 +18,7 @@
-- categories in the grammar
-----------------------------------------------------------------------------
-module GF.Speech.PrSLF (slfPrinter,slfGraphvizPrinter,
- faGraphvizPrinter,regularPrinter) where
+module GF.Speech.PrSLF (slfPrinter,slfGraphvizPrinter) where
import GF.Data.Utilities
import GF.Conversion.Types
@@ -56,21 +55,6 @@ slfGraphvizPrinter :: Ident -- ^ Grammar name
slfGraphvizPrinter name opts cfg =
prFAGraphviz (mapStates (fromMaybe "") $ mapTransitions (const "") $ moveLabelsToNodes $ cfgToFA name opts cfg)
-faGraphvizPrinter :: Ident -- ^ Grammar name
- -> Options -> CGrammar -> String
-faGraphvizPrinter name opts cfg =
- prFAGraphviz (mapStates (const "") $ mapTransitions (fromMaybe "") $ cfgToFA name opts cfg)
-
-
--- | Convert the grammar to a regular grammar and print it in BNF
-regularPrinter :: CGrammar -> String
-regularPrinter = prCFRules . makeSimpleRegular
- where
- prCFRules :: CFRules -> String
- prCFRules g = unlines [ c ++ " ::= " ++ join " | " (map (showRhs . ruleRhs) rs) | (c,rs) <- g]
- join g = concat . intersperse g
- showRhs = unwords . map (symbol id show)
-
automatonToSLF :: FA State (Maybe String) () -> SLF
automatonToSLF fa =
SLF { slfNodes = map mkSLFNode (states fa),