textocat-api-0.1.0.0: Unofficial Haskell SDK for Textocat API -- http://textocat.com

Copyright(c) Mansur Ziatdinov, 2014--2015
LicenseApache-2.0
Maintainermz+textocat-api@fosslabs.ru
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Network.Textocat.Simple

Contents

Description

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

Synopsis

Entity API calls

entityQueue

Arguments

:: Config

Config

-> [Document]

List of documents, should be less than 50

-> IO (Either ErrorMsg BatchStatus) 

Queue documents

entityRequest

Arguments

:: Config
Config
-> BatchID

Batch ID to request

-> IO (Either ErrorMsg BatchStatus) 

Request status of batch

entityRetrieve

Arguments

:: Config
Config
-> [BatchID]

Batches to retrieve

-> IO (Either ErrorMsg Batch) 

Retrieve documents from finished batches

entitySearch

Arguments

:: Config
Config
-> Text

Search query

-> IO (Either ErrorMsg SearchResult) 

Search text in all documents in collection

Status API call

serviceStatus

Arguments

:: Config

Config

-> IO ServiceStatus 

Check status of service

Helper functions

waitForFinished

Arguments

:: Config

Config

-> BatchID

Batch

-> IO () 

Blocks until batch is finished. Repeats every 0.1 sec.

queueRetrieve

Arguments

:: Config

Config

-> [Document]

Documents

-> IO [[Entity]] 

Queue documents and wait until they are finished. Returns all entities