Library for working with context.reverso.net api
composer require otis22/reverso
Be careful library can translate only one a single word
Available language list: en, fr, es, de, it, pt, ru, ro, cz, zh
use Otis22\Reverso\Context;
$context = Context::fromLanguagesAndWord("ru", "en", "пример");
$context->original(); # return "пример"
$context->firstInDictionary(); # return "example" word, because it is the most popular variant in the reverso.net
$context->dictionary(); #return synonyms array ['example', 'sample', 'case', ...]
$context->examples(); #return examples sentences
/**
[
[
'source' => 'Красивый <em>пример</em> - прошлогодняя эпидемия свиного гриппа.',
'target' => 'So a nice <em>example</em> of this came from last year and swine flu.'
],
...
]
*/
For run all tests
make all
or connect to terminal
make exec
Dafault php version is 7.4. Use PHP_VERSION= for using custom version.
make all PHP_VERSION=8.0
# run both
make all PHP_VERSION=7.4 && make all PHP_VERSION=8.0
all commands
# composer install
make install
# composer install with --no-dev
make install-no-dev
# check code style
make style
# fix code style
make style-fix
# run static analyze tools
make static-analyze
# run unit tests
make unit
# check coverage
make coverage