Fixed conflict from Aarne's ATK path changes. Added NOILINE pragma to ATK initialized variable.

This commit is contained in:
bringert
2005-12-16 09:54:31 +00:00
parent d284e54aed
commit b569d80d50

View File

@@ -31,30 +31,25 @@ import System.IO.Unsafe
config = "/home/aarne/atk/atkrec/atkrec.cfg" config = "/home/aarne/atk/atkrec/atkrec.cfg"
res = "/home/bjorn/src/atk/Resources" {-# NOINLINE initialized #-}
hmmlist = res ++ "/UK_SI_ZMFCC/hmmlistbg"
mmf0 = res ++ "/UK_SI_ZMFCC/WI4"
mmf1 = res ++ "/UK_SI_ZMFCC/BGHMM2"
dict = res ++ "/beep.dct"
initialized :: IORef Bool initialized :: IORef Bool
initialized = unsafePerformIO $ newIORef False initialized = unsafePerformIO $ newIORef False
initATK :: IO () initATK :: IO ()
initATK = do initATK = do
b <- readIORef initialized b <- readIORef initialized
when (not b) $ do when (not b) $ do
hPutStrLn stderr "Initializing..." hPutStrLn stderr "Initializing..."
atk_home <- getEnv "ATK_HOME" atk_home <- getEnv "ATK_HOME"
let res = atk_home ++ "/Resources" let res = atk_home ++ "/Resources"
hmmlist = res ++ "/UK_SI_ZMFCC/hmmlistbg" hmmlist = res ++ "/UK_SI_ZMFCC/hmmlistbg"
mmf0 = res ++ "/UK_SI_ZMFCC/WI4" mmf0 = res ++ "/UK_SI_ZMFCC/WI4"
mmf1 = res ++ "/UK_SI_ZMFCC/BGHMM2" mmf1 = res ++ "/UK_SI_ZMFCC/BGHMM2"
dict = res ++ "/beep.dct" dict = res ++ "/beep.dct"
initialize config initialize config
loadHMMSet "hmm_english" hmmlist mmf0 mmf1 loadHMMSet "hmm_english" hmmlist mmf0 mmf1
loadDict "dict_english" dict loadDict "dict_english" dict
writeIORef initialized True writeIORef initialized True
recognizeSpeech :: Ident -- ^ Grammar name recognizeSpeech :: Ident -- ^ Grammar name
-> Options -> CGrammar -> IO String -> Options -> CGrammar -> IO String