summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-12-16 15:13:37 +0000
committerbringert <bringert@cs.chalmers.se>2005-12-16 15:13:37 +0000
commit74792360f16fa25c95fce3c3f1ef280bc858af3d (patch)
tree459f8e4acfda6891a3bfd8ebd34685507ec040d3
parent068180ecc07c4d197d607d3397847a21fe980f1f (diff)
ATK: set CMNDEFAULT programmatically. Requires latest version of atkrec.
-rw-r--r--src/GF/System/ATKSpeechInput.hs7
-rw-r--r--src/gf_atk.cfg7
2 files changed, 5 insertions, 9 deletions
diff --git a/src/GF/System/ATKSpeechInput.hs b/src/GF/System/ATKSpeechInput.hs
index 47b3b6216..c5e8fa5de 100644
--- a/src/GF/System/ATKSpeechInput.hs
+++ b/src/GF/System/ATKSpeechInput.hs
@@ -28,6 +28,7 @@ import System.IO
import System.IO.Unsafe
data ATKLang = ATKLang {
+ cmndef :: FilePath,
hmmlist :: FilePath,
mmf0 :: FilePath,
mmf1 :: FilePath,
@@ -49,6 +50,7 @@ getLanguage l =
atk_home <- getEnv_ "ATK_HOME" atk_home_error
let res = atk_home ++ "/Resources"
return $ ATKLang {
+ cmndef = res ++ "/UK_SI_ZMFCC/cepmean",
hmmlist = res ++ "/UK_SI_ZMFCC/hmmlistbg",
mmf0 = res ++ "/UK_SI_ZMFCC/WI4",
mmf1 = res ++ "/UK_SI_ZMFCC/BGHMM2",
@@ -64,17 +66,18 @@ languages = unsafePerformIO $ newIORef []
initATK :: String -> IO ()
initATK language =
do
+ l <- getLanguage language
ls <- readIORef languages
when (null ls) $ do
config <- getEnv_ "GF_ATK_CFG" gf_atk_cfg_error
hPutStrLn stderr $ "Initializing ATK..."
- initialize config
+ -- FIXME: CMNDEFAULT should be set in the per-language setup
+ initialize (Just config) [("HPARM:CMNDEFAULT",cmndef l)]
when (language `notElem` ls) $
do
let hmmName = "hmm_" ++ language
dictName = "dict_" ++ language
hPutStrLn stderr $ "Initializing ATK (" ++ language ++ ")..."
- l <- getLanguage language
loadHMMSet hmmName (hmmlist l) (mmf0 l) (mmf1 l)
loadDict dictName (dict l)
writeIORef languages (language:ls)
diff --git a/src/gf_atk.cfg b/src/gf_atk.cfg
index 097406b2b..9dbb9abbe 100644
--- a/src/gf_atk.cfg
+++ b/src/gf_atk.cfg
@@ -38,13 +38,6 @@ HPARM: CMNTCONST = 0.995
HPARM: CMNRESETONSTOP = F
HPARM: CMNMINFRAMES = 12
-# -- Define HMM Resources --
-
-# FIXME: make this configurable at run-time
-HPARM: CMNDEFAULT = "/home/bjorn/src/atk/Resources/UK_SI_ZMFCC/cepmean"
-
-
-
# -- Recogniser --
AREC: TRBAKFREQ = 1