diff options
| author | bringert <bringert@cs.chalmers.se> | 2005-12-16 09:54:31 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2005-12-16 09:54:31 +0000 |
| commit | ed3700c5b327811182472d3de4ba78b4ca6c455d (patch) | |
| tree | cb97c48e234fb08a7dbba8e94e02484c99bbcba9 /src | |
| parent | 82cb712132a99692f794a7b9b13408e3f7a55c3f (diff) | |
Fixed conflict from Aarne's ATK path changes. Added NOILINE pragma to ATK initialized variable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/System/ATKSpeechInput.hs | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/GF/System/ATKSpeechInput.hs b/src/GF/System/ATKSpeechInput.hs index eac9765c1..fd4553c58 100644 --- a/src/GF/System/ATKSpeechInput.hs +++ b/src/GF/System/ATKSpeechInput.hs @@ -31,30 +31,25 @@ import System.IO.Unsafe config = "/home/aarne/atk/atkrec/atkrec.cfg" -res = "/home/bjorn/src/atk/Resources" -hmmlist = res ++ "/UK_SI_ZMFCC/hmmlistbg" -mmf0 = res ++ "/UK_SI_ZMFCC/WI4" -mmf1 = res ++ "/UK_SI_ZMFCC/BGHMM2" -dict = res ++ "/beep.dct" - +{-# NOINLINE initialized #-} initialized :: IORef Bool initialized = unsafePerformIO $ newIORef False initATK :: IO () initATK = do - b <- readIORef initialized - when (not b) $ do - hPutStrLn stderr "Initializing..." - atk_home <- getEnv "ATK_HOME" - let res = atk_home ++ "/Resources" - hmmlist = res ++ "/UK_SI_ZMFCC/hmmlistbg" - mmf0 = res ++ "/UK_SI_ZMFCC/WI4" - mmf1 = res ++ "/UK_SI_ZMFCC/BGHMM2" - dict = res ++ "/beep.dct" - initialize config - loadHMMSet "hmm_english" hmmlist mmf0 mmf1 - loadDict "dict_english" dict - writeIORef initialized True + b <- readIORef initialized + when (not b) $ do + hPutStrLn stderr "Initializing..." + atk_home <- getEnv "ATK_HOME" + let res = atk_home ++ "/Resources" + hmmlist = res ++ "/UK_SI_ZMFCC/hmmlistbg" + mmf0 = res ++ "/UK_SI_ZMFCC/WI4" + mmf1 = res ++ "/UK_SI_ZMFCC/BGHMM2" + dict = res ++ "/beep.dct" + initialize config + loadHMMSet "hmm_english" hmmlist mmf0 mmf1 + loadDict "dict_english" dict + writeIORef initialized True recognizeSpeech :: Ident -- ^ Grammar name -> Options -> CGrammar -> IO String |
