From e32472a9bb40468bd77db839d683bd15e89db2e1 Mon Sep 17 00:00:00 2001 From: bringert Date: Thu, 22 Dec 2005 23:16:15 +0000 Subject: Some performance improvements in the FA generation. --- src/GF/Speech/FiniteState.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/GF/Speech/FiniteState.hs') 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)) -- cgit v1.2.3