Copyright | (c) Mansur Ziatdinov, 2014--2015 |
---|---|
License | Apache-2.0 |
Maintainer | mz+textocat-api@fosslabs.ru |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Functions in this module are in one-to-one correspondence with API calls. However, there are two helpers which can help in your application
You have to pass Config
everywhere. If you think that it is inconvenient,
you can use Network.Textocat.Monadic instead. However, monadic interface
is experimental
- entityQueue :: Config -> [Document] -> IO (Either ErrorMsg BatchStatus)
- entityRequest :: Config -> BatchID -> IO (Either ErrorMsg BatchStatus)
- entityRetrieve :: Config -> [BatchID] -> IO (Either ErrorMsg Batch)
- entitySearch :: Config -> Text -> IO (Either ErrorMsg SearchResult)
- serviceStatus :: Config -> IO ServiceStatus
- waitForFinished :: Config -> BatchID -> IO ()
- queueRetrieve :: Config -> [Document] -> IO [[Entity]]
Entity API calls
:: Config | |
-> [Document] | List of documents, should be less than 50 |
-> IO (Either ErrorMsg BatchStatus) |
Queue documents
:: Config | Config |
-> BatchID | Batch ID to request |
-> IO (Either ErrorMsg BatchStatus) |
Request status of batch
Retrieve documents from finished batches
:: Config | Config |
-> Text | Search query |
-> IO (Either ErrorMsg SearchResult) |
Search text in all documents in collection
Status API call
Helper functions
Blocks until batch is finished. Repeats every 0.1 sec.
Queue documents and wait until they are finished. Returns all entities