From ee3ce9694c134d697bf3fa6b8910c7d863f84dab Mon Sep 17 00:00:00 2001 From: krasimir Date: Tue, 5 Jan 2010 08:35:33 +0000 Subject: store the label names in PMCFG --- src/compiler/GF/Speech/PGFToCFG.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/compiler/GF/Speech') diff --git a/src/compiler/GF/Speech/PGFToCFG.hs b/src/compiler/GF/Speech/PGFToCFG.hs index a9bb20ef6..bd27deadf 100644 --- a/src/compiler/GF/Speech/PGFToCFG.hs +++ b/src/compiler/GF/Speech/PGFToCFG.hs @@ -42,8 +42,8 @@ pgfToCFG pgf lang = mkCFG (showCId (lookStartCat pgf)) extCats (startRules ++ co fcatCats :: Map FCat Cat fcatCats = Map.fromList [(fc, showCId c ++ "_" ++ show i) - | (c,fcs) <- Map.toList (startCats pinfo), - (fc,i) <- zip (range fcs) [1..]] + | (c,(s,e,lbls)) <- Map.toList (startCats pinfo), + (fc,i) <- zip (range (s,e)) [1..]] fcatCat :: FCat -> Cat fcatCat c = Map.findWithDefault ("Unknown_" ++ show c) c fcatCats @@ -69,8 +69,8 @@ pgfToCFG pgf lang = mkCFG (showCId (lookStartCat pgf)) extCats (startRules ++ co startRules :: [CFRule] startRules = [CFRule (showCId c) [NonTerminal (fcatToCat fc r)] (CFRes 0) - | (c,fcs) <- Map.toList (startCats pinfo), - fc <- range fcs, not (isLiteralFCat fc), + | (c,(s,e,lbls)) <- Map.toList (startCats pinfo), + fc <- range (s,e), not (isLiteralFCat fc), r <- [0..catLinArity fc-1]] fruleToCFRule :: (FCat,Production) -> [CFRule] -- cgit v1.2.3