summaryrefslogtreecommitdiff
path: root/src/GF/Speech/CFGToFiniteState.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2006-01-17 02:13:57 +0000
committerbringert <bringert@cs.chalmers.se>2006-01-17 02:13:57 +0000
commitd4d89c72f370fe4c63cc5aaa612e64cb09c6f650 (patch)
tree1fb26d529d18f9858843439c1acc3f0d43a5a474 /src/GF/Speech/CFGToFiniteState.hs
parent74c5d41152a0315e038e3d37ac992a26f975b729 (diff)
Use cat and language in ATK si. Support language switching with ATK.
Diffstat (limited to 'src/GF/Speech/CFGToFiniteState.hs')
-rw-r--r--src/GF/Speech/CFGToFiniteState.hs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/GF/Speech/CFGToFiniteState.hs b/src/GF/Speech/CFGToFiniteState.hs
index b0d02983a..2fe3dabb1 100644
--- a/src/GF/Speech/CFGToFiniteState.hs
+++ b/src/GF/Speech/CFGToFiniteState.hs
@@ -27,7 +27,6 @@ import GF.Formalism.CFG
import GF.Formalism.Utilities (Symbol(..), mapSymbol, filterCats, symbol, NameProfile(..))
import GF.Conversion.Types
import GF.Infra.Ident (Ident)
-import GF.Infra.Option (Options)
import GF.Speech.FiniteState
import GF.Speech.Graph
@@ -57,9 +56,8 @@ data MFA a = MFA (DFA (MFALabel a)) [(String,DFA (MFALabel a))]
-cfgToFA :: Options -> CGrammar -> DFA String
-cfgToFA opts = minimize . compileAutomaton start . makeSimpleRegular
- where start = getStartCat opts
+cfgToFA :: String -> CGrammar -> DFA String
+cfgToFA start = minimize . compileAutomaton start . makeSimpleRegular
makeSimpleRegular :: CGrammar -> CFRules
makeSimpleRegular = makeRegular . removeIdenticalRules . removeEmptyCats . cfgToCFRules
@@ -155,13 +153,12 @@ make_fa c@(g,ns) q0 alpha q1 fa =
-- * Compile a strongly regular grammar to a DFA with sub-automata
--
-cfgToMFA :: Options -> CGrammar -> MFA String
-cfgToMFA opts g = buildMFA start g
- where start = getStartCat opts
+cfgToMFA :: String -> CGrammar -> MFA String
+cfgToMFA start g = buildMFA start g
-- | Build a DFA by building and expanding an MFA
-cfgToFA' :: Options -> CGrammar -> DFA String
-cfgToFA' opts g = mfaToDFA $ cfgToMFA opts g
+cfgToFA' :: String -> CGrammar -> DFA String
+cfgToFA' start g = mfaToDFA $ cfgToMFA start g
buildMFA :: Cat_ -- ^ Start category
-> CGrammar -> MFA String