mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-12 04:32:50 -06:00
Some performance improvements in the FA generation.
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user