diff options
| author | bjorn <bjorn@bringert.net> | 2008-11-09 14:27:34 +0000 |
|---|---|---|
| committer | bjorn <bjorn@bringert.net> | 2008-11-09 14:27:34 +0000 |
| commit | c6968b626ca8ff289d1eda24dab57af541037c42 (patch) | |
| tree | fb280ee5fda7ed7e2bb7fed61df5c6826c1978a7 /src/GF/Speech/SRG.hs | |
| parent | a24fab7873e8ccbfc7826ce9885643e773ba5fe8 (diff) | |
SRG generation: renameCats now gives new names to all cates used in the grammar, on RHS or LHS. This avoids a crash in non-recursive SRGS generation. The crash happend becase the bottom-up filter has not yet been done when renameCats is called.
Diffstat (limited to 'src/GF/Speech/SRG.hs')
| -rw-r--r-- | src/GF/Speech/SRG.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs index 622ba4ca3..03f6c0be7 100644 --- a/src/GF/Speech/SRG.hs +++ b/src/GF/Speech/SRG.hs @@ -128,7 +128,7 @@ renameCats prefix cfg = mapCFGCats renameCat cfg where renameCat c | isExternal c = c ++ "_cat" | otherwise = Map.findWithDefault (badCat c) c names isExternal c = c `Set.member` cfgExternalCats cfg - catsByPrefix = buildMultiMap [(takeWhile (/='_') cat, cat) | cat <- allCats cfg, not (isExternal cat)] + catsByPrefix = buildMultiMap [(takeWhile (/='_') cat, cat) | cat <- allCats' cfg, not (isExternal cat)] names = Map.fromList [(c,pref++"_"++show i) | (pref,cs) <- catsByPrefix, (c,i) <- zip cs [1..]] badCat c = error ("GF.Speech.SRG.renameCats: " ++ c ++ "\n" ++ prCFG cfg) |
