diff options
| author | bringert <bringert@cs.chalmers.se> | 2006-01-17 02:13:57 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2006-01-17 02:13:57 +0000 |
| commit | d4d89c72f370fe4c63cc5aaa612e64cb09c6f650 (patch) | |
| tree | 1fb26d529d18f9858843439c1acc3f0d43a5a474 /src/GF/API.hs | |
| parent | 74c5d41152a0315e038e3d37ac992a26f975b729 (diff) | |
Use cat and language in ATK si. Support language switching with ATK.
Diffstat (limited to 'src/GF/API.hs')
| -rw-r--r-- | src/GF/API.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/GF/API.hs b/src/GF/API.hs index 469b762ed..906bd062f 100644 --- a/src/GF/API.hs +++ b/src/GF/API.hs @@ -75,6 +75,7 @@ import GF.Infra.UseIO import GF.Data.Zipper import Data.List (nub) +import Data.Maybe (fromMaybe) import Control.Monad (liftM) import System (system) @@ -208,13 +209,15 @@ speechGenerate opts str = do --- system ("echo" +++ "\"" ++ str ++ "\" | festival --tts" ++ lan) return () --- FIXME: look at flags -speechInput :: Options -> StateGrammar -> IO String -speechInput opt s = recognizeSpeech name opts cfg +speechInput :: Options -> StateGrammar -> IO [String] +speechInput opt s = recognizeSpeech name language cfg cat number where - opts = stateOptions s + opts = addOptions opt (stateOptions s) name = cncId s - cfg = stateCFG s + cfg = stateCFG s -- FIXME: use lang flag to select grammar + language = fromMaybe "en_UK" (getOptVal opts speechLanguage) + cat = fromMaybe "S" (getOptVal opts gStartCat) + number = optIntOrN opts flagNumber 1 optLinearizeTreeVal :: Options -> GFGrammar -> Tree -> String optLinearizeTreeVal opts gr = err id id . optLinearizeTree opts gr |
