summaryrefslogtreecommitdiff
path: root/src-3.0/GF/Speech/JSGF.hs
diff options
context:
space:
mode:
authorbjorn <bjorn@bringert.net>2008-06-16 16:44:33 +0000
committerbjorn <bjorn@bringert.net>2008-06-16 16:44:33 +0000
commita47fcbcbf23ead0cf3d7144ee23906bd5f6cb440 (patch)
treeb8763526410773fe1eb2220c21c18d0c1957442c /src-3.0/GF/Speech/JSGF.hs
parent5c7c010f80533fd0909893c878b500ffb00f46bb (diff)
Handled renaming external SRG categories centrally.
Diffstat (limited to 'src-3.0/GF/Speech/JSGF.hs')
-rw-r--r--src-3.0/GF/Speech/JSGF.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src-3.0/GF/Speech/JSGF.hs b/src-3.0/GF/Speech/JSGF.hs
index d49646152..dc9f4170a 100644
--- a/src-3.0/GF/Speech/JSGF.hs
+++ b/src-3.0/GF/Speech/JSGF.hs
@@ -44,10 +44,8 @@ prJSGF sisr srg
comment "Generated by GF" $$
text ("grammar " ++ srgName srg ++ ";")
lang = maybe empty text (srgLanguage srg)
- mainCat = rule True "MAIN" [prCat (externalCat (srgStartCat srg))]
- prRule (SRGRule cat rhs)
- | isExternalCat srg cat = rule True (externalCat cat) (map prAlt rhs)
- | otherwise = rule False cat (map prAlt rhs)
+ mainCat = rule True "MAIN" [prCat (srgStartCat srg)]
+ prRule (SRGRule cat rhs) = rule (isExternalCat srg cat) cat (map prAlt rhs)
prAlt (SRGAlt mp n rhs) = sep [initTag, p (prItem sisr n rhs), finalTag]
where initTag | isEmpty t = empty
| otherwise = text "<NULL>" <+> t
@@ -55,9 +53,6 @@ prJSGF sisr srg
finalTag = tag sisr (profileFinalSISR n)
p = if isEmpty initTag && isEmpty finalTag then id else parens
-externalCat :: Cat -> Cat
-externalCat c = c ++ "_cat"
-
prCat :: Cat -> Doc
prCat c = char '<' <> text c <> char '>'