diff options
| author | bringert <bringert@cs.chalmers.se> | 2007-06-27 17:46:34 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2007-06-27 17:46:34 +0000 |
| commit | af45f33d51298f5b9ce60b4b8786c326eb4601b1 (patch) | |
| tree | e553b363d6632772fbaa0da7bc897981f9a6b298 | |
| parent | af36dcf13d310c6acf256c21a18fa4cb1f7062f1 (diff) | |
bottom-up and top-down filtering do not need fix point iteration.
| -rw-r--r-- | src/GF/Speech/CFGToFiniteState.hs | 2 | ||||
| -rw-r--r-- | src/GF/Speech/SRG.hs | 8 | ||||
| -rw-r--r-- | src/GF/Speech/TransformCFG.hs | 1 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/GF/Speech/CFGToFiniteState.hs b/src/GF/Speech/CFGToFiniteState.hs index df4346d20..7e6f80ba1 100644 --- a/src/GF/Speech/CFGToFiniteState.hs +++ b/src/GF/Speech/CFGToFiniteState.hs @@ -64,7 +64,7 @@ cfgToFA opts s = minimize $ compileAutomaton start $ makeSimpleRegular opts s makeSimpleRegular :: Options -> StateGrammar -> CFRules makeSimpleRegular opts s = makeRegular $ preprocess $ cfgToCFRules s where start = getStartCatCF opts s - preprocess = fix (topDownFilter start . bottomUpFilter) + preprocess = topDownFilter start . bottomUpFilter . removeCycles diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs index 40e220923..2691b6171 100644 --- a/src/GF/Speech/SRG.hs +++ b/src/GF/Speech/SRG.hs @@ -93,10 +93,10 @@ makeSimpleSRG opt s = makeSRG preprocess opt s . mergeIdentical . traceStats "After removeLeftRecursion" . removeLeftRecursion origStart - . fix (traceStats "After topDownFilter" - . topDownFilter origStart - . traceStats "After bottomUpFilter" - . bottomUpFilter) + . traceStats "After topDownFilter" + . topDownFilter origStart + . traceStats "After bottomUpFilter" + . bottomUpFilter . traceStats "After removeCycles" . removeCycles . traceStats "Inital CFG" diff --git a/src/GF/Speech/TransformCFG.hs b/src/GF/Speech/TransformCFG.hs index eec80bad8..4e38216d9 100644 --- a/src/GF/Speech/TransformCFG.hs +++ b/src/GF/Speech/TransformCFG.hs @@ -109,7 +109,6 @@ bottomUpFilter gr = fix grow Map.empty okSym g = symbol (`elem` allCats g) (const True) -- | Removes categories which are not reachable from the start category. --- Only does one pass through the grammar. topDownFilter :: Cat_ -> CFRules -> CFRules topDownFilter start rules = filterCFRulesCats (isRelatedTo uses start) rules where |
