mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 09:52:55 -06:00
Fixed conflict from Aarne's ATK path changes. Added NOILINE pragma to ATK initialized variable.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user