Commit 035036f4 authored by Fabien Manière's avatar Fabien Manière

Make All optional: put EN instead.

parent 5a8dc3a0
...@@ -31,17 +31,21 @@ readConfig :: FilePath -> IO NLPConfig ...@@ -31,17 +31,21 @@ readConfig :: FilePath -> IO NLPConfig
readConfig fp = do readConfig fp = do
ini <- readIniFile' fp ini <- readIniFile' fp
let val' = val ini iniSection let val' = val ini iniSection
let lang_default_text = "EN" -- Change this value by one of your choice: "All" or "FR", "EN"
let m_nlp_all = parseURI $ cs $ val' "All" -- let m_nlp_all = parseURI $ cs $ val'
let m_nlp_default = parseURI $ cs $ val' lang_default_text
let m_nlp_keys = filter (\k -> k `notElem` ["All"]) $ fromRight [] $ Ini.keys iniSection ini let m_nlp_keys = filter (\k -> k `notElem` [lang_default_text]) $ fromRight [] $ Ini.keys iniSection ini
let m_nlp_other = listToMaybeAll $ (\k -> (,) k <$> (parseURI $ cs $ val' k)) <$> m_nlp_keys let m_nlp_other = listToMaybeAll $ (\k -> (,) k <$> (parseURI $ cs $ val' k)) <$> m_nlp_keys
let mRet = NLPConfig <$> m_nlp_all <*> (Map.fromList <$> m_nlp_other) -- let mRet = NLPConfig <$> m_nlp_all <*> (Map.fromList <$> m_nlp_other)
let mRet = NLPConfig <$> m_nlp_default <*> (Map.fromList <$> m_nlp_other)
case mRet of case mRet of
Nothing -> panicTrace $ T.concat [ "Cannot read config file: _nlp_all = " Nothing -> panicTrace $ T.concat [ "Cannot read config file: _nlp_all = "
, T.pack $ show m_nlp_all -- , T.pack $ show m_nlp_all
, T.pack $ show m_nlp_default
, ", _nlp_other = " , ", _nlp_other = "
, T.pack $ show m_nlp_other ] , T.pack $ show m_nlp_other ]
Just ret -> pure ret Just ret -> pure ret
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment