summaryrefslogtreecommitdiff
path: root/src/GF/Speech
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-01-03 23:14:10 +0000
committerbringert <bringert@cs.chalmers.se>2007-01-03 23:14:10 +0000
commitbead8666735df23d439cf009016288229c0aae48 (patch)
tree95ef05edcdd40e21304a1cf799645b3c0f4ea5f0 /src/GF/Speech
parent7577149241e584b9cddfb05d9aef9ade10d93554 (diff)
SRG: when making top-level categories, handle value categories introduced by -conversion=finite.
Diffstat (limited to 'src/GF/Speech')
-rw-r--r--src/GF/Speech/SRG.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs
index 01ccf04be..2edca0368 100644
--- a/src/GF/Speech/SRG.hs
+++ b/src/GF/Speech/SRG.hs
@@ -167,7 +167,13 @@ allSRGCats SRG { rules = rs } = [c | SRGRule c _ _ <- rs]
cfgCatToGFCat :: SRGCat -> Maybe String
cfgCatToGFCat c
- | '-' `elem` c = Nothing -- categories introduced by removeLeftRecursion contain dashes
+ -- categories introduced by removeLeftRecursion contain dashes
+ | '-' `elem` c = Nothing
+ -- some categories introduced by -conversion=finite have the form
+ -- "{fun:cat}..."
+ | "{" `isPrefixOf` c = case dropWhile (/=':') $ takeWhile (/='}') $ tail c of
+ ':':c' -> Just c'
+ _ -> error $ "cfgCatToGFCat: Strange category " ++ show c
| otherwise = Just $ takeWhile (/='{') c
srgTopCats :: SRG -> [(String,[SRGCat])]