Textgain v0.1.4 Textgain.Service View Source

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

Link to this section Summary

Functions

Execute a raw query against the Textgain service

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

Link to this section Functions

Link to this function

raw_query(service, params) View Source
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.

Link to this macro

service(name, module) View Source (macro)
service(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.