diff options
| author | bringert <bringert@cs.chalmers.se> | 2005-12-13 21:03:56 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2005-12-13 21:03:56 +0000 |
| commit | 5a480fac520db1bab6f1336bee9b2031dbd36cab (patch) | |
| tree | 01210f87844268c0652867df51f4831094fa3e17 /src/GF/Speech | |
| parent | 9f867c4922cccb6e61b273a55103e2afaeac4bde (diff) | |
Added semi-working speech_input command.
Diffstat (limited to 'src/GF/Speech')
| -rw-r--r-- | src/GF/Speech/CFGToFiniteState.hs | 5 | ||||
| -rw-r--r-- | src/GF/Speech/PrFA.hs | 4 | ||||
| -rw-r--r-- | src/GF/Speech/PrSLF.hs | 11 |
3 files changed, 9 insertions, 11 deletions
diff --git a/src/GF/Speech/CFGToFiniteState.hs b/src/GF/Speech/CFGToFiniteState.hs index 5a72f548a..405e4324e 100644 --- a/src/GF/Speech/CFGToFiniteState.hs +++ b/src/GF/Speech/CFGToFiniteState.hs @@ -27,9 +27,8 @@ import GF.Speech.FiniteState import GF.Speech.Relation import GF.Speech.TransformCFG -cfgToFA :: Ident -- ^ Grammar name - -> Options -> CGrammar -> DFA String -cfgToFA name opts = minimize . compileAutomaton start . makeSimpleRegular +cfgToFA :: Options -> CGrammar -> DFA String +cfgToFA opts = minimize . compileAutomaton start . makeSimpleRegular where start = getStartCat opts makeSimpleRegular :: CGrammar -> CFRules diff --git a/src/GF/Speech/PrFA.hs b/src/GF/Speech/PrFA.hs index 79a9356db..1dac4fab0 100644 --- a/src/GF/Speech/PrFA.hs +++ b/src/GF/Speech/PrFA.hs @@ -37,7 +37,7 @@ import Data.Maybe (fromMaybe) faGraphvizPrinter :: Ident -- ^ Grammar name -> Options -> CGrammar -> String faGraphvizPrinter name opts cfg = - prFAGraphviz $ mapStates (const "") $ cfgToFA name opts cfg + prFAGraphviz $ mapStates (const "") $ cfgToFA opts cfg -- | Convert the grammar to a regular grammar and print it in BNF @@ -51,7 +51,7 @@ regularPrinter = prCFRules . makeSimpleRegular faCPrinter :: Ident -- ^ Grammar name -> Options -> CGrammar -> String -faCPrinter name opts cfg = fa2c $ cfgToFA name opts cfg +faCPrinter name opts cfg = fa2c $ cfgToFA opts cfg fa2c :: DFA String -> String fa2c fa = undefined
\ No newline at end of file diff --git a/src/GF/Speech/PrSLF.hs b/src/GF/Speech/PrSLF.hs index 9e497872e..eb9055d0b 100644 --- a/src/GF/Speech/PrSLF.hs +++ b/src/GF/Speech/PrSLF.hs @@ -48,16 +48,15 @@ data SLFEdge = SLFEdge { eId :: Int, eStart :: Int, eEnd :: Int } slfPrinter :: Ident -- ^ Grammar name -> Options -> CGrammar -> String -slfPrinter name opts cfg = prSLF (automatonToSLF $ mkSLFFA name opts cfg) "" +slfPrinter name opts cfg = prSLF (automatonToSLF $ mkSLFFA opts cfg) "" slfGraphvizPrinter :: Ident -- ^ Grammar name - -> Options -> CGrammar -> String + -> Options -> CGrammar -> String slfGraphvizPrinter name opts cfg = - prFAGraphviz $ mapStates (fromMaybe "") $ mapTransitions (const "") $ mkSLFFA name opts cfg + prFAGraphviz $ mapStates (fromMaybe "") $ mapTransitions (const "") $ mkSLFFA opts cfg -mkSLFFA :: Ident -- ^ Grammar name - -> Options -> CGrammar -> FA State (Maybe String) () -mkSLFFA name opts cfg = oneFinalState Nothing () $ moveLabelsToNodes $ dfa2nfa $ cfgToFA name opts cfg +mkSLFFA :: Options -> CGrammar -> FA State (Maybe String) () +mkSLFFA opts cfg = oneFinalState Nothing () $ moveLabelsToNodes $ dfa2nfa $ cfgToFA opts cfg automatonToSLF :: FA State (Maybe String) () -> SLF automatonToSLF fa = SLF { slfNodes = map mkSLFNode (states fa), |
