Look at both command-line and grammar startcat falgs in pg commands.

This commit is contained in:
bringert
2006-04-18 12:42:20 +00:00
parent 5ccf994499
commit a663a046ed
8 changed files with 58 additions and 36 deletions

View File

@@ -19,7 +19,7 @@
-- FIXME: lots of this stuff is used by CFGToFiniteState, thus
-- the missing explicit expot list.
module GF.Speech.TransformCFG {- (CFRule_, CFRules,
cfgToCFRules, getStartCat,
cfgToCFRules,
removeLeftRecursion,
removeEmptyCats, removeIdenticalRules) -} where
@@ -56,9 +56,6 @@ cfgToCFRules cfg = groupProds [CFRule (catToString c) (map symb r) n | CFRule c
-- symb (Tok t) = Tok t
catToString = prt
getStartCat :: Options -> String
getStartCat opts = fromMaybe "S" (getOptVal opts gStartCat) ++ "{}.s"
-- | Group productions by their lhs categories
groupProds :: [CFRule_] -> CFRules
groupProds = Map.toList . Map.fromListWith (++) . map (\r -> (lhsCat r,[r]))