diff options
| author | bringert <bringert@cs.chalmers.se> | 2006-04-13 14:18:13 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2006-04-13 14:18:13 +0000 |
| commit | 47dedcf256976495f405a802920fa3012f683a52 (patch) | |
| tree | b1b1e6cc871fd4d1d41ea84b8da8c084e2b9f33c /src | |
| parent | aa309abecf2640daf015c5afaffacb3668777b3f (diff) | |
Fixed bug in SRG top-down filtering where the start category would be removed if it wasn't referenced by itself.
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/Speech/SRG.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs index 0334c1301..8080b941f 100644 --- a/src/GF/Speech/SRG.hs +++ b/src/GF/Speech/SRG.hs @@ -140,7 +140,11 @@ topDownFilter srg@(SRG { startCat = start, rules = rs }) = srg { rules = rs' } rhsCats = [ (c,c') | r@(SRGRule c _ ps) <- rs, SRGAlt _ _ ss <- ps, c' <- filterCats ss] - keep = allRelated (transitiveClosure $ mkRel rhsCats) start + uses = reflexiveClosure_ (allSRGCats srg) $ transitiveClosure $ mkRel rhsCats + keep = allRelated uses start + +allSRGCats :: SRG -> [String] +allSRGCats SRG { rules = rs } = [c | SRGRule c _ _ <- rs] -- -- * Utilities for building and printing SRGs |
