1
0
forked from GitHub/gf-core

Remove removeIdenticalRules, since it would get rid of alternative parse results.

This commit is contained in:
bringert
2007-03-20 22:09:17 +00:00
parent 00e681aee8
commit 7ae2e01678
3 changed files with 0 additions and 10 deletions

View File

@@ -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
--

View File

@@ -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

View File

@@ -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