summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GF/Speech/PrJSGF.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/GF/Speech/PrJSGF.hs b/src/GF/Speech/PrJSGF.hs
index 6d123df5f..ffb5d6630 100644
--- a/src/GF/Speech/PrJSGF.hs
+++ b/src/GF/Speech/PrJSGF.hs
@@ -52,13 +52,13 @@ prJSGF srg@(SRG{grammarName=name,startCat=start,origStartCat=origStart,rules=rs}
header = text "#JSGF V1.0 UTF-8;" $$
comment ("JSGF speech recognition grammar for " ++ name) $$
comment "Generated by GF" $$
- text ("grammar " ++ name ++ ";")
+ text ("grammar " ++ name ++ ";") $$ emptyLine
mainCat = comment ("Start category: " ++ origStart) $$
- rule True "MAIN" [prCat start]
+ rule True "MAIN" [prCat start] $$ emptyLine
prRule (SRGRule cat origCat rhs) =
comment origCat $$
-- rule False cat (map prAlt (ebnfSRGAlts rhs))
- rule False cat (map prAlt rhs) $$ text ""
+ rule False cat (map prAlt rhs) $$ emptyLine
-- FIXME: use the probability
-- prAlt (EBnfSRGAlt mp n rhs) = tag sisr (profileInitSISR n) . showChar ' '. prItem sisr rhs
prAlt (SRGAlt mp n rhs) = initTag <+> prItem sisr n rhs <+> finalTag
@@ -120,6 +120,9 @@ isPunct c = c `elem` "-_.;.,?!"
comment :: String -> Doc
comment s = text "//" <+> text s
+emptyLine :: Doc
+emptyLine = text ""
+
prepunctuate :: Doc -> [Doc] -> [Doc]
prepunctuate _ [] = []
prepunctuate p (x:xs) = x : map (p <>) xs