packages feed

polh-lexicon-0.2: tools/polh-show.hs

import System.Environment (getArgs)
import qualified Data.Text.Lazy.IO as L

import NLP.Polh.LMF (showPolh)
import NLP.Polh.Binary (loadPolh, entry)

main = do
    [binPath] <- getArgs
    loadPolh binPath >>= \x -> case x of
        Nothing -> error "Not a dictionary"
        Just ph -> L.putStr (showPolh $ map entry ph)