diff options
| author | bringert <unknown> | 2004-09-15 16:16:34 +0000 |
|---|---|---|
| committer | bringert <unknown> | 2004-09-15 16:16:34 +0000 |
| commit | a38f028f04e6f2f635a5f371fb01a8d8a1930c99 (patch) | |
| tree | 741780b00ed02782568fb4e6e44612c0e13b8252 /src | |
| parent | a25ee154e760a424ef4aef46a6e3d6fdf1079cf1 (diff) | |
Use .MAIN for the start category.
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/Speech/PrGSL.hs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/GF/Speech/PrGSL.hs b/src/GF/Speech/PrGSL.hs index 259e7a023..c7cb283c6 100644 --- a/src/GF/Speech/PrGSL.hs +++ b/src/GF/Speech/PrGSL.hs @@ -77,23 +77,19 @@ cfgToGSL name start = cfgRulesToGSLRule rs@(r:_) = GSLRule (ruleCat r) (map ruleRhs rs) mkCatNames :: GSLGrammar -> CatNames -mkCatNames (GSLGrammar name start rules) = - listToFM (zipWith dotIfStart lhsCats names) +mkCatNames (GSLGrammar name start rules) = listToFM (zip lhsCats names) where names = [name ++ "_" ++ show x | x <- [0..]] lhsCats = [ c | GSLRule c _ <- rules] - dotIfStart c n | c == start = (c, "." ++ n) - | otherwise = (c, n) prGSLGrammar :: CatNames -> GSLGrammar -> ShowS prGSLGrammar names (GSLGrammar name start g) = - header . unlinesS (map prGSLrule g) + header . mainCat . unlinesS (map prGSLrule g) where header = showString ";GSL2.0" . nl - . comments ["Nuance speech synthesis grammar for " ++ name, - "Generated by GF", - "Start category: " ++ start - ++ " (" ++ prGSLCat start ")"] - . nl . nl + . comments ["Nuance speech recognition grammar for " ++ name, + "Generated by GF"] . nl . nl + mainCat = showString ("; Start category: " ++ start) . nl + . showString ".MAIN " . prGSLCat start . nl . nl prGSLrule (GSLRule cat rhs) = showString "; " . prtS cat . nl . prGSLCat cat . sp . wrap "[" (unwordsS (map prGSLAlt rhs)) "]" . nl |
