diff options
Diffstat (limited to 'src/GF/Speech/PrJSGF.hs')
| -rw-r--r-- | src/GF/Speech/PrJSGF.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/GF/Speech/PrJSGF.hs b/src/GF/Speech/PrJSGF.hs index 8b12443a0..f6f0b19b2 100644 --- a/src/GF/Speech/PrJSGF.hs +++ b/src/GF/Speech/PrJSGF.hs @@ -34,6 +34,7 @@ import GF.Compile.ShellState (StateGrammar) import Data.Char import Data.List +import Data.Maybe import Text.PrettyPrint.HughesPJ import Debug.Trace @@ -44,13 +45,15 @@ jsgfPrinter :: Maybe SISRFormat jsgfPrinter sisr opts s = show $ prJSGF sisr $ makeSimpleSRG opts s prJSGF :: Maybe SISRFormat -> SRG -> Doc -prJSGF sisr srg@(SRG{grammarName=name,startCat=start,origStartCat=origStart,rules=rs}) +prJSGF sisr srg@(SRG{grammarName=name,grammarLanguage=ml, + startCat=start,origStartCat=origStart,rules=rs}) = header $++$ mainCat $++$ vcat topCatRules $++$ foldr ($++$) empty (map prRule rs) where - header = text "#JSGF V1.0 UTF-8;" $$ + header = text "#JSGF" <+> text "V1.0" <+> text "UTF-8" <+> lang <> char ';' $$ comment ("JSGF speech recognition grammar for " ++ name) $$ comment "Generated by GF" $$ text ("grammar " ++ name ++ ";") + lang = maybe empty text ml mainCat = comment ("Start category: " ++ origStart) $$ rule True "MAIN" [prCat start] prRule (SRGRule cat origCat rhs) = |
