summaryrefslogtreecommitdiff
path: root/src/GF/Speech/PrJSGF.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-01-05 14:34:20 +0000
committerbringert <bringert@cs.chalmers.se>2007-01-05 14:34:20 +0000
commit741dde5a2a00dc737e570a7005663c2534ea4f6d (patch)
tree6aebd85fc4d9417a0bb3fbfb450fcf3ea72101b8 /src/GF/Speech/PrJSGF.hs
parent2b1c6763cc29857ba2890a12eb4330f6e03edd06 (diff)
Change input to the different SRG printers to be StateGrammar instead of CGrammar. This to allow looking at the types in SISR, and to reduce the number of argument passed from Custom.
Diffstat (limited to 'src/GF/Speech/PrJSGF.hs')
-rw-r--r--src/GF/Speech/PrJSGF.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/GF/Speech/PrJSGF.hs b/src/GF/Speech/PrJSGF.hs
index 02d455f73..a94ae2ca2 100644
--- a/src/GF/Speech/PrJSGF.hs
+++ b/src/GF/Speech/PrJSGF.hs
@@ -30,6 +30,7 @@ import GF.Probabilistic.Probabilistic (Probs)
import GF.Speech.SISR
import GF.Speech.SRG
import GF.Speech.RegExp
+import GF.Compile.ShellState (StateGrammar)
import Data.Char
import Data.List
@@ -41,12 +42,12 @@ jsgfPrinter :: Ident -- ^ Grammar name
-> String -- ^ Start category
-> Options
-> Maybe SISRFormat
- -> Maybe Probs -> CGrammar -> String
-jsgfPrinter name start opts sisr probs cfg = show (prJSGF srg sisr)
- where srg = makeSimpleSRG name start opts probs cfg
+ -> StateGrammar -> String
+jsgfPrinter name start opts sisr =
+ show . prJSGF sisr . makeSimpleSRG name start opts
-prJSGF :: SRG -> Maybe SISRFormat -> Doc
-prJSGF srg@(SRG{grammarName=name,startCat=start,origStartCat=origStart,rules=rs}) sisr
+prJSGF :: Maybe SISRFormat -> SRG -> Doc
+prJSGF sisr srg@(SRG{grammarName=name,startCat=start,origStartCat=origStart,rules=rs})
= header $++$ mainCat $++$ vcat topCatRules $++$ foldr ($++$) empty (map prRule rs)
where
header = text "#JSGF V1.0 UTF-8;" $$