From 647f7661c2b937acb4cdd88e3ea6ed2f286f6bd4 Mon Sep 17 00:00:00 2001 From: krasimir Date: Tue, 16 Sep 2008 15:11:06 +0000 Subject: [PATCH] fix the segmentation fault with Swedish --- src/PGF/Parsing/FCFG/Incremental.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/PGF/Parsing/FCFG/Incremental.hs b/src/PGF/Parsing/FCFG/Incremental.hs index fff5f0212..23b0424cc 100644 --- a/src/PGF/Parsing/FCFG/Incremental.hs +++ b/src/PGF/Parsing/FCFG/Incremental.hs @@ -39,9 +39,7 @@ initState pinfo start = forest = IntMap.fromListWith Set.union [(cat, Set.singleton (Passive ruleid args)) | (ruleid, FRule _ _ args cat _) <- assocs (allRules pinfo)] - max_fid = case IntMap.maxViewWithKey forest of - Just ((fid,_), _) -> fid+1 - Nothing -> 0 + max_fid = maximum (0:[maximum (cat:args) | (ruleid, FRule _ _ args cat _) <- assocs (allRules pinfo)])+1 in State pinfo (Chart MM.empty [] Map.empty forest max_fid 0)