summaryrefslogtreecommitdiff
path: root/src/GF/System/ATKSpeechInput.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2006-01-04 21:41:12 +0000
committerbringert <bringert@cs.chalmers.se>2006-01-04 21:41:12 +0000
commita4ba93cc556dadc33ed95abd9baac0d29236bcfe (patch)
treecef6d169c72484ec7e187859a905a9c9247ac5e8 /src/GF/System/ATKSpeechInput.hs
parente22275d467fe78930d2510219a98283422a8a452 (diff)
Build SLF networks with sublattices.
Diffstat (limited to 'src/GF/System/ATKSpeechInput.hs')
-rw-r--r--src/GF/System/ATKSpeechInput.hs19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/GF/System/ATKSpeechInput.hs b/src/GF/System/ATKSpeechInput.hs
index c5e8fa5de..a84a0e264 100644
--- a/src/GF/System/ATKSpeechInput.hs
+++ b/src/GF/System/ATKSpeechInput.hs
@@ -22,13 +22,14 @@ import GF.Speech.PrSLF
import Speech.ATKRec
import Control.Monad
+import Data.Maybe
import Data.IORef
import System.Environment
import System.IO
import System.IO.Unsafe
data ATKLang = ATKLang {
- cmndef :: FilePath,
+ cmndef :: Maybe FilePath,
hmmlist :: FilePath,
mmf0 :: FilePath,
mmf1 :: FilePath,
@@ -50,11 +51,19 @@ getLanguage l =
atk_home <- getEnv_ "ATK_HOME" atk_home_error
let res = atk_home ++ "/Resources"
return $ ATKLang {
- cmndef = res ++ "/UK_SI_ZMFCC/cepmean",
+ cmndef = Just $ res ++ "/UK_SI_ZMFCC/cepmean",
hmmlist = res ++ "/UK_SI_ZMFCC/hmmlistbg",
mmf0 = res ++ "/UK_SI_ZMFCC/WI4",
mmf1 = res ++ "/UK_SI_ZMFCC/BGHMM2",
dict = res ++ "/beep.dct" }
+ "sv_SE" -> do
+ let res = "/home/bjorn/projects/atkswe/stoneage-swe"
+ return $ ATKLang {
+ cmndef = Nothing,
+ hmmlist = res ++ "/triphones1",
+ mmf0 = res ++ "/hmm12/macros",
+ mmf1 = res ++ "/hmm12/hmmdefs",
+ dict = res ++ "/dict" }
_ -> fail $ "ATKSpeechInput: language " ++ l ++ " not supported"
-- | List of the languages for which we have already loaded the HMM
@@ -71,8 +80,8 @@ initATK language =
when (null ls) $ do
config <- getEnv_ "GF_ATK_CFG" gf_atk_cfg_error
hPutStrLn stderr $ "Initializing ATK..."
- -- FIXME: CMNDEFAULT should be set in the per-language setup
- initialize (Just config) [("HPARM:CMNDEFAULT",cmndef l)]
+ let ps = map ((,) "HPARM:CMNDEFAULT") (maybeToList (cmndef l))
+ initialize (Just config) ps
when (language `notElem` ls) $
do
let hmmName = "hmm_" ++ language
@@ -88,7 +97,7 @@ recognizeSpeech name opts cfg =
do
let slf = slfPrinter name opts cfg
n = prIdent name
- language = "en_UK"
+ language = "sv_SE"
hmmName = "hmm_" ++ language
dictName = "dict_" ++ language
slfName = "gram_" ++ n