<commit_before>Yandex.Translate API
====================
[![Latest Stable Version](https://poser.pugx.org/yandex-php/translate-api/v/stable.svg)](https://packagist.org/packages/yandex-php/translate-api) [![Total Downloads](https://poser.pugx.org/yandex-php/translate-api/downloads.svg)](https://packagist.org/packages/yandex-php/translate-api) [![Latest Unstable Version](https://poser.pugx.org/yandex-php/translate-api/v/unstable.svg)](https://packagist.org/packages/yandex-php/translate-api) [![License](https://poser.pugx.org/yandex-php/translate-api/license.svg)](https://packagist.org/packages/yandex-php/translate-api)

[Api reference](http://api.yandex.com/translate/doc/dg/concepts/About.xml)

Versioning
----------

Package version corresponds to the version of the API.

Installation
------------

Add into your `composer.json`:

```json
{
  "require": {
    "yandex-php/translate-api": "~1.0"
  }
}
```

Usage
-----

[Get your own api key](http://api.yandex.com/key/form.xml?service=trnsl)

```php
use Yandex\Translate\Translator;
use Yandex\Translate\Exception;

try {
  $translator = new Translator($key);
  $translation = $translator->translate('Hello world', 'en-ru');

  echo $translation; // Привет мир<commit_msg>Fixed vendor name<commit_after>Yandex.Translate API
====================
[![Latest Stable Version](https://poser.pugx.org/yandex/translate-api/v/stable.svg)](https://packagist.org/packages/yandex/translate-api) [![Total Downloads](https://poser.pugx.org/yandex/translate-api/downloads.svg)](https://packagist.org/packages/yandex/translate-api) [![Latest Unstable Version](https://poser.pugx.org/yandex/translate-api/v/unstable.svg)](https://packagist.org/packages/yandex/translate-api) [![License](https://poser.pugx.org/yandex/translate-api/license.svg)](https://packagist.org/packages/yandex/translate-api)

[Api reference](http://api.yandex.com/translate/doc/dg/concepts/About.xml)

Versioning
----------

Package version corresponds to the version of the API.

Installation
------------

Add into your `composer.json`:

```json
{
  "require": {
    "yandex/translate-api": "~1.0"
  }
}
```

Usage
-----

[Get your own api key](http://api.yandex.com/key/form.xml?service=trnsl)

```php
use Yandex\Translate\Translator;
use Yandex\Translate\Exception;

try {
  $translator = new Translator($key);
  $translation = $translator->translate('Hello world', 'en-ru');

  echo $translation; // Привет мир
{'fraction_non_alphanumeric': 0.2102880658436214, 'fraction_numerical': 0.0016460905349794238, 'mean_word_length': 4.475225225225225, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4165789', 'n_tokens_mistral': 887, 'n_tokens_neox': 860, 'n_words': 111}