diff options
| author | bringert <bringert@cs.chalmers.se> | 2005-12-22 23:16:15 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2005-12-22 23:16:15 +0000 |
| commit | e32472a9bb40468bd77db839d683bd15e89db2e1 (patch) | |
| tree | e2756756fc5b75f577a500438e34922c3b7b6d5f /src/GF/Speech/TransformCFG.hs | |
| parent | 29ba681242acd62a28e2facdad733619bf8d994f (diff) | |
Some performance improvements in the FA generation.
Diffstat (limited to 'src/GF/Speech/TransformCFG.hs')
| -rw-r--r-- | src/GF/Speech/TransformCFG.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/GF/Speech/TransformCFG.hs b/src/GF/Speech/TransformCFG.hs index 39060206b..2c920cbda 100644 --- a/src/GF/Speech/TransformCFG.hs +++ b/src/GF/Speech/TransformCFG.hs @@ -37,6 +37,8 @@ import Control.Monad import Data.FiniteMap import Data.List import Data.Maybe (fromJust, fromMaybe) +import Data.Set (Set) +import qualified Data.Set as Set -- | not very nice to replace the structured CFCat type with a simple string @@ -134,8 +136,8 @@ ruleFun :: CFRule_ -> Fun ruleFun (CFRule _ _ n) = name2fun n -- | Checks if a symbol is a non-terminal of one of the given categories. -catElem :: Eq c => Symbol c t -> [c] -> Bool -catElem s cs = symbol (`elem` cs) (const False) s +catElem :: Symbol Cat_ t -> Set Cat_ -> Bool +catElem s cs = symbol (`Set.member` cs) (const False) s -- | Check if any of the categories used on the right-hand side -- are in the given list of categories. |
