concrete-haskell 0.1.0.10 → 0.1.0.11
raw patch · 4 files changed
+6/−9 lines, 4 files
Files
- concrete-haskell.cabal +1/−1
- src/Data/Concrete/Utils.hs +3/−5
- utils/IngestCommunications.hs +1/−2
- utils/InspectCommunication.hs +1/−1
concrete-haskell.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: concrete-haskell-version: 0.1.0.10+version: 0.1.0.11 synopsis: Library for the Concrete data format. description: Concrete is a Thrift-based data specification designed for Natural Language Processing (NLP) applications. This library provides a Haskell interface to code generated from the latest release of Concrete. It also has a number of utilities for converting various formats (JSON, CSV, XML, etc) to Concrete Communication objects. category: Data
src/Data/Concrete/Utils.hs view
@@ -109,16 +109,14 @@ transport <- newTString fillBuf (getRead transport) t let iproto = CompactProtocol transport- c <- read_Communication iproto- c' <- read_Communication iproto- return [c']+ readCommunications iproto [] where- readCommunication' pr cs = do+ readCommunications pr cs = do o <- tIsOpen $ getTransport pr case o of True -> do c <- read_Communication pr- readCommunication' pr $ c:cs+ readCommunications pr $ c:cs False -> return cs entryToString :: Tar.EntryContent -> BS.ByteString
utils/IngestCommunications.hs view
@@ -60,6 +60,5 @@ return $ StoreService.store con (Nothing, Nothing, Nothing) -> return $ writeCommunication stdout _ -> error "Specify either an output file, a host and port, or nothing (for stdout)"- cs <- ingest (putStrLn . unpack . CU.showCommunication) cp (decodeUtf8 ih) (contentSectionTypes ps) (commId ps) (commType ps) - --cs <- ingest print cp (decodeUtf8 ih) (contentSectionTypes ps) (commId ps) (commType ps)+ cs <- ingest cb cp (decodeUtf8 ih) (contentSectionTypes ps) (commId ps) (commType ps) return ()
utils/InspectCommunication.hs view
@@ -40,4 +40,4 @@ ".gz" -> CU.readCommunicationsFromBytes <$> ((liftM GZip.decompress . BS.readFile) f) _ -> CU.readCommunicationsFromBytes <$> (BS.readFile f) Nothing -> CU.readCommunicationsFromBytes <$> (BS.hGetContents stdin)- putStr $ ((T.unpack . T.concat) $ [CU.showCommunication (head cs)])+ putStr $ (T.unpack . T.concat) $ map CU.showCommunication cs