otis22 / reverso
Library for working with reverso context api
0.0.6
2024-07-23 14:06 UTC
Requires
- ext-json: *
- elegant-bro/interfaces: ^1.2
- guzzlehttp/guzzle: >6.0
Requires (Dev)
- otis22/php-coverage-checker: ^1.2
- phpstan/phpstan: ^0.12.19
- phpunit/phpunit: ^9.1
- symplify/easy-coding-standard: ^9.3
README
Library for working with context.reverso.net api
How to use
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.' ], ... ] */
Contributing
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