Lingvo v0.9.0 Lingvo View Source

Elixir client for ABBYY Lingvo API

Configuration

An API key can be set in your application’s config.

config :lingvo, api_key: "LINGVO_API_KEY"

Link to this section Summary

Functions

Get API token. Token must be used in Bearer Authorization header in every translation API request

Translation for the word or phrase. Searches only in specified direction

Link to this section Types

Link to this section Functions

Link to this function authenticate() View Source
authenticate() :: {:ok, api_key()}

Get API token. Token must be used in Bearer Authorization header in every translation API request.

Examples

iex> Lingvo.authenticate
{:ok, "access_token"}
Link to this function translate(options, access_token) View Source
translate([tuple()], String.t()) :: String.t()

Translation for the word or phrase. Searches only in specified direction.

Examples

iex> Lingvo.translate([text: "Hola", from: "es", to: "ru"], access_token)
{
  :ok,
  %{
    [
      "ArticleId" => "Universal (Es-Ru)__hola",
      ...
    ]
  }
}

Options

text - Word or phrase to translate, required
from - Source language, required
to - Target language, required
case_sensitivity - If you need case-sensitive search then just add any value, optional, default is false