summaryrefslogtreecommitdiff
path: root/src/GF/Speech/FiniteState.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-12-22 23:16:15 +0000
committerbringert <bringert@cs.chalmers.se>2005-12-22 23:16:15 +0000
commite32472a9bb40468bd77db839d683bd15e89db2e1 (patch)
treee2756756fc5b75f577a500438e34922c3b7b6d5f /src/GF/Speech/FiniteState.hs
parent29ba681242acd62a28e2facdad733619bf8d994f (diff)
Some performance improvements in the FA generation.
Diffstat (limited to 'src/GF/Speech/FiniteState.hs')
-rw-r--r--src/GF/Speech/FiniteState.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/GF/Speech/FiniteState.hs b/src/GF/Speech/FiniteState.hs
index dfd5d941d..a2f8952cb 100644
--- a/src/GF/Speech/FiniteState.hs
+++ b/src/GF/Speech/FiniteState.hs
@@ -16,7 +16,8 @@ module GF.Speech.FiniteState (FA, State, NFA, DFA,
states, transitions,
newFA,
addFinalState,
- newState, newTransition,
+ newState, newStates,
+ newTransition,
mapStates, mapTransitions,
oneFinalState,
moveLabelsToNodes, minimize,
@@ -65,6 +66,10 @@ newState :: a -> FA n a b -> (FA n a b, n)
newState x (FA g s ss) = (FA g' s ss, n)
where (g',n) = newNode x g
+newStates :: [a] -> FA n a b -> (FA n a b, [(n,a)])
+newStates xs (FA g s ss) = (FA g' s ss, ns)
+ where (g',ns) = newNodes xs g
+
newTransition :: n -> n -> b -> FA n a b -> FA n a b
newTransition f t l = onGraph (newEdge (f,t,l))