systran v0.1.0 Systran.Translate View Source

Client requests to Translate services

Link to this section Summary

Functions

Translate text from source language to target language

Link to this section Functions

Link to this function

translate(attrs)

View Source
translate(map()) :: {:ok, %{}}

Translate text from source language to target language

Example

iex> Systran.Translate.translate(%{key: key, input: "hello world", source: "en", target: "es"})
{:ok, %{"outputs" => [%{"output" => "Hola mundo", "stats" => %{}}]}}

Options

key - access key, optional if key exists in config
input - text for translation, required
source - source language, ISO 639-1 format (like "en"), optional
target - target language, ISO 639-1 format (like "ru"), required