From 0eac3f6b580ae6663fa672a3e2e4d4033a5d6802 Mon Sep 17 00:00:00 2001 From: bringert Date: Tue, 20 Mar 2007 22:09:17 +0000 Subject: [PATCH] Remove removeIdenticalRules, since it would get rid of alternative parse results. --- src/GF/Speech/CFGToFiniteState.hs | 1 - src/GF/Speech/SRG.hs | 1 - src/GF/Speech/TransformCFG.hs | 8 -------- 3 files changed, 10 deletions(-) diff --git a/src/GF/Speech/CFGToFiniteState.hs b/src/GF/Speech/CFGToFiniteState.hs index d9f8c31fa..6f93da40e 100644 --- a/src/GF/Speech/CFGToFiniteState.hs +++ b/src/GF/Speech/CFGToFiniteState.hs @@ -66,7 +66,6 @@ makeSimpleRegular :: Options -> StateGrammar -> CFRules makeSimpleRegular opts s = makeRegular $ preprocess $ cfgToCFRules s where start = getStartCatCF opts s preprocess = fix (topDownFilter start . bottomUpFilter) - . removeIdenticalRules . removeCycles -- diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs index edd02a21b..995eb3b2e 100644 --- a/src/GF/Speech/SRG.hs +++ b/src/GF/Speech/SRG.hs @@ -97,7 +97,6 @@ makeSimpleSRG opt s = (cats,cfgRules) = unzip $ preprocess $ cfgToCFRules s preprocess = removeLeftRecursion origStart . fix (topDownFilter origStart . bottomUpFilter) - . removeIdenticalRules . removeCycles names = mkCatNames name cats rs = map (cfgRulesToSRGRule names probs) cfgRules diff --git a/src/GF/Speech/TransformCFG.hs b/src/GF/Speech/TransformCFG.hs index 1439cc09d..232239b20 100644 --- a/src/GF/Speech/TransformCFG.hs +++ b/src/GF/Speech/TransformCFG.hs @@ -112,14 +112,6 @@ topDownFilter start rules = filter ((`Set.member` keep) . fst) rules uses = reflexiveClosure_ (allCats rules) $ transitiveClosure $ mkRel rhsCats keep = allRelated uses start --- | Remove rules which have the same rhs. --- FIXME: this messes up probabilities, names and profiles -removeIdenticalRules :: CFRules -> CFRules -removeIdenticalRules g = [(c,sortNubBy cmpRules rs) | (c,rs) <- g] - where - cmpRules (CFRule c1 ss1 _) (CFRule c2 ss2 _) = - mconcat [c1 `compare` c2, ss1 `compare` ss2] - -- * Removing left recursion -- The LC_LR algorithm from