summaryrefslogtreecommitdiff
path: root/src/GF/Speech/SRG.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-06-25 13:38:40 +0000
committerbringert <bringert@cs.chalmers.se>2007-06-25 13:38:40 +0000
commit2b63a895690e6f4eb57c0a1b95692b640b9d9e2c (patch)
tree8006e803c44c86ba70473a7820fbb296345f8fa4 /src/GF/Speech/SRG.hs
parentf081dc0d6bb73d5439420569c352e88b0f096a7f (diff)
Some refactorings needed for recursion removal.
Diffstat (limited to 'src/GF/Speech/SRG.hs')
-rw-r--r--src/GF/Speech/SRG.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs
index 8370f130a..43969ab0d 100644
--- a/src/GF/Speech/SRG.hs
+++ b/src/GF/Speech/SRG.hs
@@ -49,7 +49,7 @@ import Data.Set (Set)
import qualified Data.Set as Set
data SRG = SRG { grammarName :: String -- ^ grammar name
- , startCat :: String -- ^ start category name
+ , startCat :: SRGCat -- ^ start category name
, origStartCat :: String -- ^ original start category name
, grammarLanguage :: Maybe String -- ^ The language for which the grammar
-- is intended, e.g. en-UK
@@ -61,7 +61,7 @@ data SRGRule = SRGRule SRGCat String [SRGAlt] -- ^ SRG category name, original c
-- and productions
deriving (Eq,Show)
--- | maybe a probability, a rule name and a list of symbols
+-- | maybe a probability, a rule name and an EBNF right-hand side
data SRGAlt = SRGAlt (Maybe Double) CFTerm SRGItem
deriving (Eq,Show)
@@ -163,6 +163,8 @@ srgTopCats srg = buildMultiMap [(oc, cat) | SRGRule cat origCat _ <- rules srg,
srgItem :: [[Symbol SRGNT Token]] -> SRGItem
srgItem = unionRE . map mergeItems . sortGroupBy (compareBy filterCats)
+-- non-optimizing version:
+--srgItem = unionRE . map seqRE
-- | Merges a list of right-hand sides which all have the same
-- sequence of non-terminals.