Textgain v0.1.2 Textgain.Service

This module provides the common entrypoints into the Textgain API used by the specific web service modules.

Summary

Functions

Execute a raw query against the Textgain service

Macros

Provides a mechanism to add Textgain services to the main Textgain module

Functions

raw_query(service, params)
raw_query(service :: binary, params :: keyword(binary)) :: map

Execute a raw query against the Textgain service.

This function is called providing the service endpoint name and a keyword list of parameters.

Note that the q parameter is always used to pass the text to be analyzed by the web service, and is limited to 3000 characters.

Macros

service(name, module)
service(term, name :: atom, module :: atom) :: none

Provides a mechanism to add Textgain services to the main Textgain module.

The macro is used in the following way:

service :age, TextGain.Age

Where the first parameter is the atom for the service name, and the second is the struct to cast the JSON to on decode.