fdp2/FDP.hs

44 lines
1.2 KiB
Haskell

{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
module Main (
module ParserW,
module Parse,
module Step,
module G1,
module PoliMorf,
module Data.ADTTag.IPITag.PoliMorf,
module PL1,
main
) where
import ParserW
import Parse
import Step
import G1
import Data.ADTTag.IPITag.PoliMorf
import PoliMorf
import PL1
import Weighted
import Control.Applicative
instance Show (WeightedList IPITag) where
show = show . runWeightedT
main = do
input <- words <$> getLine
pm <- readPoliMorfForms input "pm.tsv"
let WeightedT allparses = parse pm pl1 input :: WeightedList (Parse Role IPITag)
parselist = zip [1..] allparses
putStrLn $ "### PARSES: " ++ show (length parselist)
sequence_ $ map (\(n,Weighted w p) -> do
putStrLn $ "### " ++ show n ++ "#" ++ show w
-- putStrLn $ show p
sequence_ $ map (putStrLn . show) (conll input p)
) parselist
-- putStrLn $ "COMPLE: " ++ show (length (filter ((== 1) . trees . unweighted . snd) parselist))