use the target function

the processDictionary function is the one we need to use for lookups, because it inserts all resources and gives just the full html at the end, ready to be displayed

Signed-off-by: hashirama <hashirama@noreply.localhost>
This commit is contained in:
千住柱間 2026-01-20 03:24:16 +00:00
commit 5b67ca2164

View file

@ -3,17 +3,22 @@
import System.Environment (getArgs)
import System.Exit (exitFailure)
import Control.Monad (when)
import MDict (lookupInCollection)
import MDict
main :: IO ()
main = do
args <- getArgs
when (length args < 2) $ do
putStrLn "Usage: Main <dictionary_dir> <query_key>"
exitFailure
args <- getArgs
when (length args < 2) $ do
putStrLn "Usage: Main <dictionary_dir> <query_key>"
exitFailure
let dictDir = args !! 0
queryKey = args !! 1
let dict = args !! 0
queryKey = args !! 1
-- Process all files
lookupInCollection dictDir queryKey
res <- processDictionary dict queryKey
html <- case res of
Left err -> error err
Right h -> return h
putStrLn (html)