From 5f33e0bda955c66aa81356c6636ec65d9a40bc2e Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 15 Oct 2008 07:47:57 +0000 Subject: store the total number of PMCFG categories in the PGF file --- src/PGF/Raw/Convert.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/PGF/Raw/Convert.hs') diff --git a/src/PGF/Raw/Convert.hs b/src/PGF/Raw/Convert.hs index 2912bced1..5a5654ed7 100644 --- a/src/PGF/Raw/Convert.hs +++ b/src/PGF/Raw/Convert.hs @@ -72,11 +72,12 @@ toConcr pgf rexp = add cnc (App "parser" ts) = cnc { parser = Just (toPInfo ts) } toPInfo :: [RExp] -> ParserInfo -toPInfo [App "functions" fs, App "sequences" ss, App "productions" ps,App "startcats" cs] = +toPInfo [App "functions" fs, App "sequences" ss, App "productions" ps,App "categories" (t:cs)] = ParserInfo { functions = functions , sequences = seqs , productions = productions , startCats = cats + , totalCats = expToInt t } where functions = mkArray (map toFFun fs) @@ -229,7 +230,7 @@ fromPInfo p = App "parser" [ App "functions" [fromFFun fun | fun <- elems (functions p)], App "sequences" [fromFSeq seq | seq <- elems (sequences p)], App "productions" [fromProductionSet xs | xs <- IntMap.toList (productions p)], - App "startcats" [App (prCId f) (map intToExp xs) | (f,xs) <- Map.toList (startCats p)] + App "categories" (intToExp (totalCats p) : [App (prCId f) (map intToExp xs) | (f,xs) <- Map.toList (startCats p)]) ] fromFFun :: FFun -> RExp -- cgit v1.2.3