From 741dde5a2a00dc737e570a7005663c2534ea4f6d Mon Sep 17 00:00:00 2001 From: bringert Date: Fri, 5 Jan 2007 14:34:20 +0000 Subject: 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. --- src/GF/Speech/PrJSGF.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/GF/Speech/PrJSGF.hs') 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;" $$ -- cgit v1.2.3