nkjp 0.2.0.1 → 0.3
raw patch · 3 files changed
+11/−6 lines, 3 filesdep ~data-named
Dependency ranges changed: data-named
Files
- Text/NKJP/Named.hs +1/−1
- nkjp.cabal +2/−2
- tools/named2enamex.hs +8/−3
Text/NKJP/Named.hs view
@@ -211,7 +211,7 @@ readCorpus = Tar.readCorpus "ann_named" parseNamed -- | Parse the NCP .tar.gz corpus, extract all NEs and translate them--- to the tree form using the 'mkForest' function. +-- to the tree form using the 'mkForest' function. readTrees :: FilePath -> IO [T.Forest (Either (NE L.Text) (Mx.Seg L.Text))] readTrees path = do morph <- Mx.readCorpus path
nkjp.cabal view
@@ -1,5 +1,5 @@ name: nkjp-version: 0.2.0.1+version: 0.3 synopsis: Manipulating the National Corpus of Polish (NKJP) description: The library provides parsing and printing utilities for the@@ -25,7 +25,7 @@ , zlib , tar >= 0.4 && < 0.5 , filepath- , data-named >= 0.4 && < 0.5+ , data-named >= 0.5.1 && < 0.6 exposed-modules: Text.NKJP.Morphosyntax
tools/named2enamex.hs view
@@ -18,12 +18,17 @@ , Ne.subType , Ne.derived >=> return . Ne.derivType ] -orth :: Mx.Seg L.Text -> T.Text-orth = L.toStrict . Mx.orth+orth :: [Mx.Seg L.Text] -> T.Text+orth = L.toStrict . L.concat . map Mx.orth main :: IO () main = do [teiPath] <- getArgs fs <- Ne.readTrees teiPath forM_ fs $ \ts ->- L.putStrLn . showForest . mapForest (onEither neType orth) $ ts+ L.putStrLn . showForest . prepare $ ts+ where+ prepare+ = mapForest (onEither neType orth)+ . groupForestLeaves sndNps+ sndNps _ seg = Mx.nps seg