summaryrefslogtreecommitdiff
path: root/src/GF/Speech
diff options
context:
space:
mode:
authorbjorn <bjorn@bringert.net>2008-09-26 10:20:18 +0000
committerbjorn <bjorn@bringert.net>2008-09-26 10:20:18 +0000
commit2f3b7d1c5560aabb19db149c2a8e333931884d30 (patch)
tree5d446c9c4f0e12735e000d193aca23c9c04bd53c /src/GF/Speech
parent7a81b559fe90b4d1c389c21025da56e5159769e9 (diff)
Use ebnf format for "regular" output-format.
Diffstat (limited to 'src/GF/Speech')
-rw-r--r--src/GF/Speech/PGFToCFG.hs5
-rw-r--r--src/GF/Speech/SRG.hs4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/GF/Speech/PGFToCFG.hs b/src/GF/Speech/PGFToCFG.hs
index 27f08ba2d..c42c5f4ff 100644
--- a/src/GF/Speech/PGFToCFG.hs
+++ b/src/GF/Speech/PGFToCFG.hs
@@ -4,7 +4,7 @@
--
-- Approximates PGF grammars with context-free grammars.
----------------------------------------------------------------------
-module GF.Speech.PGFToCFG (bnfPrinter, regularPrinter,
+module GF.Speech.PGFToCFG (bnfPrinter,
fcfgPrinter, pgfToCFG) where
import PGF.CId
@@ -26,9 +26,6 @@ import qualified Data.Set as Set
bnfPrinter :: PGF -> CId -> String
bnfPrinter = toBNF id
-regularPrinter :: PGF -> CId -> String
-regularPrinter = toBNF makeRegular
-
toBNF :: (CFG -> CFG) -> PGF -> CId -> String
toBNF f pgf cnc = prCFG $ f $ pgfToCFG pgf cnc
diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs
index cee210dff..359672d63 100644
--- a/src/GF/Speech/SRG.hs
+++ b/src/GF/Speech/SRG.hs
@@ -12,6 +12,7 @@ module GF.Speech.SRG (SRG(..), SRGRule(..), SRGAlt(..), SRGItem, SRGSymbol
, SRGNT, CFTerm
, ebnfPrinter
, nonLeftRecursivePrinter
+ , regularPrinter
, makeSimpleSRG
, makeNonRecursiveSRG
, getSpeechLanguage
@@ -73,6 +74,9 @@ ebnfPrinter pgf cnc = prSRG $ makeSRG id pgf cnc
nonLeftRecursivePrinter :: PGF -> CId -> String
nonLeftRecursivePrinter pgf cnc = prSRG $ makeSRG removeLeftRecursion pgf cnc
+regularPrinter :: PGF -> CId -> String
+regularPrinter pgf cnc = prSRG $ makeSRG makeRegular pgf cnc
+
makeSRG :: (CFG -> CFG) -> PGF -> CId -> SRG
makeSRG = mkSRG cfgToSRG
where