From 794fbd4a416ef53d289545eb83455ee745115fec Mon Sep 17 00:00:00 2001 From: bjorn Date: Tue, 30 Sep 2008 10:53:36 +0000 Subject: [PATCH] Fixed CFG start cats for categories with more than one constituent. --- src/GF/Speech/PGFToCFG.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GF/Speech/PGFToCFG.hs b/src/GF/Speech/PGFToCFG.hs index c42c5f4ff..018cb682e 100644 --- a/src/GF/Speech/PGFToCFG.hs +++ b/src/GF/Speech/PGFToCFG.hs @@ -77,11 +77,11 @@ pgfToCFG pgf lang = mkCFG (lookStartCat pgf) extCats (startRules ++ concatMap fr extCats :: Set Cat extCats = Set.fromList $ map lhsCat startRules - -- NOTE: this is only correct for cats that have a lincat with exactly one row. startRules :: [CFRule] - startRules = [CFRule (prCId c) [NonTerminal (fcatToCat fc 0)] (CFRes 0) + startRules = [CFRule (prCId c) [NonTerminal (fcatToCat fc r)] (CFRes 0) | (c,fcs) <- Map.toList (startupCats pinfo), - fc <- fcs, not (isLiteralFCat fc)] + fc <- fcs, not (isLiteralFCat fc), + r <- [0..catLinArity fc-1]] fruleToCFRule :: FRule -> [CFRule] fruleToCFRule (FRule f ps args c rhs) =