import PGF main = do pgf <- readPGF "Foods.pgf" interact (unlines . map (translate pgf) . lines) translate pgf s = case parseAllLang pgf (startCat pgf) s of (from,tree:_):_ -> unlines [linearize pgf to tree | to <- languages pgf, to/=from] _ -> "NO PARSE"