From d4d89c72f370fe4c63cc5aaa612e64cb09c6f650 Mon Sep 17 00:00:00 2001 From: bringert Date: Tue, 17 Jan 2006 02:13:57 +0000 Subject: Use cat and language in ATK si. Support language switching with ATK. --- src/GF/API.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/GF/API.hs') 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 -- cgit v1.2.3